checkerVertex.setJavaOpts(
MRHelpers.getReduceJavaOpts(finalReduceConf));
Map<String, String> reduceEnv = new HashMap<String, String>();
MRHelpers.updateEnvironmentForMRTasks(finalReduceConf, reduceEnv, false);
checkerVertex.setTaskEnvironment(reduceEnv);
OutputDescriptor od = new OutputDescriptor(MROutput.class.getName())
.setUserPayload(finalReducePayload);
checkerVertex.addOutput("union", od, MROutputCommitter.class);
Configuration partsConf = new Configuration(finalReduceConf);
partsConf.set(FileOutputFormat.OUTDIR, outputPath+"-parts");
byte[] partsPayload = MRHelpers.createUserPayloadFromConf(partsConf);
DAG dag = new DAG("UnionExample");
VertexGroup unionVertex = dag.createVertexGroup("union", mapVertex1, mapVertex2);
OutputDescriptor od1 = new OutputDescriptor(MROutput.class.getName())
.setUserPayload(partsPayload);
Configuration allPartsConf = new Configuration(finalReduceConf);
allPartsConf.set(FileOutputFormat.OUTDIR, outputPath+"-all-parts");
byte[] allPartsPayload = MRHelpers.createUserPayloadFromConf(allPartsConf);
OutputDescriptor od2 = new OutputDescriptor(MROutput.class.getName())
.setUserPayload(allPartsPayload);
unionVertex.addOutput("parts", od1, MROutputCommitter.class);
checkerVertex.addOutput("all-parts", od2, MROutputCommitter.class);
dag.addVertex(mapVertex1)
.addVertex(mapVertex2)
.addVertex(mapVertex3)
.addVertex(checkerVertex)
.addEdge(
new Edge(mapVertex3, checkerVertex, new EdgeProperty(
DataMovementType.SCATTER_GATHER, DataSourceType.PERSISTED,
SchedulingType.SEQUENTIAL,
new OutputDescriptor(OnFileSortedOutput.class.getName())
.setUserPayload(mapPayload),
new InputDescriptor(ShuffledMergedInput.class.getName())
.setUserPayload(finalReducePayload))))
.addEdge(
new GroupInputEdge(unionVertex, checkerVertex, new EdgeProperty(
DataMovementType.SCATTER_GATHER, DataSourceType.PERSISTED,
SchedulingType.SEQUENTIAL,
new OutputDescriptor(OnFileSortedOutput.class.getName())
.setUserPayload(mapPayload),
new InputDescriptor(ShuffledMergedInput.class.getName())
.setUserPayload(finalReducePayload)),
new InputDescriptor(
ConcatenatedMergedKeyValuesInput.class.getName())));