119120121122123124125126127128129
job.setReducerClass(IndexTableReducer.class); job.setOutputFormatClass(IndexOutputFormat.class); FileOutputFormat.setOutputPath(job, new Path(INDEX_DIR)); job.waitForCompletion(true); } finally { mrCluster.shutdown(); } if (printResults) { LOG.info("Print table contents after map/reduce"); }
124125126127128129130131132133134
jobConf.setOutputFormat(IndexOutputFormat.class); JobClient.runJob(jobConf); } finally { mrCluster.shutdown(); } if (printResults) { LOG.info("Print table contents after map/reduce"); }
8889909192939495969798
mr = new MiniMRCluster(2, "file:///", 3); Configuration conf = mr.createJobConf(); runWordCount(conf); runMultiFileWordCount(conf); } finally { if (mr != null) { mr.shutdown(); } } } public static class TrackingTextInputFormat extends TextInputFormat {
90919293949596979899100
runProgram(mr, dfs, wordCountPart, inputPath, outputPath, 3, 2, fixedPartitionOutput, null); runNonPipedProgram(mr, dfs, wordCountNoPipes, null); mr.waitUntilIdle(); } finally { mr.shutdown(); dfs.shutdown(); } }
102103104105106107108109110
TaskReport[] reports = job.jc_.getMapTaskReports(job.jobId_); assertEquals(1, reports.length); assertEquals("starting echo > sort", reports[0].getState()); } finally { if (fs != null) { clean(fs); } if (mr != null) { mr.shutdown(); } } } }
120121122123124125126127128129130
System.out.println(line); } assertEquals(cacheString + "\t", line); } finally{ if (dfs != null) { dfs.shutdown(); } if (mr != null) { mr.shutdown();} } } public static void main(String[]args) throws Exception
782783784785786787788789790791792
logs = fs.globStatus(new Path(namenode+"/logs/part*")); assertTrue("Unexpected map count, logs.length=" + logs.length, logs.length == 1); } finally { if (dfs != null) { dfs.shutdown(); } if (mr != null) { mr.shutdown(); } } } public void testLimits() throws Exception { Configuration conf = new Configuration();
143144145146147148149150151152153
} assertEquals(cacheString + "\t", line); assertEquals(cacheString2 + "\t", line2); } finally{ if (dfs != null) { dfs.shutdown(); } if (mr != null) { mr.shutdown();} } } public static void main(String[]args) throws Exception {
127128129130131132133134135136137