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 aCompletedCheckpointStoreif 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 CompletedCheckpointaddCheckpointAndSubsumeOldestOne(CompletedCheckpoint checkpoint, CheckpointsCleaner checkpointsCleaner, Runnable postCleanup)Adds aCompletedCheckpointinstance to the list of completed checkpoints.List<CompletedCheckpoint>getAllCheckpoints()Returns allCompletedCheckpointinstances.intgetMaxNumberOfRetainedCheckpoints()Returns the max number of retained checkpoints.intgetNumberOfRetainedCheckpoints()Returns the current number of retained checkpoints.SharedStateRegistrygetSharedStateRegistry()Returns theSharedStateRegistryused to register the shared state.booleanrequiresExternalizedCheckpoints()This method returns whether the completed checkpoint store requires checkpoints to be externalized.voidshutdown(org.apache.flink.api.common.JobStatus jobStatus, CheckpointsCleaner checkpointsCleaner)Shuts down the store.static DeactivatedCheckpointCompletedCheckpointStorevalueOf(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:CompletedCheckpointStoreAdds aCompletedCheckpointinstance 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, theCompletedCheckpointpassed 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:
addCheckpointAndSubsumeOldestOnein 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(org.apache.flink.api.common.JobStatus jobStatus, CheckpointsCleaner checkpointsCleaner) throws ExceptionDescription copied from interface:CompletedCheckpointStoreShuts 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:
shutdownin 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:CompletedCheckpointStoreReturns allCompletedCheckpointinstances.Returns an empty list if no checkpoint has been added yet.
- Specified by:
getAllCheckpointsin interfaceCompletedCheckpointStore
-
getNumberOfRetainedCheckpoints
public int getNumberOfRetainedCheckpoints()
Description copied from interface:CompletedCheckpointStoreReturns the current number of retained checkpoints.- Specified by:
getNumberOfRetainedCheckpointsin interfaceCompletedCheckpointStore
-
getMaxNumberOfRetainedCheckpoints
public int getMaxNumberOfRetainedCheckpoints()
Description copied from interface:CompletedCheckpointStoreReturns the max number of retained checkpoints.- Specified by:
getMaxNumberOfRetainedCheckpointsin interfaceCompletedCheckpointStore
-
requiresExternalizedCheckpoints
public boolean requiresExternalizedCheckpoints()
Description copied from interface:CompletedCheckpointStoreThis 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:
requiresExternalizedCheckpointsin 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:CompletedCheckpointStoreReturns theSharedStateRegistryused to register the shared state.- Specified by:
getSharedStateRegistryin interfaceCompletedCheckpointStore
-
-