Changeset 25 for sample/hadoop-0.16/WordCount2.java
- Timestamp:
- Jul 3, 2008, 4:45:54 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sample/hadoop-0.16/WordCount2.java
r24 r25 14 14 import org.apache.hadoop.io.LongWritable; 15 15 import org.apache.hadoop.io.Text; 16 import org.apache.hadoop.mapred.FileInputFormat;17 import org.apache.hadoop.mapred.FileOutputFormat;18 16 import org.apache.hadoop.mapred.JobClient; 19 17 import org.apache.hadoop.mapred.JobConf; … … 131 129 conf.setNumReduceTasks(reduceTasks); 132 130 133 //conf.setInputPath(new Path(filename));134 FileInputFormat.setInputPaths(conf,new Path(filename)); 131 conf.setInputPath(new Path(filename)); 132 135 133 conf.setOutputKeyClass(Text.class); 136 134 conf.setOutputValueClass(IntWritable.class); 137 135 138 //conf.setOutputPath(new Path(outputPath));139 FileOutputFormat.setOutputPath( conf, new Path(filename)); 136 conf.setOutputPath(new Path(outputPath)); 137 140 138 141 139 … … 146 144 // Delete the output directory if it exists already 147 145 Path outputDir = new Path(outputPath); 148 FileSystem.get(conf).delete(outputDir ,true);146 FileSystem.get(conf).delete(outputDir); 149 147 JobClient.runJob(conf); 150 148 }
Note: See TracChangeset
for help on using the changeset viewer.