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 |
startScheduling()
Called when the scheduling is started (initial scheduling operation).
|
public VertexwiseSchedulingStrategy(SchedulerOperations schedulerOperations, SchedulingTopology schedulingTopology, InputConsumableDecider.Factory inputConsumableDeciderFactory)
public void startScheduling()
SchedulingStrategy
startScheduling
in interface SchedulingStrategy
public void restartTasks(Set<ExecutionVertexID> verticesToRestart)
SchedulingStrategy
restartTasks
in interface SchedulingStrategy
verticesToRestart
- The tasks need to be restartedpublic void onExecutionStateChange(ExecutionVertexID executionVertexId, ExecutionState executionState)
SchedulingStrategy
Execution
changes its state.onExecutionStateChange
in interface SchedulingStrategy
executionVertexId
- The id of the taskexecutionState
- The new state of the executionpublic void onPartitionConsumable(IntermediateResultPartitionID resultPartitionId)
SchedulingStrategy
IntermediateResultPartition
becomes consumable.onPartitionConsumable
in interface SchedulingStrategy
resultPartitionId
- The id of the result partitionpublic void notifySchedulingTopologyUpdated(SchedulingTopology schedulingTopology, List<ExecutionVertexID> newExecutionVertices)
SchedulingTopologyListener
notifySchedulingTopologyUpdated
in interface SchedulingTopologyListener
schedulingTopology
- the scheduling topology which is just updatednewExecutionVertices
- the newly added execution vertices.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.