Enum DeactivatedCheckpointCompletedCheckpointStore
- java.lang.Object
-
- java.lang.Enum<DeactivatedCheckpointCompletedCheckpointStore>
-
- org.apache.flink.runtime.checkpoint.DeactivatedCheckpointCompletedCheckpointStore
-
- All Implemented Interfaces:
Serializable
,Comparable<DeactivatedCheckpointCompletedCheckpointStore>
,CompletedCheckpointStore
public enum DeactivatedCheckpointCompletedCheckpointStore extends Enum<DeactivatedCheckpointCompletedCheckpointStore> implements CompletedCheckpointStore
This class represents aCompletedCheckpointStore
if checkpointing has been disabled. Consequently, no component should use methods other thanCompletedCheckpointStore.shutdown(org.apache.flink.api.common.JobStatus, org.apache.flink.runtime.checkpoint.CheckpointsCleaner)
.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INSTANCE
-
Field Summary
-
Fields inherited from interface org.apache.flink.runtime.checkpoint.CompletedCheckpointStore
LOG
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletedCheckpoint
addCheckpointAndSubsumeOldestOne(CompletedCheckpoint checkpoint, CheckpointsCleaner checkpointsCleaner, Runnable postCleanup)
Adds aCompletedCheckpoint
instance to the list of completed checkpoints.List<CompletedCheckpoint>
getAllCheckpoints()
Returns allCompletedCheckpoint
instances.int
getMaxNumberOfRetainedCheckpoints()
Returns the max number of retained checkpoints.int
getNumberOfRetainedCheckpoints()
Returns the current number of retained checkpoints.SharedStateRegistry
getSharedStateRegistry()
Returns theSharedStateRegistry
used to register the shared state.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.static DeactivatedCheckpointCompletedCheckpointStore
valueOf(String name)
Returns the enum constant of this type with the specified name.static DeactivatedCheckpointCompletedCheckpointStore[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface org.apache.flink.runtime.checkpoint.CompletedCheckpointStore
getLatestCheckpoint, getLatestCheckpointId
-
-
-
-
Enum Constant Detail
-
INSTANCE
public static final DeactivatedCheckpointCompletedCheckpointStore INSTANCE
-
-
Method Detail
-
values
public static DeactivatedCheckpointCompletedCheckpointStore[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (DeactivatedCheckpointCompletedCheckpointStore c : DeactivatedCheckpointCompletedCheckpointStore.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DeactivatedCheckpointCompletedCheckpointStore valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
addCheckpointAndSubsumeOldestOne
public CompletedCheckpoint addCheckpointAndSubsumeOldestOne(CompletedCheckpoint checkpoint, CheckpointsCleaner checkpointsCleaner, Runnable postCleanup) throws Exception
Description copied from interface:CompletedCheckpointStore
Adds aCompletedCheckpoint
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, theCompletedCheckpoint
passed toSharedStateRegistry.registerAllAfterRestored(org.apache.flink.runtime.checkpoint.CompletedCheckpoint, org.apache.flink.core.execution.RecoveryClaimMode)
orSharedStateRegistryFactory.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.- Specified by:
addCheckpointAndSubsumeOldestOne
in interfaceCompletedCheckpointStore
- Returns:
- the subsumed oldest completed checkpoint if possible, return null if no checkpoint needs to be discarded on subsume.
- Throws:
Exception
-
shutdown
public void shutdown(JobStatus jobStatus, CheckpointsCleaner checkpointsCleaner) throws Exception
Description copied from interface:CompletedCheckpointStore
Shuts down the store.The job status is forwarded and used to decide whether state should actually be discarded or kept.
SharedStateRegistry.unregisterUnusedState(long)
andCheckpointsCleaner.cleanSubsumedCheckpoints(long, java.util.Set<java.lang.Long>, java.lang.Runnable, java.util.concurrent.Executor)
should be called here to subsume unused state.- Specified by:
shutdown
in interfaceCompletedCheckpointStore
- Parameters:
jobStatus
- Job state on shut downcheckpointsCleaner
- that will cleanup completed checkpoints if needed- Throws:
Exception
-
getAllCheckpoints
public List<CompletedCheckpoint> getAllCheckpoints()
Description copied from interface:CompletedCheckpointStore
Returns allCompletedCheckpoint
instances.Returns an empty list if no checkpoint has been added yet.
- Specified by:
getAllCheckpoints
in interfaceCompletedCheckpointStore
-
getNumberOfRetainedCheckpoints
public int getNumberOfRetainedCheckpoints()
Description copied from interface:CompletedCheckpointStore
Returns the current number of retained checkpoints.- Specified by:
getNumberOfRetainedCheckpoints
in interfaceCompletedCheckpointStore
-
getMaxNumberOfRetainedCheckpoints
public int getMaxNumberOfRetainedCheckpoints()
Description copied from interface:CompletedCheckpointStore
Returns the max number of retained checkpoints.- Specified by:
getMaxNumberOfRetainedCheckpoints
in interfaceCompletedCheckpointStore
-
requiresExternalizedCheckpoints
public boolean requiresExternalizedCheckpoints()
Description copied from interface:CompletedCheckpointStore
This method returns whether the completed checkpoint store requires checkpoints to be externalized. Externalized checkpoints have their meta data persisted, which the checkpoint store can exploit (for example by simply pointing the persisted metadata).- Specified by:
requiresExternalizedCheckpoints
in interfaceCompletedCheckpointStore
- Returns:
- True, if the store requires that checkpoints are externalized before being added, false if the store stores the metadata itself.
-
getSharedStateRegistry
public SharedStateRegistry getSharedStateRegistry()
Description copied from interface:CompletedCheckpointStore
Returns theSharedStateRegistry
used to register the shared state.- Specified by:
getSharedStateRegistry
in interfaceCompletedCheckpointStore
-
-