Package org.apache.flink.state.rocksdb
Class RocksDBResourceContainer
- java.lang.Object
-
- org.apache.flink.state.rocksdb.RocksDBResourceContainer
-
- All Implemented Interfaces:
AutoCloseable
public final class RocksDBResourceContainer extends Object implements AutoCloseable
The container for RocksDB resources, including predefined options, option factory and shared resource among instances.This should be the only entrance for
EmbeddedRocksDBStateBackendto get RocksDB options, and should be properly (and necessarily) closed to prevent resource leak.
-
-
Constructor Summary
Constructors Constructor Description RocksDBResourceContainer()RocksDBResourceContainer(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()org.rocksdb.ColumnFamilyOptionsgetColumnOptions()Gets the RocksDBColumnFamilyOptionsto be used for all RocksDB instances.org.rocksdb.DBOptionsgetDbOptions()Gets the RocksDBDBOptionsto be used for RocksDB instances.DurationgetPeriodicCompactionTime()Gets the "getPeriodicCompactionTime" parameter from the configuration.LonggetQueryTimeAfterNumEntries()Gets the "queryTimeAfterNumEntries" parameter from the configuration.org.rocksdb.ReadOptionsgetReadOptions()Gets the RocksDBReadOptionsto be used for read operations.LonggetWriteBufferManagerCapacity()Gets write buffer manager capacity.org.rocksdb.WriteOptionsgetWriteOptions()Gets the RocksDBWriteOptionsto be used for write operations.
-
-
-
Constructor Detail
-
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 Detail
-
getDbOptions
public org.rocksdb.DBOptions getDbOptions()
Gets the RocksDBDBOptionsto be used for RocksDB instances.
-
getWriteBufferManagerCapacity
public Long getWriteBufferManagerCapacity()
Gets write buffer manager capacity.- Returns:
- the capacity of the write buffer manager, or null if write buffer manager is not enabled.
-
getQueryTimeAfterNumEntries
public Long getQueryTimeAfterNumEntries()
Gets the "queryTimeAfterNumEntries" parameter from the configuration.
-
getPeriodicCompactionTime
public Duration 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
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-