Class 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 Detail

      • RocksDBResourceContainer

        @VisibleForTesting
        public RocksDBResourceContainer()
      • 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 RocksDB DBOptions 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 RocksDB ColumnFamilyOptions to be used for all RocksDB instances.
      • getWriteOptions

        public org.rocksdb.WriteOptions getWriteOptions()
        Gets the RocksDB WriteOptions to be used for write operations.
      • getReadOptions

        public org.rocksdb.ReadOptions getReadOptions()
        Gets the RocksDB ReadOptions to be used for read operations.