MapReduce Shuffle 原理以及优化
1、MapReduce 编程模型
Hadoop MapReduce 是一个分布式计算框架,用于编写批处理应用程序;
数据以一条记录为单位经过 map 方法映射成KV,相同的key为一组,这一组数据调用一次 reduce方法,在方法内迭代计算着一组数据。
2、MapReduce 的实现原理

Client 提交
客户端在进行submit() 之前,会获取待处理数据的信息,然后做出执行前的规划;很重要,支撑了计算向数据移动和计算的并行度;
源码中
- 1,Checking the input and output specifications of the job.
- 2,Computing the InputSplits for the job. // split ->并行度和计算向数据移动就可以实现了
- 3,Setup the requisite accounting information for the DistributedCache of the job, if necessary.
- 4,Copying the job’s jar and configuration to the map-reduce system directory on the distributed file-system.
- 5,Submitting the job to the JobTracker and optionally monitoring it’s status
对于 split 的计算:
minSize = 1
maxSize = Long.Max
blockSize = file
splitSize = Math.max(minSize, Math.min(maxSize, blockSize));//

最低0.47元/天 解锁文章
564

被折叠的 条评论
为什么被折叠?



