if (System.getProperty("compile.c++") == null) {
LOG.info("compile.c++ is not defined, so skipping TestPipes");
return;
}
MiniDFSCluster dfs = null;
MiniMRCluster mr = null;
Path cppExamples = new Path(System.getProperty("install.c++.examples"));
Path inputPath = new Path("/testing/in");
Path outputPath = new Path("/testing/out");
try {
final int numSlaves = 2;
Configuration conf = new Configuration();
dfs = new MiniDFSCluster(conf, numSlaves, true, null);
mr = new MiniMRCluster(numSlaves, dfs.getFileSystem().getName(), 1);
writeInputFile(dfs.getFileSystem(), inputPath);
runProgram(mr, dfs, new Path(cppExamples, "bin/wordcount-simple"),
inputPath, outputPath, 3, 2, twoSplitOutput);
cleanup(dfs.getFileSystem(), outputPath);
runProgram(mr, dfs, new Path(cppExamples, "bin/wordcount-simple"),
inputPath, outputPath, 3, 0, noSortOutput);
cleanup(dfs.getFileSystem(), outputPath);
runProgram(mr, dfs, new Path(cppExamples, "bin/wordcount-part"),
inputPath, outputPath, 3, 2, fixedPartitionOutput);
runNonPipedProgram(mr, dfs, new Path(cppExamples,"bin/wordcount-nopipe"));
mr.waitUntilIdle();
} finally {
mr.shutdown();
dfs.shutdown();
}
}