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
Modifier and TypeMethodDescriptionvoidabortCheckpoint(long abortedCheckpointId) Notifies that the checkpoint with the given id was confirmed as aborted.voidconfirmCheckpoint(long confirmedCheckpointId) Notifies that the checkpoint with the given id was confirmed as complete.Returns theLocalRecoveryConfigfor this task local state store.voidpruneMatchingCheckpoints(LongPredicate matcher) Remove all checkpoints from the store that match the given predicate.retrieveLocalState(long checkpointID) Returns the local state that is stored under the given checkpoint id or null if nothing was stored under the id.voidstoreLocalState(long checkpointId, TaskStateSnapshot localState) Stores the local state for the given checkpoint id.
-
Method Details
-
storeLocalState
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
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
Returns theLocalRecoveryConfigfor 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
Remove all checkpoints from the store that match the given predicate.- Parameters:
matcher- the predicate that selects the checkpoints for pruning.
-