MRHelpers.doJobClientMagic(stage2Conf);
byte[] stage1Payload = MRHelpers.createUserPayloadFromConf(stage1Conf);
// Setup stage1 Vertex
int stage1NumTasks = generateSplitsInClient ? inputSplitInfo.getNumTasks() : -1;
Vertex stage1Vertex = new Vertex("stage1", new ProcessorDescriptor(
FilterByWordInputProcessor.class.getName()).setUserPayload(stage1Payload),
stage1NumTasks, MRHelpers.getMapResource(stage1Conf));
stage1Vertex.setJavaOpts(MRHelpers.getMapJavaOpts(stage1Conf));
if (generateSplitsInClient) {
stage1Vertex.setTaskLocationsHint(inputSplitInfo.getTaskLocationHints());
Map<String, LocalResource> stage1LocalResources = new HashMap<String, LocalResource>();
stage1LocalResources.putAll(commonLocalResources);
MRHelpers.updateLocalResourcesForInputSplits(fs, inputSplitInfo, stage1LocalResources);
stage1Vertex.setTaskLocalResources(stage1LocalResources);
} else {
stage1Vertex.setTaskLocalResources(commonLocalResources);
}
Map<String, String> stage1Env = new HashMap<String, String>();
MRHelpers.updateEnvironmentForMRTasks(stage1Conf, stage1Env, true);
stage1Vertex.setTaskEnvironment(stage1Env);
// Configure the Input for stage1
Class<? extends TezRootInputInitializer> initializerClazz = generateSplitsInClient ? null
: MRInputAMSplitGenerator.class;
stage1Vertex.addInput("MRInput",
new InputDescriptor(MRInputLegacy.class.getName())
.setUserPayload(MRHelpers.createMRInputPayload(stage1Payload, null)),
initializerClazz);
// Setup stage2 Vertex
Vertex stage2Vertex = new Vertex("stage2", new ProcessorDescriptor(
FilterByWordOutputProcessor.class.getName()).setUserPayload(MRHelpers
.createUserPayloadFromConf(stage2Conf)), stage1NumTasks,
MRHelpers.getMapResource(stage2Conf));
stage2Vertex.setJavaOpts(MRHelpers.getReduceJavaOpts(stage2Conf)).setTaskLocalResources(commonLocalResources);
Map<String, String> stage2Env = new HashMap<String, String>();