Package org.apache.storm.metricstore.rocksdb

# Interface WritableStringMetadataCache

All Superinterfaces:
  `ReadOnlyStringMetadataCache`

All Known Implementing Classes:
  `StringMetadataCache`

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
  Method
  Description
  `Set<Map.Entry<String,org.apache.storm.metricstore.rocksdb.StringMetadata>>`
  `entrySet()`
  Get the map of the cache contents.
  `void`
  `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.

    Parameters:
      `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
    Throws:
      `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.
    Returns:
      the string metadata map entrySet