public class FailureHandlingResult extends Object
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRestart()
Returns whether the restarting can be conducted.
|
Throwable |
getError()
Returns reason why the restarting cannot be conducted.
|
Optional<Execution> |
getFailedExecution()
Returns an
Optional with the Execution causing this failure or an empty
Optional if it's a global failure. |
CompletableFuture<Map<String,String>> |
getFailureLabels()
Returns the labels future associated with the failure.
|
long |
getRestartDelayMS()
Returns the delay before the restarting.
|
long |
getTimestamp()
Returns the time of the failure.
|
Set<ExecutionVertexID> |
getVerticesToRestart()
Returns the tasks to restart.
|
boolean |
isGlobalFailure()
Checks if this failure was a global failure, i.e., coming from a "safety net" failover that
involved all tasks and should reset also components like the coordinators.
|
boolean |
isRootCause() |
static FailureHandlingResult |
restartable(Execution failedExecution,
Throwable cause,
long timestamp,
CompletableFuture<Map<String,String>> failureLabels,
Set<ExecutionVertexID> verticesToRestart,
long restartDelayMS,
boolean globalFailure,
boolean isRootCause)
Creates a result of a set of tasks to restart to recover from the failure.
|
static FailureHandlingResult |
unrecoverable(Execution failedExecution,
Throwable error,
long timestamp,
CompletableFuture<Map<String,String>> failureLabels,
boolean globalFailure,
boolean isRootCause)
Creates a result that the failure is not recoverable and no restarting should be conducted.
|
public Set<ExecutionVertexID> getVerticesToRestart()
public long getRestartDelayMS()
public Optional<Execution> getFailedExecution()
Optional with the Execution causing this failure or an empty
Optional if it's a global failure.Optional with the failed Execution or an empty Optional
if it's a global failure.@Nullable public Throwable getError()
public CompletableFuture<Map<String,String>> getFailureLabels()
public long getTimestamp()
public boolean canRestart()
public boolean isGlobalFailure()
public boolean isRootCause()
public static FailureHandlingResult restartable(@Nullable Execution failedExecution, @Nullable Throwable cause, long timestamp, CompletableFuture<Map<String,String>> failureLabels, Set<ExecutionVertexID> verticesToRestart, long restartDelayMS, boolean globalFailure, boolean isRootCause)
The result can be flagged to be from a global failure triggered by the scheduler, rather than from the failure of an individual task.
failedExecution - the Execution that the failure is originating from. Passing
null as a value indicates that the failure was issued by Flink itself.cause - The reason of the failure.timestamp - The time of the failure.failureLabels - Map of labels characterizing the failure produced by the
FailureEnrichers.verticesToRestart - containing task vertices to restart to recover from the failure.
null indicates that the failure is not restartable.restartDelayMS - indicate a delay before conducting the restartpublic static FailureHandlingResult unrecoverable(@Nullable Execution failedExecution, @Nonnull Throwable error, long timestamp, CompletableFuture<Map<String,String>> failureLabels, boolean globalFailure, boolean isRootCause)
The result can be flagged to be from a global failure triggered by the scheduler, rather than from the failure of an individual task.
failedExecution - the Execution that the failure is originating from. Passing
null as a value indicates that the failure was issued by Flink itself.error - reason why the failure is not recoverabletimestamp - The time of the failure.failureLabels - Map of labels characterizing the failure produced by the
FailureEnrichers.Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.