Class ExecutionFailureHandler
java.lang.Object
org.apache.flink.runtime.executiongraph.failover.ExecutionFailureHandler
This handler deals with task failures to return a
FailureHandlingResult which contains
tasks to restart to recover from failures.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionExecutionFailureHandler(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
Modifier and TypeMethodDescriptiongetFailureHandlingResult(Execution failedExecution, Throwable cause, long timestamp) Return result of failure handling.getGlobalFailureHandlingResult(Throwable cause, long timestamp) Return result of failure handling on a global failure.longstatic booleanisUnrecoverableError(Throwable cause)
-
Field Details
-
FAILURE_LABEL_ATTRIBUTE_PREFIX
- See Also:
-
-
Constructor Details
-
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 ofFailureEnricherthat enrich failurestaskFailureCtx- Task failure Context used by FailureEnrichersglobalFailureCtx- Global failure Context used by FailureEnrichers
-
-
Method Details
-
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
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
-
getNumberOfRestarts
public long getNumberOfRestarts()
-