之前在学习mapreduce 的过程中一直不能够完全准确的理解shuffle,partition,combiner的作用,其实简单来说:
shuffle:
是描述着数据从map端传输到reduce端的过程,而且我们知道的是hadoop的集群环境中,大部分map task和reduce task是在不同的node上执行,主要的开销是网络开销和磁盘IO开销,因此shuffle的主要作用相当于是
1.完整的从map task端传输到reduce task端。
2.跨节点传输数据时,尽可能减少对带宽的消耗.(注意是reduce执行的时候去拉取map端的结果)
3.减少磁盘IO开销对task的影响。
可以查看下别人的成果:http://hi.baidu.com/kingdouble8008/blog/item/28623fde1f3e520f48540313.html。
Partition:
重定向mapper的输出,根据key来决定mapper应该讲k,v对输出给谁,默认采用的hash key来实现,也可以根据自己的需要来实现。
combiner:
相当于本地的reduce,在分发mapper的结果之前做一下本地的reduce,比如说wordcount程序,单词“a”出现了500次,存储并洗牌一次(“a”,500)键值对比许多次(“a”,1)要高效。