public class RocksDbStore extends Object implements MetricStore, AutoCloseable
MetricStore.ScanCallback
Constructor and Description |
---|
RocksDbStore() |
Modifier and Type | Method and 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.
|
public void prepare(Map<String,Object> config, StormMetricsRegistry metricsRegistry) throws MetricException
Create metric store instance using the configurations provided via the config map.
prepare
in interface MetricStore
config
- Storm config mapmetricsRegistry
- The Nimbus daemon metrics registryMetricException
- on preparation errorpublic void insert(Metric metric) throws MetricException
Stores metrics in the store.
insert
in interface MetricStore
metric
- Metric to storeMetricException
- if database write failspublic boolean populateValue(Metric metric) throws MetricException
Fill out the numeric values for a metric.
populateValue
in interface MetricStore
metric
- Metric to populateMetricException
- if read from database failspublic void close()
Shutdown the store.
close
in interface AutoCloseable
close
in interface MetricStore
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.
scan
in interface MetricStore
filter
- options to filter byscanCallback
- callback for each Metric foundMetricException
- on errorCopyright © 2019 The Apache Software Foundation. All rights reserved.