Interface WritableStringMetadataCache

    • Method Detail

      • 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