| | 32 | * 實際上 lab010 的程式碼與 lab009 的程式碼只差了以下幾行 |
| | 33 | {{{ |
| | 34 | #!diff |
| | 35 | diff -Naur lab009/src/WordCount.java lab010/src/WordCount.java |
| | 36 | --- lab009/src/WordCount.java 2015-03-08 09:33:01.207452767 +0800 |
| | 37 | +++ lab010/src/WordCount.java 2015-03-08 09:33:01.207452767 +0800 |
| | 38 | @@ -28,6 +28,7 @@ |
| | 39 | job.setReducerClass(IntSumReducer.class); |
| | 40 | job.setOutputKeyClass(Text.class); |
| | 41 | job.setOutputValueClass(IntWritable.class); |
| | 42 | + job.setNumReduceTasks(2); |
| | 43 | FileInputFormat.addInputPath(job, new Path(otherArgs[0])); |
| | 44 | FileOutputFormat.setOutputPath(job, new Path(otherArgs[1])); |
| | 45 | System.exit(job.waitForCompletion(true) ? 0 : 1); |
| | 46 | }}} |