use of org.apache.flink.runtime.executiongraph.Execution in project flink by apache.
the class StateAssignmentOperation method assignTaskStateToExecutionJobVertices.
private void assignTaskStateToExecutionJobVertices(TaskStateAssignment assignment) {
ExecutionJobVertex executionJobVertex = assignment.executionJobVertex;
List<OperatorIDPair> operatorIDs = executionJobVertex.getOperatorIDs();
final int newParallelism = executionJobVertex.getParallelism();
/*
* An executionJobVertex's all state handles needed to restore are something like a matrix
*
* parallelism0 parallelism1 parallelism2 parallelism3
* op0 sh(0,0) sh(0,1) sh(0,2) sh(0,3)
* op1 sh(1,0) sh(1,1) sh(1,2) sh(1,3)
* op2 sh(2,0) sh(2,1) sh(2,2) sh(2,3)
* op3 sh(3,0) sh(3,1) sh(3,2) sh(3,3)
*
*/
for (int subTaskIndex = 0; subTaskIndex < newParallelism; subTaskIndex++) {
Execution currentExecutionAttempt = executionJobVertex.getTaskVertices()[subTaskIndex].getCurrentExecutionAttempt();
if (assignment.isFullyFinished) {
assignFinishedStateToTask(currentExecutionAttempt);
} else {
assignNonFinishedStateToTask(assignment, operatorIDs, subTaskIndex, currentExecutionAttempt);
}
}
}
use of org.apache.flink.runtime.executiongraph.Execution in project flink by apache.
the class AdaptiveBatchSchedulerTest method transitionExecutionsState.
/**
* Transit the state of all executions in the Job Vertex.
*/
public static void transitionExecutionsState(final SchedulerBase scheduler, final ExecutionState state, final JobVertex jobVertex) {
final ExecutionGraph executionGraph = scheduler.getExecutionGraph();
List<Execution> executions = Arrays.asList(executionGraph.getJobVertex(jobVertex.getID()).getTaskVertices()).stream().map(ExecutionVertex::getCurrentExecutionAttempt).collect(Collectors.toList());
transitionExecutionsState(scheduler, state, executions);
}
use of org.apache.flink.runtime.executiongraph.Execution in project flink by apache.
the class DeployingDownstreamTasksInBatchJobBenchmark method deployDownstreamTasks.
public void deployDownstreamTasks() throws Exception {
for (ExecutionVertex ev : vertices) {
Execution execution = ev.getCurrentExecutionAttempt();
execution.transitionState(ExecutionState.SCHEDULED);
execution.deploy();
}
}
use of org.apache.flink.runtime.executiongraph.Execution in project flink by apache.
the class SchedulerBenchmarkUtils method deployAllTasks.
public static void deployAllTasks(ExecutionGraph executionGraph, TestingLogicalSlotBuilder slotBuilder) throws JobException, ExecutionException, InterruptedException {
for (ExecutionVertex vertex : executionGraph.getAllExecutionVertices()) {
LogicalSlot slot = slotBuilder.createTestingLogicalSlot();
Execution execution = vertex.getCurrentExecutionAttempt();
execution.transitionState(ExecutionState.SCHEDULED);
execution.registerProducedPartitions(slot.getTaskManagerLocation(), true).get();
assignResourceAndDeploy(vertex, slot);
}
}
use of org.apache.flink.runtime.executiongraph.Execution in project flink by apache.
the class SchedulerBenchmarkUtils method deployTasks.
public static void deployTasks(ExecutionGraph executionGraph, JobVertexID jobVertexID, TestingLogicalSlotBuilder slotBuilder, boolean sendScheduleOrUpdateConsumersMessage) throws JobException, ExecutionException, InterruptedException {
for (ExecutionVertex vertex : executionGraph.getJobVertex(jobVertexID).getTaskVertices()) {
LogicalSlot slot = slotBuilder.createTestingLogicalSlot();
Execution execution = vertex.getCurrentExecutionAttempt();
execution.transitionState(ExecutionState.SCHEDULED);
execution.registerProducedPartitions(slot.getTaskManagerLocation(), sendScheduleOrUpdateConsumersMessage).get();
assignResourceAndDeploy(vertex, slot);
}
}
Aggregations