Package org.apache.storm.metricstore.rocksdb

# Class RocksDbStore

java.lang.Object
org.apache.storm.metricstore.rocksdb.RocksDbStore

All Implemented Interfaces:
  `AutoCloseable`, `MetricStore`

public class RocksDbStore extends Object implements MetricStore, AutoCloseable

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface org.apache.storm.metricstore.MetricStore

  `MetricStore.ScanCallback`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `RocksDbStore()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  Shutdown the store.
  `void`
  `insert(Metric metric)`
  Stores metrics in the store.
  `boolean`
  `populateValue(Metric metric)`
  Fill out the numeric values for a metric.
  `void`
  `prepare(Map<String,Object> config, StormMetricsRegistry metricsRegistry)`
  Create metric store instance using the configurations provided via the config map.
  `void`
  `scan(FilterOptions filter, MetricStore.ScanCallback scanCallback)`
  Scans all metrics in the store and returns the ones matching the specified filtering options.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### RocksDbStore

    public RocksDbStore()

- ## Method Details

  - ### prepare

    public void prepare(Map<String,Object> config, StormMetricsRegistry metricsRegistry) throws MetricException
    Create metric store instance using the configurations provided via the config map.
    Specified by:
      `prepare` in interface `MetricStore`
    Parameters:
      `config` - Storm config map
      `metricsRegistry` - The Nimbus daemon metrics registry
    Throws:
      `MetricException` - on preparation error

  - ### insert

    public void insert(Metric metric) throws MetricException
    Stores metrics in the store.
    Specified by:
      `insert` in interface `MetricStore`
    Parameters:
      `metric` - Metric to store
    Throws:
      `MetricException` - if database write fails

  - ### populateValue

    public boolean populateValue(Metric metric) throws MetricException
    Fill out the numeric values for a metric.
    Specified by:
      `populateValue` in interface `MetricStore`
    Parameters:
      `metric` - Metric to populate
    Returns:
      true if the metric was populated, false otherwise
    Throws:
      `MetricException` - if read from database fails

  - ### close

    public void close()
    Shutdown the store.
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `MetricStore`

  - ### scan

    public void scan(FilterOptions filter, MetricStore.ScanCallback scanCallback) throws MetricException
    Scans all metrics in the store and returns the ones matching the specified filtering options. Callback returns Metric class results.
    Specified by:
      `scan` in interface `MetricStore`
    Parameters:
      `filter` - options to filter by
      `scanCallback` - callback for each Metric found
    Throws:
      `MetricException` - on error