Package org.apache.flink.state.forst
Class ForStResourceContainer
- java.lang.Object
-
- org.apache.flink.state.forst.ForStResourceContainer
-
- All Implemented Interfaces:
AutoCloseable
public final class ForStResourceContainer extends Object implements AutoCloseable
The container for ForSt resources, including option factory and shared resource among instances.This should be the only entrance for ForStStateBackend to get ForSt options, and should be properly (and necessarily) closed to prevent resource leak.
-
-
Constructor Summary
Constructors Constructor Description ForStResourceContainer()ForStResourceContainer(org.apache.flink.configuration.ReadableConfig configuration, ForStOptionsFactory optionsFactory, org.apache.flink.runtime.memory.OpaqueMemoryResource<org.apache.flink.state.forst.ForStSharedResources> sharedResources, File localBasePath, org.apache.flink.core.fs.Path remoteBasePath, boolean enableStatistics)ForStResourceContainer(ForStOptionsFactory optionsFactory)ForStResourceContainer(ForStOptionsFactory optionsFactory, org.apache.flink.runtime.memory.OpaqueMemoryResource<org.apache.flink.state.forst.ForStSharedResources> sharedResources)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearDirectories()Clear local and remote directories.voidclose()org.rocksdb.ColumnFamilyOptionsgetColumnOptions()Gets the ForStColumnFamilyOptionsto be used for all ForSt instances.org.rocksdb.DBOptionsgetDbOptions()Gets the ForStDBOptionsto be used for ForSt instances.FilegetLocalBasePath()FilegetLocalForStPath()org.rocksdb.ReadOptionsgetReadOptions()Gets the ForStReadOptionsto be used for read operations.org.apache.flink.core.fs.PathgetRemoteBasePath()org.apache.flink.core.fs.PathgetRemoteForStPath()org.rocksdb.WriteOptionsgetWriteOptions()Gets the ForStWriteOptionsto be used for write operations.voidprepareDirectories()Prepare local and remote directories.
-
-
-
Constructor Detail
-
ForStResourceContainer
@VisibleForTesting public ForStResourceContainer()
-
ForStResourceContainer
@VisibleForTesting public ForStResourceContainer(@Nullable ForStOptionsFactory optionsFactory)
-
ForStResourceContainer
@VisibleForTesting public ForStResourceContainer(@Nullable ForStOptionsFactory optionsFactory, @Nullable org.apache.flink.runtime.memory.OpaqueMemoryResource<org.apache.flink.state.forst.ForStSharedResources> sharedResources)
-
ForStResourceContainer
public ForStResourceContainer(org.apache.flink.configuration.ReadableConfig configuration, @Nullable ForStOptionsFactory optionsFactory, @Nullable org.apache.flink.runtime.memory.OpaqueMemoryResource<org.apache.flink.state.forst.ForStSharedResources> sharedResources, @Nullable File localBasePath, @Nullable org.apache.flink.core.fs.Path remoteBasePath, boolean enableStatistics)
-
-
Method Detail
-
getDbOptions
public org.rocksdb.DBOptions getDbOptions()
Gets the ForStDBOptionsto be used for ForSt instances.
-
getColumnOptions
public org.rocksdb.ColumnFamilyOptions getColumnOptions()
Gets the ForStColumnFamilyOptionsto be used for all ForSt instances.
-
getWriteOptions
public org.rocksdb.WriteOptions getWriteOptions()
Gets the ForStWriteOptionsto be used for write operations.
-
getReadOptions
public org.rocksdb.ReadOptions getReadOptions()
Gets the ForStReadOptionsto be used for read operations.
-
getRemoteBasePath
@Nullable public org.apache.flink.core.fs.Path getRemoteBasePath()
-
getRemoteForStPath
@Nullable public org.apache.flink.core.fs.Path getRemoteForStPath()
-
prepareDirectories
public void prepareDirectories() throws ExceptionPrepare local and remote directories.- Throws:
Exception- if any unexpected behaviors.
-
clearDirectories
public void clearDirectories() throws ExceptionClear local and remote directories.- Throws:
Exception- if any unexpected behaviors.
-
close
public void close() throws Exception- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
-