public class FailureHandlingResult extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
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. |
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.
|
static FailureHandlingResult |
restartable(Execution failedExecution,
Throwable cause,
long timestamp,
Set<ExecutionVertexID> verticesToRestart,
long restartDelayMS,
boolean globalFailure)
Creates a result of a set of tasks to restart to recover from the failure.
|
static FailureHandlingResult |
unrecoverable(Execution failedExecution,
Throwable error,
long timestamp,
boolean globalFailure)
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 long getTimestamp()
public boolean canRestart()
public boolean isGlobalFailure()
public static FailureHandlingResult restartable(@Nullable Execution failedExecution, @Nullable Throwable cause, long timestamp, @Nullable Set<ExecutionVertexID> verticesToRestart, long restartDelayMS, boolean globalFailure)
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.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, boolean globalFailure)
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.Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.