Package org.apache.flink.state.forst
Class ForStResourceContainer
java.lang.Object
org.apache.flink.state.forst.ForStResourceContainer
- All Implemented Interfaces:
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.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionForStResourceContainer(org.apache.flink.configuration.ReadableConfig configuration, ForStOptionsFactory optionsFactory, org.apache.flink.runtime.memory.OpaqueMemoryResource<org.apache.flink.state.forst.ForStSharedResources> sharedResources, org.apache.flink.core.fs.Path localBasePath, org.apache.flink.core.fs.Path remoteBasePath, org.apache.flink.core.execution.RecoveryClaimMode claimMode, org.apache.flink.runtime.state.CheckpointStorageAccess checkpointStorageAccess, org.apache.flink.metrics.MetricGroup metricGroup, boolean enableStatistics) ForStResourceContainer(ForStOptionsFactory optionsFactory) ForStResourceContainer(ForStOptionsFactory optionsFactory, org.apache.flink.runtime.memory.OpaqueMemoryResource<org.apache.flink.state.forst.ForStSharedResources> sharedResources) -
Method Summary
Modifier and TypeMethodDescriptionvoidClear local and remote directories.voidclose()voidorg.apache.flink.core.fs.Pathorg.forstdb.ColumnFamilyOptionsGets the ForStColumnFamilyOptionsto be used for all ForSt instances.org.forstdb.DBOptionsGets the ForStDBOptionsto be used for ForSt instances.org.apache.flink.core.fs.Pathorg.apache.flink.core.fs.Pathorg.apache.flink.core.fs.PathGets the "getPeriodicCompactionTime" parameter from the configuration.Gets the "queryTimeAfterNumEntries" parameter from the configuration.intorg.forstdb.ReadOptionsGets the ForStReadOptionsto be used for read operations.org.apache.flink.core.fs.Pathorg.apache.flink.core.fs.PathGets write buffer manager capacity.intorg.forstdb.WriteOptionsGets the ForStWriteOptionsto be used for write operations.booleanbooleanvoidPrepare local and remote directories.
-
Field Details
-
DB_DIR_STRING
- See Also:
-
-
Constructor Details
-
ForStResourceContainer
@VisibleForTesting public ForStResourceContainer() -
ForStResourceContainer
-
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 org.apache.flink.core.fs.Path localBasePath, @Nullable org.apache.flink.core.fs.Path remoteBasePath, org.apache.flink.core.execution.RecoveryClaimMode claimMode, @Nullable org.apache.flink.runtime.state.CheckpointStorageAccess checkpointStorageAccess, org.apache.flink.metrics.MetricGroup metricGroup, boolean enableStatistics)
-
-
Method Details
-
getDbOptions
public org.forstdb.DBOptions getDbOptions()Gets the ForStDBOptionsto be used for ForSt instances. -
getColumnOptions
public org.forstdb.ColumnFamilyOptions getColumnOptions()Gets the ForStColumnFamilyOptionsto be used for all ForSt instances. -
getWriteOptions
public org.forstdb.WriteOptions getWriteOptions()Gets the ForStWriteOptionsto be used for write operations. -
getReadOptions
public org.forstdb.ReadOptions getReadOptions()Gets the ForStReadOptionsto be used for read operations. -
getLocalBasePath
@Nullable public org.apache.flink.core.fs.Path getLocalBasePath() -
getLocalForStPath
@Nullable public org.apache.flink.core.fs.Path getLocalForStPath() -
getRemoteBasePath
@Nullable public org.apache.flink.core.fs.Path getRemoteBasePath() -
getRemoteForStPath
@Nullable public org.apache.flink.core.fs.Path getRemoteForStPath() -
getBasePath
public org.apache.flink.core.fs.Path getBasePath() -
getDbPath
public org.apache.flink.core.fs.Path getDbPath() -
isCoordinatorInline
public boolean isCoordinatorInline() -
isWriteInline
public boolean isWriteInline() -
getReadIoParallelism
public int getReadIoParallelism() -
getWriteIoParallelism
public int getWriteIoParallelism() -
prepareDirectories
Prepare local and remote directories.- Throws:
Exception- if any unexpected behaviors.
-
getFileSystem
-
clearDirectories
Clear local and remote directories.- Throws:
Exception- if any unexpected behaviors.
-
forceClearRemoteDirectories
- Throws:
Exception
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
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.
-