use of org.apache.flink.runtime.scheduler.strategy.TestingSchedulingExecutionVertex in project flink by apache.
the class SchedulingPipelinedRegionComputeUtilTest method testCyclicDependentRegionsAreMerged.
/**
* This test checks that cyclic dependent regions will be merged into one.
*
* <pre>
* (blocking)(blocking)
* | |
* v v
* +|-(v2)-|+
* | |
* (v1)--+ +--(v4)
* | |
* +--(v3)--+
* </pre>
*/
@Test
public void testCyclicDependentRegionsAreMerged() {
TestingSchedulingTopology topology = new TestingSchedulingTopology();
TestingSchedulingExecutionVertex v1 = topology.newExecutionVertex();
TestingSchedulingExecutionVertex v2 = topology.newExecutionVertex();
TestingSchedulingExecutionVertex v3 = topology.newExecutionVertex();
TestingSchedulingExecutionVertex v4 = topology.newExecutionVertex();
topology.connect(v1, v2, ResultPartitionType.BLOCKING).connect(v1, v3, ResultPartitionType.PIPELINED).connect(v2, v4, ResultPartitionType.BLOCKING).connect(v3, v4, ResultPartitionType.PIPELINED);
Map<ExecutionVertexID, Set<SchedulingExecutionVertex>> pipelinedRegionByVertex = computePipelinedRegionByVertex(topology);
Set<SchedulingExecutionVertex> r1 = pipelinedRegionByVertex.get(v1.getId());
Set<SchedulingExecutionVertex> r2 = pipelinedRegionByVertex.get(v2.getId());
Set<SchedulingExecutionVertex> r3 = pipelinedRegionByVertex.get(v3.getId());
Set<SchedulingExecutionVertex> r4 = pipelinedRegionByVertex.get(v4.getId());
assertSameRegion(r1, r2, r3, r4);
}
use of org.apache.flink.runtime.scheduler.strategy.TestingSchedulingExecutionVertex in project flink by apache.
the class SchedulingPipelinedRegionComputeUtilTest method testOneComponentInstanceFromOneSource.
/**
* Tests that validates that a single pipelined component instance from one source works
* correctly.
*
* <pre>
* +--(v4)
* +--(v2)-+
* | +--(v5)
* (v1)--+
* | +--(v6)
* +--(v3)-+
* +--(v7)
* </pre>
*/
@Test
public void testOneComponentInstanceFromOneSource() {
TestingSchedulingTopology topology = new TestingSchedulingTopology();
TestingSchedulingExecutionVertex v1 = topology.newExecutionVertex();
TestingSchedulingExecutionVertex v2 = topology.newExecutionVertex();
TestingSchedulingExecutionVertex v3 = topology.newExecutionVertex();
TestingSchedulingExecutionVertex v4 = topology.newExecutionVertex();
TestingSchedulingExecutionVertex v5 = topology.newExecutionVertex();
TestingSchedulingExecutionVertex v6 = topology.newExecutionVertex();
TestingSchedulingExecutionVertex v7 = topology.newExecutionVertex();
topology.connect(v1, v2, ResultPartitionType.PIPELINED).connect(v1, v3, ResultPartitionType.PIPELINED).connect(v2, v4, ResultPartitionType.PIPELINED).connect(v2, v5, ResultPartitionType.PIPELINED).connect(v3, v6, ResultPartitionType.PIPELINED).connect(v3, v7, ResultPartitionType.PIPELINED);
Map<ExecutionVertexID, Set<SchedulingExecutionVertex>> pipelinedRegionByVertex = computePipelinedRegionByVertex(topology);
Set<SchedulingExecutionVertex> r1 = pipelinedRegionByVertex.get(v1.getId());
Set<SchedulingExecutionVertex> r2 = pipelinedRegionByVertex.get(v2.getId());
Set<SchedulingExecutionVertex> r3 = pipelinedRegionByVertex.get(v3.getId());
Set<SchedulingExecutionVertex> r4 = pipelinedRegionByVertex.get(v4.getId());
Set<SchedulingExecutionVertex> r5 = pipelinedRegionByVertex.get(v5.getId());
Set<SchedulingExecutionVertex> r6 = pipelinedRegionByVertex.get(v6.getId());
Set<SchedulingExecutionVertex> r7 = pipelinedRegionByVertex.get(v7.getId());
assertSameRegion(r1, r2, r3, r4, r5, r6, r7);
}
Aggregations