Class ForStStateBackend
- All Implemented Interfaces:
Serializable,org.apache.flink.runtime.state.ConfigurableStateBackend,org.apache.flink.runtime.state.StateBackend
StateBackend that stores its state in a ForSt instance.
This state backend can store very large state that exceeds memory even disk and spills to remote
storage.
The behavior of the ForSt instances can be parametrized by setting ForSt Options using the
methods setForStOptions(ForStOptionsFactory).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe options to chose for the type of priority queue state.Nested classes/interfaces inherited from interface org.apache.flink.runtime.state.StateBackend
org.apache.flink.runtime.state.StateBackend.CustomInitializationMetrics, org.apache.flink.runtime.state.StateBackend.KeyedStateBackendParameters<K extends Object>, org.apache.flink.runtime.state.StateBackend.OperatorStateBackendParameters -
Field Summary
FieldsFields inherited from class org.apache.flink.runtime.state.AbstractStateBackend
latencyTrackingConfigBuilder -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconfigure(org.apache.flink.configuration.ReadableConfig config, ClassLoader classLoader) Creates a copy of this state backend that uses the values defined in the configuration for fields where that were not yet specified in this state backend.<K> ForStKeyedStateBackend<K>createAsyncKeyedStateBackend(org.apache.flink.runtime.state.StateBackend.KeyedStateBackendParameters<K> parameters) <K> org.apache.flink.runtime.state.AbstractKeyedStateBackend<K>createKeyedStateBackend(org.apache.flink.runtime.state.StateBackend.KeyedStateBackendParameters<K> parameters) org.apache.flink.runtime.state.OperatorStateBackendcreateOperatorStateBackend(org.apache.flink.runtime.state.StateBackend.OperatorStateBackendParameters parameters) GetsOptionsfor the ForSt instances.String[]Gets the configured local DB storage paths, or null, if none were configured.booleanGets whether incremental checkpoints are enabled for this state backend.voidsetForStOptions(ForStOptionsFactory optionsFactory) SetsOptionsfor the ForSt instances.voidsetLocalDbStoragePath(String path) Sets the path where the ForSt local files should be stored on the local file system.voidsetLocalDbStoragePaths(String... paths) Sets the local directories in which the ForSt database puts some files (like metadata files).booleanbooleanbooleansupportsSavepointFormat(org.apache.flink.core.execution.SavepointFormatType formatType) toString()Methods inherited from class org.apache.flink.runtime.state.AbstractManagedMemoryStateBackend
useManagedMemoryMethods inherited from class org.apache.flink.runtime.state.AbstractStateBackend
getCompressionDecoratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.flink.runtime.state.StateBackend
getName, useManagedMemory
-
Field Details
-
CHECKPOINT_DIR_AS_PRIMARY_SHORTCUT
- See Also:
-
LOCAL_DIR_AS_PRIMARY_SHORTCUT
- See Also:
-
-
Constructor Details
-
ForStStateBackend
public ForStStateBackend()Creates a newForStStateBackendfor storing state.
-
-
Method Details
-
configure
public ForStStateBackend configure(org.apache.flink.configuration.ReadableConfig config, ClassLoader classLoader) Creates a copy of this state backend that uses the values defined in the configuration for fields where that were not yet specified in this state backend.- Specified by:
configurein interfaceorg.apache.flink.runtime.state.ConfigurableStateBackend- Parameters:
config- The configuration.classLoader- The class loader.- Returns:
- The re-configured variant of the state backend
-
supportsAsyncKeyedStateBackend
public boolean supportsAsyncKeyedStateBackend()- Specified by:
supportsAsyncKeyedStateBackendin interfaceorg.apache.flink.runtime.state.StateBackend
-
createAsyncKeyedStateBackend
public <K> ForStKeyedStateBackend<K> createAsyncKeyedStateBackend(org.apache.flink.runtime.state.StateBackend.KeyedStateBackendParameters<K> parameters) throws IOException - Specified by:
createAsyncKeyedStateBackendin interfaceorg.apache.flink.runtime.state.StateBackend- Throws:
IOException
-
createKeyedStateBackend
public <K> org.apache.flink.runtime.state.AbstractKeyedStateBackend<K> createKeyedStateBackend(org.apache.flink.runtime.state.StateBackend.KeyedStateBackendParameters<K> parameters) throws IOException - Specified by:
createKeyedStateBackendin interfaceorg.apache.flink.runtime.state.StateBackend- Specified by:
createKeyedStateBackendin classorg.apache.flink.runtime.state.AbstractManagedMemoryStateBackend- Throws:
IOException
-
createOperatorStateBackend
public org.apache.flink.runtime.state.OperatorStateBackend createOperatorStateBackend(org.apache.flink.runtime.state.StateBackend.OperatorStateBackendParameters parameters) throws Exception - Specified by:
createOperatorStateBackendin interfaceorg.apache.flink.runtime.state.StateBackend- Specified by:
createOperatorStateBackendin classorg.apache.flink.runtime.state.AbstractStateBackend- Throws:
Exception
-
isIncrementalCheckpointsEnabled
public boolean isIncrementalCheckpointsEnabled()Gets whether incremental checkpoints are enabled for this state backend. -
supportsNoClaimRestoreMode
public boolean supportsNoClaimRestoreMode()- Specified by:
supportsNoClaimRestoreModein interfaceorg.apache.flink.runtime.state.StateBackend
-
supportsSavepointFormat
public boolean supportsSavepointFormat(org.apache.flink.core.execution.SavepointFormatType formatType) - Specified by:
supportsSavepointFormatin interfaceorg.apache.flink.runtime.state.StateBackend
-
setLocalDbStoragePath
Sets the path where the ForSt local files should be stored on the local file system. Setting this path overrides the default behavior, where the files are stored across the configured temp directories.Passing
nullto this function restores the default behavior, where the configured temp directories will be used.- Parameters:
path- The path where the local ForSt database files are stored.
-
setLocalDbStoragePaths
Sets the local directories in which the ForSt database puts some files (like metadata files). These directories do not need to be persistent, they can be ephemeral, meaning that they are lost on a machine failure, because state in ForSt is persisted in checkpoints.If nothing is configured, these directories default to the TaskManager's local temporary file directories.
Each distinct state will be stored in one path, but when the state backend creates multiple states, they will store their files on different paths.
Passing
nullto this function restores the default behavior, where the configured temp directories will be used.- Parameters:
paths- The paths across which the local ForSt database files will be spread.
-
getLocalDbStoragePaths
Gets the configured local DB storage paths, or null, if none were configured.Under these directories on the TaskManager, ForSt stores some metadata files. These directories do not need to be persistent, they can be ephermeral, meaning that they are lost on a machine failure, because state in ForSt is persisted in checkpoints.
If nothing is configured, these directories default to the TaskManager's local temporary file directories.
-
setForStOptions
SetsOptionsfor the ForSt instances. Because the options are not serializable and hold native code references, they must be specified through a factory.The options created by the factory here are applied on top of user-configured options from configuration set by
configure(ReadableConfig, ClassLoader)with keys inForStConfigurableOptions.- Parameters:
optionsFactory- The options factory that lazily creates the ForSt options.
-
getForStOptions
GetsOptionsfor the ForSt instances. -
toString
-