A complete driver
Sunday, February 28, 2010
1:19 PM
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.FileInputFormat;
import org.apache.hadoop.mapred.FileOutputFormat;
import org.apache.hadoop.mapred.JobClient;
import org.apache.hadoop.mapred.JobConf;
public class WordCount {
 public static void main(String[] args) {
  JobConf conf = new JobConf(WordCount.class);
  // specify output types
  conf.setOutputKeyClass(Text.class);
  conf.setOutputValueClass(IntWritable.class);
  // specify input and output dirs
  FileInputPath.addInputPath(conf, new Path("input"));
  FileOutputPath.addOutputPath(conf, new Path("output"));
  // specify a mapper
  conf.setMapperClass(WordCountMapper.class);
  // specify a reducer
  conf.setReducerClass(WordCountReducer.class);
  conf.setCombinerClass(WordCountReducer.class);
  try {
   JobClient.runJob(conf);
  } catch (Exception e) {
   e.printStackTrace();
  }
 }
}
Pasted from <[link]> 