Class AbstractFileStateBackend
- All Implemented Interfaces:
Serializable,CheckpointStorage,StateBackend
This class takes the base checkpoint- and savepoint directory paths, but also accepts null for both of then, in which case creating externalized checkpoint is not possible, and it is not possible to create a savepoint with a default path. Null is accepted to enable implementations that only optionally support default savepoints and externalized checkpoints.
Checkpoint Layout
The state backend is configured with a base directory and persists the checkpoint data of
specific checkpoints in specific subdirectories. For example, if the base directory was set to
hdfs://namenode:port/flink-checkpoints/, the state backend will create a subdirectory
with the job's ID that will contain the actual checkpoints: (
hdfs://namenode:port/flink-checkpoints/1b080b6e710aabbef8993ab18c6de98b)
Each checkpoint individually will store all its files in a subdirectory that includes the
checkpoint number, such as
hdfs://namenode:port/flink-checkpoints/1b080b6e710aabbef8993ab18c6de98b/chk-17/.
Savepoint Layout
A savepoint that is set to be stored in path hdfs://namenode:port/flink-savepoints/,
will create a subdirectory savepoint-jobId(0, 6)-randomDigits in which it stores all
savepoint data. The random digits are added as "entropy" to avoid directory collisions.
Metadata File
A completed checkpoint writes its metadata into a file '"_metadata"'.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.runtime.state.StateBackend
StateBackend.CustomInitializationMetrics, StateBackend.KeyedStateBackendParameters<K>, StateBackend.OperatorStateBackendParameters -
Field Summary
Fields inherited from class org.apache.flink.runtime.state.AbstractStateBackend
latencyTrackingConfigBuilder -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractFileStateBackend(URI baseCheckpointPath, URI baseSavepointPath) Deprecated.Creates a backend with the given optional checkpoint- and savepoint base directories.protectedAbstractFileStateBackend(org.apache.flink.core.fs.Path baseCheckpointPath, org.apache.flink.core.fs.Path baseSavepointPath) Deprecated.Creates a backend with the given optional checkpoint- and savepoint base directories.protectedAbstractFileStateBackend(org.apache.flink.core.fs.Path baseCheckpointPath, org.apache.flink.core.fs.Path baseSavepointPath, org.apache.flink.configuration.ReadableConfig configuration) Deprecated.Creates a new backend using the given checkpoint-/savepoint directories, or the values defined in the given configuration. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.flink.core.fs.PathDeprecated.Gets the checkpoint base directory.org.apache.flink.core.fs.PathDeprecated.Gets the directory where savepoints are stored by default (when no custom path is given to the savepoint trigger command).resolveCheckpoint(String pointer) Deprecated.Resolves the given pointer to a checkpoint/savepoint into a checkpoint location.Methods inherited from class org.apache.flink.runtime.state.AbstractStateBackend
createKeyedStateBackend, createOperatorStateBackend, getCompressionDecoratorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.runtime.state.CheckpointStorage
createCheckpointStorageMethods inherited from interface org.apache.flink.runtime.state.StateBackend
createAsyncKeyedStateBackend, getName, supportsAsyncKeyedStateBackend, supportsNoClaimRestoreMode, supportsSavepointFormat, useManagedMemory
-
Constructor Details
-
AbstractFileStateBackend
protected AbstractFileStateBackend(@Nullable URI baseCheckpointPath, @Nullable URI baseSavepointPath) Deprecated.Creates a backend with the given optional checkpoint- and savepoint base directories.- Parameters:
baseCheckpointPath- The base directory for checkpoints, or null, if none is configured.baseSavepointPath- The default directory for savepoints, or null, if none is set.
-
AbstractFileStateBackend
protected AbstractFileStateBackend(@Nullable org.apache.flink.core.fs.Path baseCheckpointPath, @Nullable org.apache.flink.core.fs.Path baseSavepointPath) Deprecated.Creates a backend with the given optional checkpoint- and savepoint base directories.- Parameters:
baseCheckpointPath- The base directory for checkpoints, or null, if none is configured.baseSavepointPath- The default directory for savepoints, or null, if none is set.
-
AbstractFileStateBackend
protected AbstractFileStateBackend(@Nullable org.apache.flink.core.fs.Path baseCheckpointPath, @Nullable org.apache.flink.core.fs.Path baseSavepointPath, org.apache.flink.configuration.ReadableConfig configuration) Deprecated.Creates a new backend using the given checkpoint-/savepoint directories, or the values defined in the given configuration. If a checkpoint-/savepoint parameter is not null, that value takes precedence over the value in the configuration. If the configuration does not specify a value, it is possible that the checkpoint-/savepoint directories in the backend will be null.This constructor can be used to create a backend that is based partially on a given backend and partially on a configuration.
- Parameters:
baseCheckpointPath- The checkpoint base directory to use (or null).baseSavepointPath- The default savepoint directory to use (or null).configuration- The configuration to read values from.
-
-
Method Details
-
getCheckpointPath
@Nullable public org.apache.flink.core.fs.Path getCheckpointPath()Deprecated.Gets the checkpoint base directory. Jobs will create job-specific subdirectories for checkpoints within this directory. May be null, if not configured.- Returns:
- The checkpoint base directory
-
getSavepointPath
@Nullable public org.apache.flink.core.fs.Path getSavepointPath()Deprecated.Gets the directory where savepoints are stored by default (when no custom path is given to the savepoint trigger command).- Returns:
- The default directory for savepoints, or null, if no default directory has been configured.
-
resolveCheckpoint
Deprecated.Description copied from interface:CheckpointStorageResolves the given pointer to a checkpoint/savepoint into a checkpoint location. The location supports reading the checkpoint metadata, or disposing the checkpoint storage location.- Specified by:
resolveCheckpointin interfaceCheckpointStorage- Parameters:
pointer- The external checkpoint pointer to resolve.- Returns:
- The checkpoint location handle.
- Throws:
IOException- Thrown, if the state backend does not understand the pointer, or if the pointer could not be resolved due to an I/O error.
-
CheckpointStoragefunctionality. Please inheritAbstractStateBackendinstead. Custom checkpoint storage can be additionally implemented as a separate class.