Class TaskExecutionState
- java.lang.Object
-
- org.apache.flink.runtime.taskmanager.TaskExecutionState
-
- All Implemented Interfaces:
Serializable
public class TaskExecutionState extends Object implements Serializable
This class represents an update about a task's execution state.NOTE: The exception that may be attached to the state update is not necessarily a Flink or core Java exception, but may be an exception from the user code. As such, it cannot be deserialized without a special class loader. For that reason, the class keeps the actual exception field transient and deserialized it lazily, with the appropriate class loader.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TaskExecutionState(ExecutionAttemptID executionId, ExecutionState executionState)Creates a new task execution state update, with no attached exception and no accumulators.TaskExecutionState(ExecutionAttemptID executionId, ExecutionState executionState, Throwable error)Creates a new task execution state update, with an attached exception but no accumulators.TaskExecutionState(ExecutionAttemptID executionId, ExecutionState executionState, Throwable error, AccumulatorSnapshot accumulators, IOMetrics ioMetrics)Creates a new task execution state update, with an attached exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)AccumulatorSnapshotgetAccumulators()Gets flink and user-defined accumulators in serialized form.ThrowablegetError(ClassLoader userCodeClassloader)Gets the attached exception, which is in serialized form.ExecutionStategetExecutionState()Returns the new execution state of the task.ExecutionAttemptIDgetID()Returns the ID of the task this result belongs toIOMetricsgetIOMetrics()inthashCode()StringtoString()
-
-
-
Constructor Detail
-
TaskExecutionState
public TaskExecutionState(ExecutionAttemptID executionId, ExecutionState executionState)
Creates a new task execution state update, with no attached exception and no accumulators.- Parameters:
executionId- the ID of the task execution whose state is to be reportedexecutionState- the execution state to be reported
-
TaskExecutionState
public TaskExecutionState(ExecutionAttemptID executionId, ExecutionState executionState, Throwable error)
Creates a new task execution state update, with an attached exception but no accumulators.- Parameters:
executionId- the ID of the task execution whose state is to be reportedexecutionState- the execution state to be reported
-
TaskExecutionState
public TaskExecutionState(ExecutionAttemptID executionId, ExecutionState executionState, Throwable error, AccumulatorSnapshot accumulators, IOMetrics ioMetrics)
Creates a new task execution state update, with an attached exception. This constructor may never throw an exception.- Parameters:
executionId- the ID of the task execution whose state is to be reportedexecutionState- the execution state to be reportederror- an optional erroraccumulators- The flink and user-defined accumulators which may be null.
-
-
Method Detail
-
getError
public Throwable getError(ClassLoader userCodeClassloader)
Gets the attached exception, which is in serialized form. Returns null, if the status update is no failure with an associated exception.- Parameters:
userCodeClassloader- The classloader that can resolve user-defined exceptions.- Returns:
- The attached exception, or null, if none.
-
getID
public ExecutionAttemptID getID()
Returns the ID of the task this result belongs to- Returns:
- the ID of the task this result belongs to
-
getExecutionState
public ExecutionState getExecutionState()
Returns the new execution state of the task.- Returns:
- the new execution state of the task
-
getAccumulators
public AccumulatorSnapshot getAccumulators()
Gets flink and user-defined accumulators in serialized form.
-
getIOMetrics
public IOMetrics getIOMetrics()
-
-