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 implements SchedulingTopologyListener, so it can handle the updates of scheduling topology.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe factory for creatingVertexwiseSchedulingStrategy. -
Constructor Summary
ConstructorsConstructorDescriptionVertexwiseSchedulingStrategy(SchedulerOperations schedulerOperations, SchedulingTopology schedulingTopology, InputConsumableDecider.Factory inputConsumableDeciderFactory) -
Method Summary
Modifier and TypeMethodDescriptionvoidnotifySchedulingTopologyUpdated(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).voidSchedules all vertices and excludes any vertices that are already finished or whose inputs are not yet ready.voidCalled when the scheduling is started (initial scheduling operation).
-
Constructor Details
-
VertexwiseSchedulingStrategy
public VertexwiseSchedulingStrategy(SchedulerOperations schedulerOperations, SchedulingTopology schedulingTopology, InputConsumableDecider.Factory inputConsumableDeciderFactory)
-
-
Method Details
-
startScheduling
public void startScheduling()Description copied from interface:SchedulingStrategyCalled when the scheduling is started (initial scheduling operation).- Specified by:
startSchedulingin interfaceSchedulingStrategy
-
restartTasks
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
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
-