Interface WritableStringMetadataCache

All Superinterfaces:
All Known Implementing Classes:

public interface WritableStringMetadataCache extends ReadOnlyStringMetadataCache
The writable interface to a StringMetadataCache intended to be used by a single RocksDBMetricwWriter instance. This class is not thread safe.
  • Method Summary

    Modifier and Type
    Get the map of the cache contents.
    put(String s, org.apache.storm.metricstore.rocksdb.StringMetadata stringMetadata, boolean newEntry)
    Add the string metadata to the cache.

    Methods inherited from interface org.apache.storm.metricstore.rocksdb.ReadOnlyStringMetadataCache

    contains, get, getMetadataString
  • Method Details

    • put

      void put(String s, org.apache.storm.metricstore.rocksdb.StringMetadata stringMetadata, boolean newEntry) throws MetricException
      Add the string metadata to the cache.

      NOTE: this can cause data to be evicted from the cache when full. When this occurs, the evictionCallback() method is called to store the metadata back into the RocksDB database.

      This method is only exposed to the WritableStringMetadataCache interface.

      s - The string to add
      stringMetadata - The string's metadata
      newEntry - Indicates the metadata is being used for the first time and should be written to RocksDB immediately
      MetricException - when evicted data fails to save to the database or when the database is shutdown
    • entrySet

      Set<Map.Entry<String,org.apache.storm.metricstore.rocksdb.StringMetadata>> entrySet()
      Get the map of the cache contents. Provided to allow writing the data to RocksDB on shutdown.
      the string metadata map entrySet