Combiner能减少网络IO、提升作业的性能
Combiner的局限性:求平均数:总数 / 个数 对于含有除法的操作,需要慎重,有可能结果会不正确
四、词频统计具体代码实现[读写在HDFS和本地完成...(Java)
* VALUEIN:Map任务读数据的value类型,其实就是一行行的字符串,String
*
* 如文本中的数据为 :
* hello world welcome
* hello...,1) (world,1)
* (hello,1) (world,1)
* (hello,1) (world,1)
* (welcome,1)
* ...* key 为 word values含义:
* map的输出到reduce端,是按照相同的key分发到一个reduce上去执行
* reduce1 : (hello,1) (hello...,1) (hello,1) => (hello,[1,1,1])
* reduce2 : (world,1) (world,1) (world,1) => (world,[1,1,1