@PublicEvolving public abstract class AbstractFileStateBackend extends AbstractStateBackend
FsStateBackend
, the MemoryStateBackend
, or the RocksDBStateBackend
.
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.
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/
.
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.
A completed checkpoint writes its metadata into a file ''.
Modifier | Constructor and Description |
---|---|
protected |
AbstractFileStateBackend(Path baseCheckpointPath,
Path baseSavepointPath)
Creates a backend with the given optional checkpoint- and savepoint base directories.
|
protected |
AbstractFileStateBackend(Path baseCheckpointPath,
Path baseSavepointPath,
ReadableConfig configuration)
Creates a new backend using the given checkpoint-/savepoint directories, or the values
defined in the given configuration.
|
protected |
AbstractFileStateBackend(URI baseCheckpointPath,
URI baseSavepointPath)
Creates a backend with the given optional checkpoint- and savepoint base directories.
|
Modifier and Type | Method and Description |
---|---|
Path |
getCheckpointPath()
Gets the checkpoint base directory.
|
Path |
getSavepointPath()
Gets the directory where savepoints are stored by default (when no custom path is given to
the savepoint trigger command).
|
CompletedCheckpointStorageLocation |
resolveCheckpoint(String pointer)
Resolves the given pointer to a checkpoint/savepoint into a checkpoint location.
|
createKeyedStateBackend, createOperatorStateBackend, getCompressionDecorator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createCheckpointStorage, createKeyedStateBackend, useManagedMemory
protected AbstractFileStateBackend(@Nullable URI baseCheckpointPath, @Nullable URI baseSavepointPath)
baseCheckpointPath
- The base directory for checkpoints, or null, if none is configured.baseSavepointPath
- The default directory for savepoints, or null, if none is set.protected AbstractFileStateBackend(@Nullable Path baseCheckpointPath, @Nullable Path baseSavepointPath)
baseCheckpointPath
- The base directory for checkpoints, or null, if none is configured.baseSavepointPath
- The default directory for savepoints, or null, if none is set.protected AbstractFileStateBackend(@Nullable Path baseCheckpointPath, @Nullable Path baseSavepointPath, ReadableConfig configuration)
This constructor can be used to create a backend that is based partially on a given backend and partially on a configuration.
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.@Nullable public Path getCheckpointPath()
@Nullable public Path getSavepointPath()
public CompletedCheckpointStorageLocation resolveCheckpoint(String pointer) throws IOException
StateBackend
If the state backend cannot understand the format of the pointer (for example because it
was created by a different state backend) this method should throw an IOException
.
pointer
- The external checkpoint pointer to resolve.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.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.