Hadoop实现共同出现的单词(Word co(3)

// group and partition by the first int in the pair
    //job.setPartitionerClass(FirstPartitioner.class);
    //job.setGroupingComparatorClass(FirstGroupingComparator.class);

// the reduce output is Text, IntWritable
    job.setReducerClass(MyReducer.class);
    job.setOutputKeyClass(TextPair.class);
    job.setOutputValueClass(IntWritable.class);
   
    //FileInputFormat.addInputPath(job, new Path("../shakespeareinput"));
    //FileOutputFormat.setOutputPath(job, new Path("output"));
 FileInputFormat.addInputPath(job, new Path(args[0]));
    FileOutputFormat.setOutputPath(job, new Path(args[1]));
    System.exit(job.waitForCompletion(true) ? 0 : 1);
  }//End of main
}//End of CoOccurrence

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/96f9f507f1404d812256d80db80fcec8.html