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<ExecutionVertexID> |
getExecutionVertexIdOfFailedTask()
Returns an
Optional with the ExecutionVertexID of the task 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(ExecutionVertexID failingExecutionVertexId,
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(ExecutionVertexID failingExecutionVertexId,
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<ExecutionVertexID> getExecutionVertexIdOfFailedTask()
Optional
with the ExecutionVertexID
of the task causing this
failure or an empty Optional
if it's a global failure.ExecutionVertexID
of the causing task 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 ExecutionVertexID failingExecutionVertexId, @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.
failingExecutionVertexId
- the ExecutionVertexID
refering to the ExecutionVertex
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 ExecutionVertexID failingExecutionVertexId, @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.
failingExecutionVertexId
- the ExecutionVertexID
refering to the ExecutionVertex
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.