A driver
Sunday, February 28, 2010
9:07 PM
A driver
public static void main(String[] args) {
  // Create a "configuration" for a job
  JobConf conf = new JobConf(WordCount.class);
  // specify output types
  conf.setOutputKeyClass(Text.class);
  conf.setOutputValueClass(IntWritable.class);
  // specify input and output directories in filesystem
  FileInputPath.addInputPath(conf, new Path("input"));
  FileOutputPath.addOutputPath(conf, new Path("output"));
  // specify a mapper
  conf.setMapperClass(WordCountMapper.class);
  // a reducer produces a final answer. 
  conf.setReducerClass(WordCountReducer.class);
  // a combiner produces intermediate values.
  conf.setCombinerClass(WordCountReducer.class);
  try {
   // try to do it.
   JobClient.runJob(conf);
  } catch (Exception e) {
   e.printStackTrace();
  }
}