我对 MapReduce 框架很困惑。我从不同的来源读到了这方面的内容,感到很困惑。顺便说一句,这是我对 MapReduce 作业的想法
1. Map()-->emit <key,value>
2. Partitioner (OPTIONAL) --> divide
intermediate output from mapper and assign them to different
reducers
3. Shuffle phase used to make: <key,listofvalues>
4. Combiner, component used like a minireducer wich perform some
operations on datas and then pass those data to the reducer.
Combiner is on local not HDFS, saving space and time.
5. Reducer, get the data from the combiner, perform further
operation(probably the same as the combiner) then release the
output.
6. We will have n outputs parts, where n is the number
of reducers
基本上是对的吗?我的意思是,我发现一些消息来源指出组合器是随机播放阶段,它基本上按键对每个记录进行分组......
组合器与洗牌阶段完全不同。你所描述的洗牌是错误的,这才是你困惑的根源。
洗牌只是从map复制key到reduce,与key生成无关。这是Reducer 的第一个阶段,其他两个阶段是排序和归约。
组合就像在本地执行一个减速器,用于每个映射器的输出。它基本上就像一个减速器(它也扩展了减速器类),这意味着,像减速器一样,它对映射器为同一键发出的本地值进行分组。
分区实际上,将映射输出键分配给特定的reduce 任务,但它不是可选的。使用您自己的实现覆盖默认的 HashPartitioner 是可选的。
我试图将这个答案保持在最低限度,但您可以在 Tom White 的《Hadoop:权威指南》一书中找到更多信息,正如 Azim 所建议的,以及一些相关的内容这个帖子 https://stackoverflow.com/a/22169760/2516301.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)