Class ExecutionFailureHandler
- java.lang.Object
-
- org.apache.flink.runtime.executiongraph.failover.ExecutionFailureHandler
-
public class ExecutionFailureHandler extends Object
This handler deals with task failures to return aFailureHandlingResult
which contains tasks to restart to recover from failures.
-
-
Field Summary
Fields Modifier and Type Field Description static String
FAILURE_LABEL_ATTRIBUTE_PREFIX
-
Constructor Summary
Constructors Constructor Description ExecutionFailureHandler(org.apache.flink.configuration.Configuration jobMasterConfig, SchedulingTopology schedulingTopology, FailoverStrategy failoverStrategy, RestartBackoffTimeStrategy restartBackoffTimeStrategy, org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor mainThreadExecutor, Collection<org.apache.flink.core.failure.FailureEnricher> failureEnrichers, org.apache.flink.core.failure.FailureEnricher.Context taskFailureCtx, org.apache.flink.core.failure.FailureEnricher.Context globalFailureCtx, org.apache.flink.metrics.MetricGroup metricGroup)
Creates the handler to deal with task failures.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FailureHandlingResult
getFailureHandlingResult(Execution failedExecution, Throwable cause, long timestamp)
Return result of failure handling.FailureHandlingResult
getGlobalFailureHandlingResult(Throwable cause, long timestamp)
Return result of failure handling on a global failure.long
getNumberOfRestarts()
static boolean
isUnrecoverableError(Throwable cause)
-
-
-
Field Detail
-
FAILURE_LABEL_ATTRIBUTE_PREFIX
public static final String FAILURE_LABEL_ATTRIBUTE_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ExecutionFailureHandler
public ExecutionFailureHandler(org.apache.flink.configuration.Configuration jobMasterConfig, SchedulingTopology schedulingTopology, FailoverStrategy failoverStrategy, RestartBackoffTimeStrategy restartBackoffTimeStrategy, org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor mainThreadExecutor, Collection<org.apache.flink.core.failure.FailureEnricher> failureEnrichers, org.apache.flink.core.failure.FailureEnricher.Context taskFailureCtx, org.apache.flink.core.failure.FailureEnricher.Context globalFailureCtx, org.apache.flink.metrics.MetricGroup metricGroup)
Creates the handler to deal with task failures.- Parameters:
schedulingTopology
- contains the topology info for failoverfailoverStrategy
- helps to decide tasks to restart on task failuresrestartBackoffTimeStrategy
- helps to decide whether to restart failed tasks and the restarting delaymainThreadExecutor
- the main thread executor of the job masterfailureEnrichers
- a collection ofFailureEnricher
that enrich failurestaskFailureCtx
- Task failure Context used by FailureEnrichersglobalFailureCtx
- Global failure Context used by FailureEnrichers
-
-
Method Detail
-
getFailureHandlingResult
public FailureHandlingResult getFailureHandlingResult(Execution failedExecution, Throwable cause, long timestamp)
Return result of failure handling. Can be a set of task vertices to restart and a delay of the restarting. Or that the failure is not recoverable and the reason for it.- Parameters:
failedExecution
- is the failed executioncause
- of the task failuretimestamp
- of the task failure- Returns:
- result of the failure handling
-
getGlobalFailureHandlingResult
public FailureHandlingResult getGlobalFailureHandlingResult(Throwable cause, long timestamp)
Return result of failure handling on a global failure. Can be a set of task vertices to restart and a delay of the restarting. Or that the failure is not recoverable and the reason for it.- Parameters:
cause
- of the task failuretimestamp
- of the task failure- Returns:
- result of the failure handling
-
isUnrecoverableError
public static boolean isUnrecoverableError(Throwable cause)
-
getNumberOfRestarts
public long getNumberOfRestarts()
-
-