public interface OptionsFactory extends Serializable
DBOptions and ColumnFamilyOptions to be passed to the RocksDBStateBackend.
Options have to be created lazily by this factory, because the Options
class is not serializable and holds pointers to native code.
A typical pattern to use this OptionsFactory is as follows:
rocksDbBackend.setOptions(new OptionsFactory(){
public DBOptions createDBOptions(DBOptions currentOptions) {
return currentOptions.setMaxOpenFiles(1024);
}
public ColumnFamilyOptions createColumnOptions(ColumnFamilyOptions currentOptions) {
return currentOptions.setCompactionStyle(CompactionStyle.LEVEL);
}
});
| Modifier and Type | Method and Description |
|---|---|
org.rocksdb.ColumnFamilyOptions |
createColumnOptions(org.rocksdb.ColumnFamilyOptions currentOptions)
This method should set the additional options on top of the current options object.
|
org.rocksdb.DBOptions |
createDBOptions(org.rocksdb.DBOptions currentOptions)
This method should set the additional options on top of the current options object.
|
org.rocksdb.DBOptions createDBOptions(org.rocksdb.DBOptions currentOptions)
It is important to set the options on the current object and return the result from the setter methods, otherwise the pre-defined options may get lost.
currentOptions - The options object with the pre-defined options.org.rocksdb.ColumnFamilyOptions createColumnOptions(org.rocksdb.ColumnFamilyOptions currentOptions)
It is important to set the options on the current object and return the result from the setter methods, otherwise the pre-defined options may get lost.
currentOptions - The options object with the pre-defined options.Copyright © 2014–2018 The Apache Software Foundation. All rights reserved.