public class ExecutionFailureHandler extends Object
FailureHandlingResult
which contains
tasks to restart to recover from failures.Constructor and Description |
---|
ExecutionFailureHandler(SchedulingTopology schedulingTopology,
FailoverStrategy failoverStrategy,
RestartBackoffTimeStrategy restartBackoffTimeStrategy,
ComponentMainThreadExecutor mainThreadExecutor,
Collection<FailureEnricher> failureEnrichers,
FailureEnricher.Context taskFailureCtx,
FailureEnricher.Context globalFailureCtx)
Creates the handler to deal with task failures.
|
Modifier and Type | Method and 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) |
public ExecutionFailureHandler(SchedulingTopology schedulingTopology, FailoverStrategy failoverStrategy, RestartBackoffTimeStrategy restartBackoffTimeStrategy, ComponentMainThreadExecutor mainThreadExecutor, Collection<FailureEnricher> failureEnrichers, FailureEnricher.Context taskFailureCtx, FailureEnricher.Context globalFailureCtx)
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 of FailureEnricher
that enrich failurestaskFailureCtx
- Task failure Context used by FailureEnrichersglobalFailureCtx
- Global failure Context used by FailureEnricherspublic FailureHandlingResult getFailureHandlingResult(Execution failedExecution, Throwable cause, long timestamp)
failedExecution
- is the failed executioncause
- of the task failuretimestamp
- of the task failurepublic FailureHandlingResult getGlobalFailureHandlingResult(Throwable cause, long timestamp)
cause
- of the task failuretimestamp
- of the task failurepublic static boolean isUnrecoverableError(Throwable cause)
public long getNumberOfRestarts()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.