jobConf.setInt("mapred.map.tasks", 1);
jobConf.setInt("mapred.map.max.attempts", 1);
jobConf.setInt("mapred.reduce.max.attempts", 1);
jobConf.set("mapred.input.dir", inputDir.toString());
jobConf.set("mapred.output.dir", outputDir.toString());
final RunningJob runningJob = jobClient.submitJob(jobConf);
waitFor(60 * 1000, true, new Predicate() {
@Override
public boolean evaluate() throws Exception {
return runningJob.isComplete();
}
});
Assert.assertTrue(runningJob.isSuccessful());
Assert.assertTrue(fs.exists(new Path(outputDir, "part-00000")));
BufferedReader reader =
new BufferedReader(new InputStreamReader(fs.open(new Path(outputDir, "part-00000"))));
Assert.assertTrue(reader.readLine().trim().endsWith("a"));
Assert.assertTrue(reader.readLine().trim().endsWith("b"));