Search in sources :

Example 56 with LogicalSlot

use of org.apache.flink.runtime.jobmaster.LogicalSlot 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);
    }
}
Also used : Execution(org.apache.flink.runtime.executiongraph.Execution) ExecutionVertex(org.apache.flink.runtime.executiongraph.ExecutionVertex) LogicalSlot(org.apache.flink.runtime.jobmaster.LogicalSlot)

Example 57 with LogicalSlot

use of org.apache.flink.runtime.jobmaster.LogicalSlot 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);
    }
}
Also used : Execution(org.apache.flink.runtime.executiongraph.Execution) ExecutionVertex(org.apache.flink.runtime.executiongraph.ExecutionVertex) LogicalSlot(org.apache.flink.runtime.jobmaster.LogicalSlot)

Aggregations

LogicalSlot (org.apache.flink.runtime.jobmaster.LogicalSlot)57 Test (org.junit.Test)34 TestingLogicalSlotBuilder (org.apache.flink.runtime.jobmaster.TestingLogicalSlotBuilder)18 CompletableFuture (java.util.concurrent.CompletableFuture)13 SlotRequestId (org.apache.flink.runtime.jobmaster.SlotRequestId)13 AllocationID (org.apache.flink.runtime.clusterframework.types.AllocationID)9 ExecutionGraphTestUtils.getExecutionVertex (org.apache.flink.runtime.executiongraph.ExecutionGraphTestUtils.getExecutionVertex)9 TestingPhysicalSlot (org.apache.flink.runtime.scheduler.TestingPhysicalSlot)9 ExecutionVertexID (org.apache.flink.runtime.scheduler.strategy.ExecutionVertexID)8 ExecutionVertex (org.apache.flink.runtime.executiongraph.ExecutionVertex)7 SimpleAckingTaskManagerGateway (org.apache.flink.runtime.executiongraph.utils.SimpleAckingTaskManagerGateway)7 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)6 TaskManagerGateway (org.apache.flink.runtime.jobmanager.slots.TaskManagerGateway)6 FlinkException (org.apache.flink.util.FlinkException)6 TestLogger (org.apache.flink.util.TestLogger)6 IOException (java.io.IOException)5 List (java.util.List)5 Map (java.util.Map)5 Consumer (java.util.function.Consumer)5