Changeset 31 for sample/hadoop-0.16/tw/org/nchc/code/WordCount.java
- Timestamp:
- Jul 17, 2008, 3:35:18 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sample/hadoop-0.16/tw/org/nchc/code/WordCount.java
r27 r31 56 56 57 57 // mapper: emits (token, 1) for every word occurrence 58 private static class MapClass extends MapReduceBase implements 59 Mapper<LongWritable, Text, Text, IntWritable> { 58 private static class MapClass extends MapReduceBase 59 implements Mapper<LongWritable, Text, Text, IntWritable> 60 { 60 61 61 62 // reuse objects to save overhead of object creation … … 77 78 78 79 // reducer: sums up all the counts 79 private static class ReduceClass extends MapReduceBase implements 80 Reducer<Text, IntWritable, Text, IntWritable> { 80 private static class ReduceClass extends MapReduceBase 81 implements Reducer<Text, IntWritable, Text, IntWritable> 82 { 81 83 82 84 // reuse objects … … 105 107 int reduceTasks = 1; 106 108 JobConf conf = new JobConf(WordCount.class); 107 conf.setJobName("wordcount");109 // conf.setJobName("wordcount"); 108 110 109 111 conf.setNumMapTasks(mapTasks); … … 118 120 119 121 conf.setMapperClass(MapClass.class); 120 conf.setCombinerClass(ReduceClass.class);122 // conf.setCombinerClass(ReduceClass.class); 121 123 conf.setReducerClass(ReduceClass.class); 122 124
Note: See TracChangeset
for help on using the changeset viewer.