Class VertexwiseSchedulingStrategy
- java.lang.Object
-
- org.apache.flink.runtime.scheduler.strategy.VertexwiseSchedulingStrategy
-
- All Implemented Interfaces:
SchedulingTopologyListener
,SchedulingStrategy
public class VertexwiseSchedulingStrategy extends Object implements SchedulingStrategy, SchedulingTopologyListener
SchedulingStrategy
instance which schedules tasks in granularity of vertex (which indicates this strategy only supports batch jobs). Note that this strategy implementsSchedulingTopologyListener
, so it can handle the updates of scheduling topology.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VertexwiseSchedulingStrategy.Factory
The factory for creatingVertexwiseSchedulingStrategy
.
-
Constructor Summary
Constructors Constructor Description VertexwiseSchedulingStrategy(SchedulerOperations schedulerOperations, SchedulingTopology schedulingTopology, InputConsumableDecider.Factory inputConsumableDeciderFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
notifySchedulingTopologyUpdated(SchedulingTopology schedulingTopology, List<ExecutionVertexID> newExecutionVertices)
Notifies that the scheduling topology is just updated.void
onExecutionStateChange(ExecutionVertexID executionVertexId, ExecutionState executionState)
Called whenever anExecution
changes its state.void
onPartitionConsumable(IntermediateResultPartitionID resultPartitionId)
Called whenever anIntermediateResultPartition
becomes consumable.void
restartTasks(Set<ExecutionVertexID> verticesToRestart)
Called whenever vertices need to be restarted (due to task failure).void
scheduleAllVerticesIfPossible()
Schedules all vertices and excludes any vertices that are already finished or whose inputs are not yet ready.void
startScheduling()
Called when the scheduling is started (initial scheduling operation).
-
-
-
Constructor Detail
-
VertexwiseSchedulingStrategy
public VertexwiseSchedulingStrategy(SchedulerOperations schedulerOperations, SchedulingTopology schedulingTopology, InputConsumableDecider.Factory inputConsumableDeciderFactory)
-
-
Method Detail
-
startScheduling
public void startScheduling()
Description copied from interface:SchedulingStrategy
Called when the scheduling is started (initial scheduling operation).- Specified by:
startScheduling
in interfaceSchedulingStrategy
-
restartTasks
public void restartTasks(Set<ExecutionVertexID> verticesToRestart)
Description copied from interface:SchedulingStrategy
Called whenever vertices need to be restarted (due to task failure).- Specified by:
restartTasks
in interfaceSchedulingStrategy
- Parameters:
verticesToRestart
- The tasks need to be restarted
-
onExecutionStateChange
public void onExecutionStateChange(ExecutionVertexID executionVertexId, ExecutionState executionState)
Description copied from interface:SchedulingStrategy
Called whenever anExecution
changes its state.- Specified by:
onExecutionStateChange
in interfaceSchedulingStrategy
- Parameters:
executionVertexId
- The id of the taskexecutionState
- The new state of the execution
-
onPartitionConsumable
public void onPartitionConsumable(IntermediateResultPartitionID resultPartitionId)
Description copied from interface:SchedulingStrategy
Called whenever anIntermediateResultPartition
becomes consumable.- Specified by:
onPartitionConsumable
in interfaceSchedulingStrategy
- Parameters:
resultPartitionId
- The id of the result partition
-
notifySchedulingTopologyUpdated
public void notifySchedulingTopologyUpdated(SchedulingTopology schedulingTopology, List<ExecutionVertexID> newExecutionVertices)
Description copied from interface:SchedulingTopologyListener
Notifies that the scheduling topology is just updated.- Specified by:
notifySchedulingTopologyUpdated
in interfaceSchedulingTopologyListener
- Parameters:
schedulingTopology
- the scheduling topology which is just updatednewExecutionVertices
- the newly added execution vertices.
-
scheduleAllVerticesIfPossible
public void scheduleAllVerticesIfPossible()
Description copied from interface:SchedulingStrategy
Schedules all vertices and excludes any vertices that are already finished or whose inputs are not yet ready.- Specified by:
scheduleAllVerticesIfPossible
in interfaceSchedulingStrategy
-
-