public class StandaloneCompletedCheckpointStore extends AbstractCompleteCheckpointStore
CompletedCheckpointStore
for JobManagers running in HighAvailabilityMode.NONE
.Constructor and Description |
---|
StandaloneCompletedCheckpointStore(int maxNumberOfCheckpointsToRetain) |
StandaloneCompletedCheckpointStore(int maxNumberOfCheckpointsToRetain,
SharedStateRegistryFactory sharedStateRegistryFactory,
Executor ioExecutor,
RecoveryClaimMode recoveryClaimMode)
Creates
StandaloneCompletedCheckpointStore . |
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.
|
boolean |
requiresExternalizedCheckpoints()
This method returns whether the completed checkpoint store requires checkpoints to be
externalized.
|
void |
shutdown(JobStatus jobStatus,
CheckpointsCleaner checkpointsCleaner)
Shuts down the store.
|
findLowest, getSharedStateRegistry, unregisterUnusedState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLatestCheckpoint, getLatestCheckpointId
@VisibleForTesting public StandaloneCompletedCheckpointStore(int maxNumberOfCheckpointsToRetain)
public StandaloneCompletedCheckpointStore(int maxNumberOfCheckpointsToRetain, SharedStateRegistryFactory sharedStateRegistryFactory, Executor ioExecutor, RecoveryClaimMode recoveryClaimMode)
StandaloneCompletedCheckpointStore
.recoveryClaimMode
- maxNumberOfCheckpointsToRetain
- The maximum number of checkpoints to retain (at least
1). Adding more checkpoints than this results in older checkpoints being discarded.@Nullable public CompletedCheckpoint addCheckpointAndSubsumeOldestOne(CompletedCheckpoint checkpoint, CheckpointsCleaner checkpointsCleaner, Runnable postCleanup) throws Exception
CompletedCheckpointStore
CompletedCheckpoint
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.core.execution.RecoveryClaimMode)
or SharedStateRegistryFactory.create(java.util.concurrent.Executor, java.util.Collection<org.apache.flink.runtime.checkpoint.CompletedCheckpoint>, org.apache.flink.core.execution.RecoveryClaimMode)
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.
Exception
public List<CompletedCheckpoint> getAllCheckpoints()
CompletedCheckpointStore
CompletedCheckpoint
instances.
Returns an empty list if no checkpoint has been added yet.
public int getNumberOfRetainedCheckpoints()
CompletedCheckpointStore
public int getMaxNumberOfRetainedCheckpoints()
CompletedCheckpointStore
public void shutdown(JobStatus jobStatus, CheckpointsCleaner checkpointsCleaner) throws Exception
CompletedCheckpointStore
The 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 CompletedCheckpointStore
shutdown
in class AbstractCompleteCheckpointStore
jobStatus
- Job state on shut downcheckpointsCleaner
- that will cleanup completed checkpoints if neededException
public boolean requiresExternalizedCheckpoints()
CompletedCheckpointStore
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.