首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

运作hadoop时的一些技巧

2012-09-01 
运行hadoop时的一些技巧//用来给key分区的,需要实现Partitioner接口??conf.setPartitionerClass(Partition

运行hadoop时的一些技巧

//用来给key分区的,需要实现Partitioner接口
??conf.setPartitionerClass(Partitioner.class);
??//分组,跟分区不同
??conf.setOutputValueGroupingComparator(theClass);
??//中间合并程序,一般跟reduce类似
??conf.setCombinerClass(ComReduce.class);

//对结果中的 key 进行排序时的使用的比较器,默认使用的是WritableComparable ,如对hadoop自带的wordcount

//程序,默认的比较器是按升序排序的,但我们往往需要用到的是降序,这时可以利用这个方法。

//参考:http://blog.chinaunix.net/u3/99156/showart_2157576.html

更多信息请查看?java进阶网?http://www.javady.com

热点排行