public class EmbeddedCompletedCheckpointStore extends AbstractCompleteCheckpointStore
LOG| Constructor and Description |
|---|
EmbeddedCompletedCheckpointStore() |
EmbeddedCompletedCheckpointStore(int maxRetainedCheckpoints) |
EmbeddedCompletedCheckpointStore(int maxRetainedCheckpoints,
Collection<CompletedCheckpoint> initialCheckpoints,
RestoreMode restoreMode) |
EmbeddedCompletedCheckpointStore(int maxRetainedCheckpoints,
Collection<CompletedCheckpoint> initialCheckpoints,
SharedStateRegistry sharedStateRegistry) |
| Modifier and Type | Method and Description |
|---|---|
CompletedCheckpoint |
addCheckpointAndSubsumeOldestOne(CompletedCheckpoint checkpoint,
CheckpointsCleaner checkpointsCleaner,
Runnable postCleanup)
Adds a
CompletedCheckpoint instance to the list of completed checkpoints. |
List<CompletedCheckpoint> |
getAllCheckpoints()
Returns all
CompletedCheckpoint instances. |
int |
getMaxNumberOfRetainedCheckpoints()
Returns the max number of retained checkpoints.
|
int |
getNumberOfRetainedCheckpoints()
Returns the current number of retained checkpoints.
|
Optional<org.apache.flink.api.common.JobStatus> |
getShutdownStatus() |
boolean |
requiresExternalizedCheckpoints()
This method returns whether the completed checkpoint store requires checkpoints to be
externalized.
|
void |
shutdown(org.apache.flink.api.common.JobStatus jobStatus,
CheckpointsCleaner checkpointsCleaner)
Shuts down the store.
|
findLowest, getSharedStateRegistry, unregisterUnusedStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLatestCheckpoint, getLatestCheckpointId@VisibleForTesting public EmbeddedCompletedCheckpointStore()
@VisibleForTesting public EmbeddedCompletedCheckpointStore(int maxRetainedCheckpoints)
public EmbeddedCompletedCheckpointStore(int maxRetainedCheckpoints,
Collection<CompletedCheckpoint> initialCheckpoints,
RestoreMode restoreMode)
public EmbeddedCompletedCheckpointStore(int maxRetainedCheckpoints,
Collection<CompletedCheckpoint> initialCheckpoints,
SharedStateRegistry sharedStateRegistry)
public CompletedCheckpoint addCheckpointAndSubsumeOldestOne(CompletedCheckpoint checkpoint, CheckpointsCleaner checkpointsCleaner, Runnable postCleanup) throws Exception
CompletedCheckpointStoreCompletedCheckpoint instance to the list of completed checkpoints.
Only a bounded number of checkpoints is kept. When exceeding the maximum number of retained checkpoints, the oldest one will be discarded.
After FLINK-24611, SharedStateRegistry.unregisterUnusedState(long) should be called here to subsume unused state.
Note, the CompletedCheckpoint passed to
SharedStateRegistry.registerAllAfterRestored(org.apache.flink.runtime.checkpoint.CompletedCheckpoint, org.apache.flink.runtime.jobgraph.RestoreMode) or SharedStateRegistryFactory.create(java.util.concurrent.Executor, java.util.Collection<org.apache.flink.runtime.checkpoint.CompletedCheckpoint>, org.apache.flink.runtime.jobgraph.RestoreMode) must be the same object as the input parameter, otherwise
the state may be deleted by mistake.
After FLINK-25872, CheckpointsCleaner.cleanSubsumedCheckpoints(long, java.util.Set<java.lang.Long>, java.lang.Runnable, java.util.concurrent.Executor) should be called explicitly here.
Exceptionpublic void shutdown(org.apache.flink.api.common.JobStatus jobStatus,
CheckpointsCleaner checkpointsCleaner)
throws Exception
CompletedCheckpointStoreThe job status is forwarded and used to decide whether state should actually be discarded
or kept. SharedStateRegistry.unregisterUnusedState(long) and CheckpointsCleaner.cleanSubsumedCheckpoints(long, java.util.Set<java.lang.Long>, java.lang.Runnable, java.util.concurrent.Executor) should be called here to subsume unused state.
shutdown in interface CompletedCheckpointStoreshutdown in class AbstractCompleteCheckpointStorejobStatus - Job state on shut downcheckpointsCleaner - that will cleanup completed checkpoints if neededExceptionpublic List<CompletedCheckpoint> getAllCheckpoints()
CompletedCheckpointStoreCompletedCheckpoint instances.
Returns an empty list if no checkpoint has been added yet.
public int getNumberOfRetainedCheckpoints()
CompletedCheckpointStorepublic int getMaxNumberOfRetainedCheckpoints()
CompletedCheckpointStorepublic boolean requiresExternalizedCheckpoints()
CompletedCheckpointStorepublic Optional<org.apache.flink.api.common.JobStatus> getShutdownStatus()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.