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
SchedulingStrategyinstance 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 classVertexwiseSchedulingStrategy.FactoryThe 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 voidnotifySchedulingTopologyUpdated(SchedulingTopology schedulingTopology, List<ExecutionVertexID> newExecutionVertices)Notifies that the scheduling topology is just updated.voidonExecutionStateChange(ExecutionVertexID executionVertexId, ExecutionState executionState)Called whenever anExecutionchanges its state.voidonPartitionConsumable(IntermediateResultPartitionID resultPartitionId)Called whenever anIntermediateResultPartitionbecomes consumable.voidrestartTasks(Set<ExecutionVertexID> verticesToRestart)Called whenever vertices need to be restarted (due to task failure).voidscheduleAllVerticesIfPossible()Schedules all vertices and excludes any vertices that are already finished or whose inputs are not yet ready.voidstartScheduling()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:SchedulingStrategyCalled when the scheduling is started (initial scheduling operation).- Specified by:
startSchedulingin interfaceSchedulingStrategy
-
restartTasks
public void restartTasks(Set<ExecutionVertexID> verticesToRestart)
Description copied from interface:SchedulingStrategyCalled whenever vertices need to be restarted (due to task failure).- Specified by:
restartTasksin interfaceSchedulingStrategy- Parameters:
verticesToRestart- The tasks need to be restarted
-
onExecutionStateChange
public void onExecutionStateChange(ExecutionVertexID executionVertexId, ExecutionState executionState)
Description copied from interface:SchedulingStrategyCalled whenever anExecutionchanges its state.- Specified by:
onExecutionStateChangein interfaceSchedulingStrategy- Parameters:
executionVertexId- The id of the taskexecutionState- The new state of the execution
-
onPartitionConsumable
public void onPartitionConsumable(IntermediateResultPartitionID resultPartitionId)
Description copied from interface:SchedulingStrategyCalled whenever anIntermediateResultPartitionbecomes consumable.- Specified by:
onPartitionConsumablein interfaceSchedulingStrategy- Parameters:
resultPartitionId- The id of the result partition
-
notifySchedulingTopologyUpdated
public void notifySchedulingTopologyUpdated(SchedulingTopology schedulingTopology, List<ExecutionVertexID> newExecutionVertices)
Description copied from interface:SchedulingTopologyListenerNotifies that the scheduling topology is just updated.- Specified by:
notifySchedulingTopologyUpdatedin interfaceSchedulingTopologyListener- Parameters:
schedulingTopology- the scheduling topology which is just updatednewExecutionVertices- the newly added execution vertices.
-
scheduleAllVerticesIfPossible
public void scheduleAllVerticesIfPossible()
Description copied from interface:SchedulingStrategySchedules all vertices and excludes any vertices that are already finished or whose inputs are not yet ready.- Specified by:
scheduleAllVerticesIfPossiblein interfaceSchedulingStrategy
-
-