public class RestartIndividualStrategy extends FailoverStrategy
Modifier and Type | Class and Description |
---|---|
static class |
RestartIndividualStrategy.Factory
Factory that instantiates the RestartAllStrategy.
|
Constructor and Description |
---|
RestartIndividualStrategy(ExecutionGraph executionGraph)
Creates a new failover strategy that recovers from failures by restarting only the failed task
of the execution graph.
|
RestartIndividualStrategy(ExecutionGraph executionGraph,
Executor callbackExecutor)
Creates a new failover strategy that recovers from failures by restarting only the failed task
of the execution graph.
|
Modifier and Type | Method and Description |
---|---|
String |
getStrategyName()
Gets the name of the failover strategy, for logging purposes.
|
void |
notifyNewVertices(List<ExecutionJobVertex> newJobVerticesTopological)
Called whenever new vertices are added to the ExecutionGraph.
|
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 RestartIndividualStrategy(ExecutionGraph executionGraph)
The strategy will use the ExecutionGraph's future executor for callbacks.
executionGraph
- The execution graph to handle.public RestartIndividualStrategy(ExecutionGraph executionGraph, Executor callbackExecutor)
executionGraph
- The execution graph to handle.callbackExecutor
- The executor that executes restart callbackspublic void onTaskFailure(Execution taskExecution, Throwable cause)
FailoverStrategy
onTaskFailure
in class FailoverStrategy
taskExecution
- The execution attempt of the failed task.cause
- The exception that caused the task failure.public void notifyNewVertices(List<ExecutionJobVertex> newJobVerticesTopological)
FailoverStrategy
notifyNewVertices
in class FailoverStrategy
newJobVerticesTopological
- The newly added vertices, in topological order.public String getStrategyName()
FailoverStrategy
getStrategyName
in class FailoverStrategy
public void registerMetrics(MetricGroup metricGroup)
FailoverStrategy
The default implementation does nothing
registerMetrics
in class FailoverStrategy
metricGroup
- The metric group to register the metrics atCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.