Class TaskExecutionState
java.lang.Object
org.apache.flink.runtime.taskmanager.TaskExecutionState
- All Implemented Interfaces:
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:
-
Constructor Summary
ConstructorsConstructorDescriptionTaskExecutionState(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
Modifier and TypeMethodDescriptionbooleanGets flink and user-defined accumulators in serialized form.getError(ClassLoader userCodeClassloader) Gets the attached exception, which is in serialized form.Returns the new execution state of the task.getID()Returns the ID of the task this result belongs tointhashCode()toString()
-
Constructor Details
-
TaskExecutionState
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 Details
-
getError
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
Returns the ID of the task this result belongs to- Returns:
- the ID of the task this result belongs to
-
getExecutionState
Returns the new execution state of the task.- Returns:
- the new execution state of the task
-
getAccumulators
Gets flink and user-defined accumulators in serialized form. -
getIOMetrics
-
equals
-
hashCode
public int hashCode() -
toString
-