// this creates an intermediate result for v1
v2.connectNewDataSetAsInput(v1, DistributionPattern.BIPARTITE);
// create results for v2 and v3
IntermediateDataSet v2result = v2.createAndAddResultDataSet();
IntermediateDataSet v3result_1 = v3.createAndAddResultDataSet();
IntermediateDataSet v3result_2 = v3.createAndAddResultDataSet();
List<AbstractJobVertex> ordered = new ArrayList<AbstractJobVertex>(Arrays.asList(v1, v2, v3));
ExecutionGraph eg = new ExecutionGraph(jobId, jobName, cfg);
try {
eg.attachJobGraph(ordered);
}
catch (JobException e) {
e.printStackTrace();
fail("Job failed with exception: " + e.getMessage());
}
// attach the second part of the graph
AbstractJobVertex v4 = new AbstractJobVertex("vertex4");
AbstractJobVertex v5 = new AbstractJobVertex("vertex5");
v4.setParallelism(11);
v5.setParallelism(4);
v4.connectIdInput(v2result.getId(), DistributionPattern.BIPARTITE);
v4.connectIdInput(v3result_1.getId(), DistributionPattern.BIPARTITE);
v5.connectNewDataSetAsInput(v4, DistributionPattern.BIPARTITE);
v5.connectIdInput(v3result_2.getId(), DistributionPattern.BIPARTITE);
List<AbstractJobVertex> ordered2 = new ArrayList<AbstractJobVertex>(Arrays.asList(v4, v5));
try {
eg.attachJobGraph(ordered2);