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.
Constructor and Description |
---|
TaskStateManagerImpl(JobID jobId,
ExecutionAttemptID executionAttemptID,
TaskLocalStateStore localStateStore,
JobManagerTaskRestore jobManagerTaskRestore,
CheckpointResponder checkpointResponder) |
TaskStateManagerImpl(JobID jobId,
ExecutionAttemptID executionAttemptID,
TaskLocalStateStore localStateStore,
JobManagerTaskRestore jobManagerTaskRestore,
CheckpointResponder checkpointResponder,
ChannelStateReader channelStateReader) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
LocalRecoveryConfig |
createLocalRecoveryConfig()
Returns the configuration for local recovery, i.e.
|
ChannelStateReader |
getChannelStateReader() |
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 |
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 JobID jobId, @Nonnull ExecutionAttemptID executionAttemptID, @Nonnull TaskLocalStateStore localStateStore, @Nullable JobManagerTaskRestore jobManagerTaskRestore, @Nonnull CheckpointResponder checkpointResponder)
public TaskStateManagerImpl(@Nonnull JobID jobId, @Nonnull ExecutionAttemptID executionAttemptID, @Nonnull TaskLocalStateStore localStateStore, @Nullable JobManagerTaskRestore jobManagerTaskRestore, @Nonnull CheckpointResponder checkpointResponder, @Nonnull ChannelStateReader channelStateReader)
public void reportTaskStateSnapshots(@Nonnull CheckpointMetaData checkpointMetaData, @Nonnull CheckpointMetrics checkpointMetrics, @Nullable TaskStateSnapshot acknowledgedState, @Nullable TaskStateSnapshot localState)
TaskStateManager
reportTaskStateSnapshots
in interface TaskStateManager
checkpointMetaData
- 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.@Nonnull public PrioritizedOperatorSubtaskState prioritizedOperatorState(OperatorID operatorID)
TaskStateManager
prioritizedOperatorState
in interface TaskStateManager
operatorID
- the id of the operator for which we request state.@Nonnull public LocalRecoveryConfig createLocalRecoveryConfig()
TaskStateManager
createLocalRecoveryConfig
in interface TaskStateManager
public ChannelStateReader getChannelStateReader()
getChannelStateReader
in interface TaskStateManager
public void notifyCheckpointComplete(long checkpointId) throws Exception
notifyCheckpointComplete
in interface CheckpointListener
checkpointId
- The ID of the checkpoint that has been completed.Exception
- This method can propagate exceptions, which leads to a failure/recovery for
the task. Not that this will NOT lead to the checkpoint being revoked.public void notifyCheckpointAborted(long checkpointId)
notifyCheckpointAborted
in interface CheckpointListener
checkpointId
- The ID of the checkpoint that has been aborted.public void close() throws Exception
close
in interface AutoCloseable
Exception
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.