Class RestartPipelinedRegionFailoverStrategy
- java.lang.Object
-
- org.apache.flink.runtime.executiongraph.failover.RestartPipelinedRegionFailoverStrategy
-
- All Implemented Interfaces:
FailoverStrategy
public class RestartPipelinedRegionFailoverStrategy extends Object implements FailoverStrategy
A failover strategy that proposes to restart involved regions when a vertex fails. A region is defined by this strategy as tasks that communicate via pipelined data exchange.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RestartPipelinedRegionFailoverStrategy.Factory
The factory to instantiateRestartPipelinedRegionFailoverStrategy
.
-
Constructor Summary
Constructors Constructor Description RestartPipelinedRegionFailoverStrategy(SchedulingTopology topology)
Creates a new failover strategy to restart pipelined regions that works on the given topology.RestartPipelinedRegionFailoverStrategy(SchedulingTopology topology, ResultPartitionAvailabilityChecker resultPartitionAvailabilityChecker)
Creates a new failover strategy to restart pipelined regions that works on the given topology.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SchedulingPipelinedRegion
getFailoverRegion(ExecutionVertexID vertexID)
Returns the failover region that contains the given execution vertex.Set<ExecutionVertexID>
getTasksNeedingRestart(ExecutionVertexID executionVertexId, Throwable cause)
Returns a set of IDs corresponding to the set of vertices that should be restarted.
-
-
-
Constructor Detail
-
RestartPipelinedRegionFailoverStrategy
@VisibleForTesting public RestartPipelinedRegionFailoverStrategy(SchedulingTopology topology)
Creates a new failover strategy to restart pipelined regions that works on the given topology. The result partitions are always considered to be available if no data consumption error happens.- Parameters:
topology
- containing info about all the vertices and result partitions
-
RestartPipelinedRegionFailoverStrategy
public RestartPipelinedRegionFailoverStrategy(SchedulingTopology topology, ResultPartitionAvailabilityChecker resultPartitionAvailabilityChecker)
Creates a new failover strategy to restart pipelined regions that works on the given topology.- Parameters:
topology
- containing info about all the vertices and result partitionsresultPartitionAvailabilityChecker
- helps to query result partition availability
-
-
Method Detail
-
getTasksNeedingRestart
public Set<ExecutionVertexID> getTasksNeedingRestart(ExecutionVertexID executionVertexId, Throwable cause)
Returns a set of IDs corresponding to the set of vertices that should be restarted. In this strategy, all task vertices in 'involved' regions are proposed to be restarted. The 'involved' regions are calculated with rules below: 1. The region containing the failed task is always involved 2. If an input result partition of an involved region is not available, i.e. Missing or Corrupted, the region containing the partition producer task is involved 3. If a region is involved, all of its consumer regions are involved- Specified by:
getTasksNeedingRestart
in interfaceFailoverStrategy
- Parameters:
executionVertexId
- ID of the failed taskcause
- cause of the failure- Returns:
- set of IDs of vertices to restart
-
getFailoverRegion
@VisibleForTesting public SchedulingPipelinedRegion getFailoverRegion(ExecutionVertexID vertexID)
Returns the failover region that contains the given execution vertex.- Returns:
- the failover region that contains the given execution vertex
-
-