Changeset 25 for sample/hadoop-0.16/tw/org/nchc/demo/DemoWordCount.java
- Timestamp:
- Jul 3, 2008, 4:45:54 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sample/hadoop-0.16/tw/org/nchc/demo/DemoWordCount.java
r21 r25 28 28 import org.apache.hadoop.mapred.Reducer; 29 29 import org.apache.hadoop.mapred.Reporter; 30 31 import tw.org.nchc.code.Convert;32 30 33 31 /** … … 107 105 conf.setNumMapTasks(mapTasks); 108 106 conf.setNumReduceTasks(reduceTasks); 109 //0.16 110 //conf.setInputPath(new Path(filename));111 Convert.setInputPath(conf, new Path(filename)); 107 108 conf.setInputPath(new Path(filename)); 109 112 110 conf.setOutputKeyClass(Text.class); 113 111 conf.setOutputValueClass(IntWritable.class); 114 // 0.16 115 // conf.setOutputPath(new Path(outputPath)); 116 Convert.setInputPath(conf, new Path(outputPath)); 112 113 conf.setOutputPath(new Path(outputPath)); 117 114 conf.setMapperClass(MapClass.class); 118 115 conf.setCombinerClass(ReduceClass.class); … … 121 118 // Delete the output directory if it exists already 122 119 Path outputDir = new Path(outputPath); 123 // 0.16 124 // FileSystem.get(conf).delete(outputDir); 125 FileSystem.get(conf).delete(outputDir,true); 120 FileSystem.get(conf).delete(outputDir); 126 121 JobClient.runJob(conf); 127 122 }
Note: See TracChangeset
for help on using the changeset viewer.