@ -20,6 +20,9 @@ import org.rocksdb.Options;
@@ -20,6 +20,9 @@ import org.rocksdb.Options;
import java.util.Map ;
import org.slf4j.Logger ;
import org.slf4j.LoggerFactory ;
/ * *
* An interface to that allows developers to customize the RocksDB settings for a given Store .
* Please read the < a href = "https://github.com/facebook/rocksdb/wiki/RocksDB-Tuning-Guide" > RocksDB Tuning Guide < / a > .
@ -29,6 +32,8 @@ import java.util.Map;
@@ -29,6 +32,8 @@ import java.util.Map;
* /
public interface RocksDBConfigSetter {
Logger LOG = LoggerFactory . getLogger ( RocksDBConfigSetter . class ) ;
/ * *
* Set the rocks db options for the provided storeName .
*
@ -37,4 +42,21 @@ public interface RocksDBConfigSetter {
@@ -37,4 +42,21 @@ public interface RocksDBConfigSetter {
* @param configs the configuration supplied to { @link org . apache . kafka . streams . StreamsConfig }
* /
void setConfig ( final String storeName , final Options options , final Map < String , Object > configs ) ;
/ * *
* Close any user - constructed objects that inherit from { @code org . rocksdb . RocksObject } .
* < p >
* Any object created with { @code new } in { @link RocksDBConfigSetter # setConfig setConfig ( ) } and that inherits
* from { @code org . rocksdb . RocksObject } should have { @code org . rocksdb . RocksObject # close ( ) }
* called on it here to avoid leaking off - heap memory . Objects to be closed can be saved by the user or retrieved
* back from { @code options } using its getter methods .
* < p >
* Example objects needing to be closed include { @code org . rocksdb . Filter } and { @code org . rocksdb . Cache } .
*
* @param storeName the name of the store being configured
* @param options the RocksDB options
* /
default void close ( final String storeName , final Options options ) {
LOG . warn ( "The default close will be removed in 3.0.0 -- you should overwrite it if you have implemented RocksDBConfigSetter" ) ;
}
}