Class RocksDBResourceContainer
- java.lang.Object
-
- org.apache.flink.contrib.streaming.state.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
EmbeddedRocksDBStateBackend
to 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.contrib.streaming.state.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.contrib.streaming.state.RocksDBSharedResources> sharedResources)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
org.rocksdb.ColumnFamilyOptions
getColumnOptions()
Gets the RocksDBColumnFamilyOptions
to be used for all RocksDB instances.org.rocksdb.DBOptions
getDbOptions()
Gets the RocksDBDBOptions
to be used for RocksDB instances.Duration
getPeriodicCompactionTime()
Gets the "getPeriodicCompactionTime" parameter from the configuration.Long
getQueryTimeAfterNumEntries()
Gets the "queryTimeAfterNumEntries" parameter from the configuration.org.rocksdb.ReadOptions
getReadOptions()
Gets the RocksDBReadOptions
to be used for read operations.Long
getWriteBufferManagerCapacity()
Gets write buffer manager capacity.org.rocksdb.WriteOptions
getWriteOptions()
Gets the RocksDBWriteOptions
to 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.contrib.streaming.state.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.contrib.streaming.state.RocksDBSharedResources> sharedResources, @Nullable File instanceBasePath, boolean enableStatistics)
-
-
Method Detail
-
getDbOptions
public org.rocksdb.DBOptions getDbOptions()
Gets the RocksDBDBOptions
to 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 RocksDBColumnFamilyOptions
to be used for all RocksDB instances.
-
getWriteOptions
public org.rocksdb.WriteOptions getWriteOptions()
Gets the RocksDBWriteOptions
to be used for write operations.
-
getReadOptions
public org.rocksdb.ReadOptions getReadOptions()
Gets the RocksDBReadOptions
to be used for read operations.
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-