Interface WritableStringMetadataCache
- All Superinterfaces:
ReadOnlyStringMetadataCache
- All Known Implementing Classes:
StringMetadataCache
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 TypeMethodDescriptionentrySet()
Get the map of the cache contents.void
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 addstringMetadata
- The string's metadatanewEntry
- 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
Get the map of the cache contents. Provided to allow writing the data to RocksDB on shutdown.- Returns:
- the string metadata map entrySet
-