Package org.apache.flink.state.rocksdb
Class RocksDBResourceContainer
java.lang.Object
org.apache.flink.state.rocksdb.RocksDBResourceContainer
- All Implemented Interfaces:
AutoCloseable
The container for RocksDB resources, including predefined options, option factory and shared
resource among instances.
This should be the only entrance for EmbeddedRocksDBStateBackend to get RocksDB
options, and should be properly (and necessarily) closed to prevent resource leak.
-
Constructor Summary
ConstructorsConstructorDescriptionRocksDBResourceContainer(org.apache.flink.configuration.ReadableConfig configuration, PredefinedOptions predefinedOptions, RocksDBOptionsFactory optionsFactory, org.apache.flink.runtime.memory.OpaqueMemoryResource<org.apache.flink.state.rocksdb.RocksDBSharedResources> sharedResources, File instanceBasePath, boolean enableStatistics) RocksDBResourceContainer(PredefinedOptions predefinedOptions, RocksDBOptionsFactory optionsFactory) RocksDBResourceContainer(PredefinedOptions predefinedOptions, RocksDBOptionsFactory optionsFactory, org.apache.flink.runtime.memory.OpaqueMemoryResource<org.apache.flink.state.rocksdb.RocksDBSharedResources> sharedResources) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()org.rocksdb.ColumnFamilyOptionsGets the RocksDBColumnFamilyOptionsto be used for all RocksDB instances.org.rocksdb.DBOptionsGets the RocksDBDBOptionsto be used for RocksDB instances.Gets the "getPeriodicCompactionTime" parameter from the configuration.Gets the "queryTimeAfterNumEntries" parameter from the configuration.org.rocksdb.ReadOptionsGets the RocksDBReadOptionsto be used for read operations.Gets write buffer manager capacity.org.rocksdb.WriteOptionsGets the RocksDBWriteOptionsto be used for write operations.
-
Constructor Details
-
RocksDBResourceContainer
@VisibleForTesting public RocksDBResourceContainer() -
RocksDBResourceContainer
@VisibleForTesting public RocksDBResourceContainer(PredefinedOptions predefinedOptions, @Nullable RocksDBOptionsFactory optionsFactory) -
RocksDBResourceContainer
@VisibleForTesting public RocksDBResourceContainer(PredefinedOptions predefinedOptions, @Nullable RocksDBOptionsFactory optionsFactory, @Nullable org.apache.flink.runtime.memory.OpaqueMemoryResource<org.apache.flink.state.rocksdb.RocksDBSharedResources> sharedResources) -
RocksDBResourceContainer
public RocksDBResourceContainer(org.apache.flink.configuration.ReadableConfig configuration, PredefinedOptions predefinedOptions, @Nullable RocksDBOptionsFactory optionsFactory, @Nullable org.apache.flink.runtime.memory.OpaqueMemoryResource<org.apache.flink.state.rocksdb.RocksDBSharedResources> sharedResources, @Nullable File instanceBasePath, boolean enableStatistics)
-
-
Method Details
-
getDbOptions
public org.rocksdb.DBOptions getDbOptions()Gets the RocksDBDBOptionsto be used for RocksDB instances. -
getWriteBufferManagerCapacity
Gets write buffer manager capacity.- Returns:
- the capacity of the write buffer manager, or null if write buffer manager is not enabled.
-
getQueryTimeAfterNumEntries
Gets the "queryTimeAfterNumEntries" parameter from the configuration. -
getPeriodicCompactionTime
Gets the "getPeriodicCompactionTime" parameter from the configuration. -
getColumnOptions
public org.rocksdb.ColumnFamilyOptions getColumnOptions()Gets the RocksDBColumnFamilyOptionsto be used for all RocksDB instances. -
getWriteOptions
public org.rocksdb.WriteOptions getWriteOptions()Gets the RocksDBWriteOptionsto be used for write operations. -
getReadOptions
public org.rocksdb.ReadOptions getReadOptions()Gets the RocksDBReadOptionsto be used for read operations. -
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-