MapReduce Shuffle 原理以及优化

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)); //

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值