Package org.apache.flink.runtime.state
Interface TaskLocalStateStore
-
- All Known Subinterfaces:
OwnedTaskLocalStateStore
- All Known Implementing Classes:
ChangelogTaskLocalStateStore
,NoOpTaskLocalStateStoreImpl
,TaskLocalStateStoreImpl
@Internal public interface TaskLocalStateStore
Classes that implement this interface serve as a task-manager-level local storage for local checkpointed state. The purpose is to provide access to a state that is stored locally for a faster recovery compared to the state that is stored remotely in a stable store DFS. For now, this storage is only complementary to the stable storage and local state is typically lost in case of machine failures. In such cases (and others), client code of this class must fall back to using the slower but highly available store.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
abortCheckpoint(long abortedCheckpointId)
Notifies that the checkpoint with the given id was confirmed as aborted.void
confirmCheckpoint(long confirmedCheckpointId)
Notifies that the checkpoint with the given id was confirmed as complete.LocalRecoveryConfig
getLocalRecoveryConfig()
Returns theLocalRecoveryConfig
for this task local state store.void
pruneMatchingCheckpoints(LongPredicate matcher)
Remove all checkpoints from the store that match the given predicate.TaskStateSnapshot
retrieveLocalState(long checkpointID)
Returns the local state that is stored under the given checkpoint id or null if nothing was stored under the id.void
storeLocalState(long checkpointId, TaskStateSnapshot localState)
Stores the local state for the given checkpoint id.
-
-
-
Method Detail
-
storeLocalState
void storeLocalState(@Nonnegative long checkpointId, @Nullable TaskStateSnapshot localState)
Stores the local state for the given checkpoint id.- Parameters:
checkpointId
- id for the checkpoint that created the local state that will be stored.localState
- the local state to store.
-
retrieveLocalState
@Nullable TaskStateSnapshot retrieveLocalState(long checkpointID)
Returns the local state that is stored under the given checkpoint id or null if nothing was stored under the id.- Parameters:
checkpointID
- the checkpoint id by which we search for local state.- Returns:
- the local state found for the given checkpoint id. Can be null
-
getLocalRecoveryConfig
@Nonnull LocalRecoveryConfig getLocalRecoveryConfig()
Returns theLocalRecoveryConfig
for this task local state store.
-
confirmCheckpoint
void confirmCheckpoint(long confirmedCheckpointId)
Notifies that the checkpoint with the given id was confirmed as complete. This prunes the checkpoint history and removes all local states with a checkpoint id that is smaller than the newly confirmed checkpoint id.
-
abortCheckpoint
void abortCheckpoint(long abortedCheckpointId)
Notifies that the checkpoint with the given id was confirmed as aborted. This prunes the checkpoint history and removes states with a checkpoint id that is equal to the newly aborted checkpoint id.
-
pruneMatchingCheckpoints
void pruneMatchingCheckpoints(LongPredicate matcher)
Remove all checkpoints from the store that match the given predicate.- Parameters:
matcher
- the predicate that selects the checkpoints for pruning.
-
-