Search in sources :

Example 6 with CoLocationConstraint

use of org.apache.flink.runtime.jobmanager.scheduler.CoLocationConstraint in project flink by apache.

the class ExecutionGraphRestartTest method validateConstraints.

private void validateConstraints(ExecutionGraph eg) {
    ExecutionJobVertex[] tasks = eg.getAllVertices().values().toArray(new ExecutionJobVertex[2]);
    for (int i = 0; i < NUM_TASKS; i++) {
        CoLocationConstraint constr1 = tasks[0].getTaskVertices()[i].getLocationConstraint();
        CoLocationConstraint constr2 = tasks[1].getTaskVertices()[i].getLocationConstraint();
        assertNotNull(constr1.getSharedSlot());
        assertTrue(constr1.isAssigned());
        assertEquals(constr1, constr2);
    }
}
Also used : CoLocationConstraint(org.apache.flink.runtime.jobmanager.scheduler.CoLocationConstraint) CoLocationConstraint(org.apache.flink.runtime.jobmanager.scheduler.CoLocationConstraint)

Aggregations

CoLocationConstraint (org.apache.flink.runtime.jobmanager.scheduler.CoLocationConstraint)6 SlotSharingGroup (org.apache.flink.runtime.jobmanager.scheduler.SlotSharingGroup)5 JobID (org.apache.flink.api.common.JobID)4 JobVertex (org.apache.flink.runtime.jobgraph.JobVertex)4 Test (org.junit.Test)4 JobVertexID (org.apache.flink.runtime.jobgraph.JobVertexID)3 CoLocationGroup (org.apache.flink.runtime.jobmanager.scheduler.CoLocationGroup)3 HashSet (java.util.HashSet)1 Set (java.util.Set)1 ExecutionConfig (org.apache.flink.api.common.ExecutionConfig)1 Configuration (org.apache.flink.configuration.Configuration)1 JobException (org.apache.flink.runtime.JobException)1 NoRestartStrategy (org.apache.flink.runtime.executiongraph.restart.NoRestartStrategy)1 IntermediateDataSet (org.apache.flink.runtime.jobgraph.IntermediateDataSet)1 JobGraph (org.apache.flink.runtime.jobgraph.JobGraph)1 ScheduledUnit (org.apache.flink.runtime.jobmanager.scheduler.ScheduledUnit)1 Scheduler (org.apache.flink.runtime.jobmanager.scheduler.Scheduler)1 TaskManagerLocation (org.apache.flink.runtime.taskmanager.TaskManagerLocation)1