public abstract class FailoverStrategy extends Object
FailoverStrategy
describes how the job computation recovers from task failures.
Failover strategies implement recovery logic for failures of tasks. The execution graph still implements "global failure / recovery" (which restarts all tasks) as a fallback plan or safety net in cases where it deems that the state of the graph may have become inconsistent.
Modifier and Type | Class and Description |
---|---|
static interface |
FailoverStrategy.Factory
This factory is a necessary indirection when creating the FailoverStrategy to that we can
have both the FailoverStrategy final in the ExecutionGraph, and the ExecutionGraph final in
the FailOverStrategy.
|
Constructor and Description |
---|
FailoverStrategy() |
Modifier and Type | Method and Description |
---|---|
abstract String |
getStrategyName()
Gets the name of the failover strategy, for logging purposes.
|
abstract void |
notifyNewVertices(List<ExecutionJobVertex> newJobVerticesTopological)
Called whenever new vertices are added to the ExecutionGraph.
|
abstract void |
onTaskFailure(Execution taskExecution,
Throwable cause)
Called by the execution graph when a task failure occurs.
|
void |
registerMetrics(MetricGroup metricGroup)
Tells the FailoverStrategy to register its metrics.
|
public abstract void onTaskFailure(Execution taskExecution, Throwable cause)
taskExecution
- The execution attempt of the failed task.cause
- The exception that caused the task failure.public abstract void notifyNewVertices(List<ExecutionJobVertex> newJobVerticesTopological)
newJobVerticesTopological
- The newly added vertices, in topological order.public abstract String getStrategyName()
public void registerMetrics(MetricGroup metricGroup)
The default implementation does nothing
metricGroup
- The metric group to register the metrics atCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.