org.apache.storm.metricstore

## Interface MetricStore

- All Superinterfaces:
    AutoCloseable
  All Known Implementing Classes:
    NoOpMetricStore, RocksDbStore

      public interface MetricStore
      extends AutoCloseable

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `MetricStore.ScanCallback` Interface used to callback metrics results from a scan.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Close the metric store.
    `void` | `insert(Metric metric)` Stores a metric 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.

- - ### Method Detail

    - #### prepare

          void prepare(Map<String,Object> config,
                       StormMetricsRegistry metricsRegistry)
                throws MetricException

      Create metric store instance using the configurations provided via the config map.

      Parameters:
        `config` - Storm config map
        `metricsRegistry` - The Nimbus daemon metrics registry
      Throws:
        `MetricException` - on preparation error

    - #### insert

          void insert(Metric metric)
               throws MetricException

      Stores a metric in the store.

      Parameters:
        `metric` - Metric to store
      Throws:
        `MetricException` - on error

    - #### populateValue

          boolean populateValue(Metric metric)
                         throws MetricException

      Fill out the numeric values for a metric.

      Parameters:
        `metric` - Metric to populate
      Returns:
        true if the metric was populated, false otherwise
      Throws:
        `MetricException` - on error

    - #### close

          void close()

      Close the metric store.

      Specified by:
        `close` in interface `AutoCloseable`

    - #### scan

          void scan(FilterOptions filter,
                    MetricStore.ScanCallback scanCallback)
             throws MetricException

      Scans all metrics in the store and returns the ones matching the specified filtering options.

      Parameters:
        `filter` - options to filter by
        `scanCallback` - callback for each Metric found
      Throws:
        `MetricException` - on error

Copyright © 2021 The Apache Software Foundation. All rights reserved.