public class TaskStateManagerImpl extends Object implements TaskStateManager
TaskStateManager and collaborates with the
job manager through CheckpointResponder) as well as a task-manager-local state store.
Like this, client code does not have to deal with the differences between remote or local state
on recovery because this class handles both cases transparently.
Reported state is tagged by clients so that this class can properly forward to the right receiver for the checkpointed state.
| 构造器和说明 |
|---|
TaskStateManagerImpl(org.apache.flink.api.common.JobID jobId,
ExecutionAttemptID executionAttemptID,
TaskLocalStateStore localStateStore,
StateChangelogStorage<?> stateChangelogStorage,
TaskExecutorStateChangelogStoragesManager changelogStoragesManager,
JobManagerTaskRestore jobManagerTaskRestore,
CheckpointResponder checkpointResponder) |
TaskStateManagerImpl(org.apache.flink.api.common.JobID jobId,
ExecutionAttemptID executionAttemptID,
TaskLocalStateStore localStateStore,
StateChangelogStorage<?> stateChangelogStorage,
TaskExecutorStateChangelogStoragesManager changelogStoragesManager,
JobManagerTaskRestore jobManagerTaskRestore,
CheckpointResponder checkpointResponder,
SequentialChannelStateReaderImpl sequentialChannelStateReader) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
LocalRecoveryConfig |
createLocalRecoveryConfig()
Returns the configuration for local recovery, i.e. the base directories for all file-based
local state of the owning subtask and the general mode for local recovery.
|
InflightDataRescalingDescriptor |
getInputRescalingDescriptor() |
InflightDataRescalingDescriptor |
getOutputRescalingDescriptor() |
Optional<Long> |
getRestoreCheckpointId()
Acquires the checkpoint id to restore from.
|
SequentialChannelStateReader |
getSequentialChannelStateReader() |
StateChangelogStorage<?> |
getStateChangelogStorage()
Returns the configured state changelog storage for this task.
|
StateChangelogStorageView<?> |
getStateChangelogStorageView(org.apache.flink.configuration.Configuration configuration,
ChangelogStateHandle changelogStateHandle)
Returns the state changelog storage view of given
ChangelogStateHandle for this task. |
boolean |
isTaskDeployedAsFinished()
Whether all the operators of the task are finished on restore.
|
void |
notifyCheckpointAborted(long checkpointId)
Tracking when some local state can be disposed.
|
void |
notifyCheckpointComplete(long checkpointId)
Tracking when local state can be confirmed and disposed.
|
PrioritizedOperatorSubtaskState |
prioritizedOperatorState(OperatorID operatorID)
Returns means to restore previously reported state of an operator running in the owning task.
|
void |
reportIncompleteTaskStateSnapshots(CheckpointMetaData checkpointMetaData,
CheckpointMetrics checkpointMetrics)
Report the stats for state snapshots for an aborted checkpoint.
|
void |
reportTaskStateSnapshots(CheckpointMetaData checkpointMetaData,
CheckpointMetrics checkpointMetrics,
TaskStateSnapshot acknowledgedState,
TaskStateSnapshot localState)
Report the state snapshots for the operator instances running in the owning task.
|
public TaskStateManagerImpl(@Nonnull org.apache.flink.api.common.JobID jobId, @Nonnull ExecutionAttemptID executionAttemptID, @Nonnull TaskLocalStateStore localStateStore, @Nullable StateChangelogStorage<?> stateChangelogStorage, @Nonnull TaskExecutorStateChangelogStoragesManager changelogStoragesManager, @Nullable JobManagerTaskRestore jobManagerTaskRestore, @Nonnull CheckpointResponder checkpointResponder)
public TaskStateManagerImpl(@Nonnull org.apache.flink.api.common.JobID jobId, @Nonnull ExecutionAttemptID executionAttemptID, @Nonnull TaskLocalStateStore localStateStore, @Nullable StateChangelogStorage<?> stateChangelogStorage, @Nonnull TaskExecutorStateChangelogStoragesManager changelogStoragesManager, @Nullable JobManagerTaskRestore jobManagerTaskRestore, @Nonnull CheckpointResponder checkpointResponder, @Nonnull SequentialChannelStateReaderImpl sequentialChannelStateReader)
public void reportTaskStateSnapshots(@Nonnull CheckpointMetaData checkpointMetaData, @Nonnull CheckpointMetrics checkpointMetrics, @Nullable TaskStateSnapshot acknowledgedState, @Nullable TaskStateSnapshot localState)
TaskStateManagerreportTaskStateSnapshots 在接口中 TaskStateManagercheckpointMetaData - meta data from the checkpoint request.checkpointMetrics - task level metrics for the checkpoint.acknowledgedState - the reported states to acknowledge to the job manager.localState - the reported states for local recovery.public void reportIncompleteTaskStateSnapshots(CheckpointMetaData checkpointMetaData, CheckpointMetrics checkpointMetrics)
TaskStateManagerreportIncompleteTaskStateSnapshots 在接口中 TaskStateManagercheckpointMetaData - meta data from the checkpoint request.checkpointMetrics - task level metrics for the checkpoint.public InflightDataRescalingDescriptor getInputRescalingDescriptor()
getInputRescalingDescriptor 在接口中 TaskStateManagerpublic InflightDataRescalingDescriptor getOutputRescalingDescriptor()
getOutputRescalingDescriptor 在接口中 TaskStateManagerpublic boolean isTaskDeployedAsFinished()
TaskStateManagerisTaskDeployedAsFinished 在接口中 TaskStateManagerpublic Optional<Long> getRestoreCheckpointId()
TaskStateManagergetRestoreCheckpointId 在接口中 TaskStateManagerpublic PrioritizedOperatorSubtaskState prioritizedOperatorState(OperatorID operatorID)
TaskStateManagerprioritizedOperatorState 在接口中 TaskStateManageroperatorID - the id of the operator for which we request state.@Nonnull public LocalRecoveryConfig createLocalRecoveryConfig()
TaskStateManagercreateLocalRecoveryConfig 在接口中 TaskStateManagerpublic SequentialChannelStateReader getSequentialChannelStateReader()
@Nullable public StateChangelogStorage<?> getStateChangelogStorage()
TaskStateManagergetStateChangelogStorage 在接口中 TaskStateManager@Nullable public StateChangelogStorageView<?> getStateChangelogStorageView(org.apache.flink.configuration.Configuration configuration, ChangelogStateHandle changelogStateHandle)
TaskStateManagerChangelogStateHandle for this task.getStateChangelogStorageView 在接口中 TaskStateManagerpublic void notifyCheckpointComplete(long checkpointId)
throws Exception
notifyCheckpointComplete 在接口中 org.apache.flink.api.common.state.CheckpointListenerExceptionpublic void notifyCheckpointAborted(long checkpointId)
notifyCheckpointAborted 在接口中 org.apache.flink.api.common.state.CheckpointListenerpublic void close()
throws Exception
close 在接口中 AutoCloseableExceptionCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.