读书人

运作hadoop时的一些技巧

发布时间: 2012-09-01 09:33:03 作者: rapoo

运行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

读书人网 >编程

热点推荐