public class TaskLocalStateStoreImpl extends Object implements OwnedTaskLocalStateStore
TaskLocalStateStore.| 限定符和类型 | 字段和说明 |
|---|---|
protected AllocationID |
allocationID
AllocationID of the owning slot.
|
protected Executor |
discardExecutor
Executor that runs the discarding of released state objects.
|
protected boolean |
disposed
Status flag if this store was already discarded.
|
protected org.apache.flink.api.common.JobID |
jobID
JobID from the owning subtask.
|
protected JobVertexID |
jobVertexID
JobVertexID of the owning subtask.
|
protected LocalRecoveryConfig |
localRecoveryConfig
The configured mode for local recovery.
|
protected Object |
lock
Lock for synchronisation on the storage map and the discarded status.
|
protected SortedMap<Long,TaskStateSnapshot> |
storedTaskStateByCheckpointID
Maps checkpoint ids to local TaskStateSnapshots.
|
protected int |
subtaskIndex
Subtask index of the owning subtask.
|
static String |
TASK_STATE_SNAPSHOT_FILENAME |
| 构造器和说明 |
|---|
TaskLocalStateStoreImpl(org.apache.flink.api.common.JobID jobID,
AllocationID allocationID,
JobVertexID jobVertexID,
int subtaskIndex,
LocalRecoveryConfig localRecoveryConfig,
Executor discardExecutor) |
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
protected void |
deleteDirectory(File directory)
Helper method to delete a directory.
|
CompletableFuture<Void> |
dispose()
Disposes the state of all local snapshots managed by this object.
|
protected File |
getCheckpointDirectory(long checkpointId) |
LocalRecoveryConfig |
getLocalRecoveryConfig()
Returns the
LocalRecoveryConfig for this task local state store. |
protected LocalRecoveryDirectoryProvider |
getLocalRecoveryDirectoryProvider() |
protected void |
pruneCheckpoints(java.util.function.LongPredicate pruningChecker,
boolean breakOnceCheckerFalse)
Pruning the useless checkpoints, it should be called only when holding the
lock. |
void |
pruneMatchingCheckpoints(java.util.function.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.
|
String |
toString() |
@Nonnull protected final org.apache.flink.api.common.JobID jobID
@Nonnull protected final AllocationID allocationID
@Nonnull protected final JobVertexID jobVertexID
@Nonnegative protected final int subtaskIndex
@Nonnull protected final LocalRecoveryConfig localRecoveryConfig
@Nonnull protected final Executor discardExecutor
@Nonnull protected final Object lock
protected boolean disposed
@Nonnull protected final SortedMap<Long,TaskStateSnapshot> storedTaskStateByCheckpointID
public TaskLocalStateStoreImpl(@Nonnull org.apache.flink.api.common.JobID jobID, @Nonnull AllocationID allocationID, @Nonnull JobVertexID jobVertexID, @Nonnegative int subtaskIndex, @Nonnull LocalRecoveryConfig localRecoveryConfig, @Nonnull Executor discardExecutor)
public void storeLocalState(@Nonnegative long checkpointId, @Nullable TaskStateSnapshot localState)
TaskLocalStateStorestoreLocalState 在接口中 TaskLocalStateStorecheckpointId - id for the checkpoint that created the local state that will be stored.localState - the local state to store.protected File getCheckpointDirectory(long checkpointId)
protected LocalRecoveryDirectoryProvider getLocalRecoveryDirectoryProvider()
@Nullable public TaskStateSnapshot retrieveLocalState(long checkpointID)
TaskLocalStateStoreretrieveLocalState 在接口中 TaskLocalStateStorecheckpointID - the checkpoint id by which we search for local state.@Nonnull public LocalRecoveryConfig getLocalRecoveryConfig()
TaskLocalStateStoreLocalRecoveryConfig for this task local state store.getLocalRecoveryConfig 在接口中 TaskLocalStateStorepublic void confirmCheckpoint(long confirmedCheckpointId)
TaskLocalStateStoreconfirmCheckpoint 在接口中 TaskLocalStateStorepublic void abortCheckpoint(long abortedCheckpointId)
TaskLocalStateStoreabortCheckpoint 在接口中 TaskLocalStateStorepublic void pruneMatchingCheckpoints(@Nonnull java.util.function.LongPredicate matcher)
TaskLocalStateStorepruneMatchingCheckpoints 在接口中 TaskLocalStateStorematcher - the predicate that selects the checkpoints for pruning.public CompletableFuture<Void> dispose()
dispose 在接口中 OwnedTaskLocalStateStoreprotected void deleteDirectory(File directory) throws IOException
IOExceptionprotected void pruneCheckpoints(java.util.function.LongPredicate pruningChecker, boolean breakOnceCheckerFalse)
lock.Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.