设为首页 加入收藏

TOP

Hadoop实现共同出现的单词(Word co-occurrence)(三)
2014-11-24 03:08:19 来源: 作者: 【 】 浏览:3
Tags:Hadoop 实现 共同 出现 单词 Word co-occurrence
= 2) {
// System.err.println("Usage: CoOccurrence ");
// System.exit(2);
//}
Job job = new Job(conf, "Co-Occurrence");
job.setJarByClass(CoOccurrence.class);

job.setMapperClass(MyMapper.class);
job.setMapOutputKeyClass(TextPair.class);
job.setMapOutputValueClass(IntWritable.class);

job.setCombinerClass(MyReducer.class);


// 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


首页 上一页 1 2 3 下一页 尾页 3/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Linux 下smi/mdio总线通信 下一篇Android开发技巧:动态创建UI界面

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·C++ 语言社区-CSDN社 (2025-12-24 17:48:24)
·CSDN问答专区社区-CS (2025-12-24 17:48:22)
·C++中`a = b = c`与` (2025-12-24 17:48:19)
·C语言结构体怎么直接 (2025-12-24 17:19:44)
·为什么指针作为c语言 (2025-12-24 17:19:41)