Class ExceptionHistoryEntry
- java.lang.Object
-
- org.apache.flink.runtime.executiongraph.ErrorInfo
-
- org.apache.flink.runtime.scheduler.exceptionhistory.ExceptionHistoryEntry
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
RootExceptionHistoryEntry
public class ExceptionHistoryEntry extends ErrorInfo
ExceptionHistoryEntry
collects information about a single failure that triggered the scheduler's failure handling.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExceptionHistoryEntry.ArchivedTaskManagerLocation
ArchivedTaskManagerLocation
represents a archived (static) version of aTaskManagerLocation
.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ExceptionHistoryEntry(Throwable cause, long timestamp, CompletableFuture<Map<String,String>> failureLabels, String failingTaskName, TaskManagerLocation taskManagerLocation)
Instantiates aExceptionHistoryEntry
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExceptionHistoryEntry
create(AccessExecution failedExecution, String taskName, CompletableFuture<Map<String,String>> failureLabels)
Creates anExceptionHistoryEntry
based on the providedExecution
.static ExceptionHistoryEntry
createGlobal(Throwable cause, CompletableFuture<Map<String,String>> failureLabels)
Creates anExceptionHistoryEntry
that is not based on anExecution
.String
getFailingTaskName()
Map<String,String>
getFailureLabels()
Returns the labels associated with the failure that is set as soon as failureLabelsFuture is completed.CompletableFuture<Map<String,String>>
getFailureLabelsFuture()
Returns the labels future associated with the failure.ExceptionHistoryEntry.ArchivedTaskManagerLocation
getTaskManagerLocation()
boolean
isGlobal()
-
Methods inherited from class org.apache.flink.runtime.executiongraph.ErrorInfo
createErrorInfoWithNullableCause, getException, getExceptionAsString, getTimestamp, handleMissingThrowable
-
-
-
-
Constructor Detail
-
ExceptionHistoryEntry
protected ExceptionHistoryEntry(Throwable cause, long timestamp, CompletableFuture<Map<String,String>> failureLabels, @Nullable String failingTaskName, @Nullable TaskManagerLocation taskManagerLocation)
Instantiates aExceptionHistoryEntry
.- Parameters:
cause
- The reason for the failure.timestamp
- The time the failure was caught.failureLabels
- The labels associated with the failure.failingTaskName
- The name of the task that failed.taskManagerLocation
- The host the task was running on.- Throws:
NullPointerException
- ifcause
isnull
.IllegalArgumentException
- if the passedtimestamp
is not bigger than0
.
-
-
Method Detail
-
create
public static ExceptionHistoryEntry create(AccessExecution failedExecution, String taskName, CompletableFuture<Map<String,String>> failureLabels)
Creates anExceptionHistoryEntry
based on the providedExecution
.- Parameters:
failedExecution
- the failedExecution
.taskName
- the name of the task.failureLabels
- the labels associated with the failure.- Returns:
- The
ExceptionHistoryEntry
. - Throws:
NullPointerException
- ifnull
is passed as one of the parameters.IllegalArgumentException
- if the passedExecution
does not provide afailureInfo
.
-
createGlobal
public static ExceptionHistoryEntry createGlobal(Throwable cause, CompletableFuture<Map<String,String>> failureLabels)
Creates anExceptionHistoryEntry
that is not based on anExecution
.
-
isGlobal
public boolean isGlobal()
-
getFailingTaskName
@Nullable public String getFailingTaskName()
-
getTaskManagerLocation
@Nullable public ExceptionHistoryEntry.ArchivedTaskManagerLocation getTaskManagerLocation()
-
getFailureLabels
public Map<String,String> getFailureLabels()
Returns the labels associated with the failure that is set as soon as failureLabelsFuture is completed. When failureLabelsFuture is not completed, it returns an empty map.- Returns:
- Map of failure labels
-
getFailureLabelsFuture
public CompletableFuture<Map<String,String>> getFailureLabelsFuture()
Returns the labels future associated with the failure.- Returns:
- CompletableFuture of Map failure labels
-
-