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.| Modifier and Type | Class and Description |
|---|---|
static class |
VertexwiseSchedulingStrategy.Factory
The factory for creating
VertexwiseSchedulingStrategy. |
| Constructor and Description |
|---|
VertexwiseSchedulingStrategy(SchedulerOperations schedulerOperations,
SchedulingTopology schedulingTopology,
InputConsumableDecider.Factory inputConsumableDeciderFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
notifySchedulingTopologyUpdated(SchedulingTopology schedulingTopology,
List<ExecutionVertexID> newExecutionVertices)
Notifies that the scheduling topology is just updated.
|
void |
onExecutionStateChange(ExecutionVertexID executionVertexId,
ExecutionState executionState)
Called whenever an
Execution changes its state. |
void |
onPartitionConsumable(IntermediateResultPartitionID resultPartitionId)
Called whenever an
IntermediateResultPartition 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).
|
public VertexwiseSchedulingStrategy(SchedulerOperations schedulerOperations, SchedulingTopology schedulingTopology, InputConsumableDecider.Factory inputConsumableDeciderFactory)
public void startScheduling()
SchedulingStrategystartScheduling in interface SchedulingStrategypublic void restartTasks(Set<ExecutionVertexID> verticesToRestart)
SchedulingStrategyrestartTasks in interface SchedulingStrategyverticesToRestart - The tasks need to be restartedpublic void onExecutionStateChange(ExecutionVertexID executionVertexId, ExecutionState executionState)
SchedulingStrategyExecution changes its state.onExecutionStateChange in interface SchedulingStrategyexecutionVertexId - The id of the taskexecutionState - The new state of the executionpublic void onPartitionConsumable(IntermediateResultPartitionID resultPartitionId)
SchedulingStrategyIntermediateResultPartition becomes consumable.onPartitionConsumable in interface SchedulingStrategyresultPartitionId - The id of the result partitionpublic void notifySchedulingTopologyUpdated(SchedulingTopology schedulingTopology, List<ExecutionVertexID> newExecutionVertices)
SchedulingTopologyListenernotifySchedulingTopologyUpdated in interface SchedulingTopologyListenerschedulingTopology - the scheduling topology which is just updatednewExecutionVertices - the newly added execution vertices.public void scheduleAllVerticesIfPossible()
SchedulingStrategyscheduleAllVerticesIfPossible in interface SchedulingStrategyCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.