---
title: "hadoop mapreduce  shuffle"
author: "leibnitz"
date: "2011-04-09T01:43:56Z"
tags: ["Hadoop", "Mapreduce"]
categories: ["非技术"]
slug: "hadoop-mapreduce-shuffle"
draft: false
lastmod: "2011-04-21T21:40:01Z"
id: 993544
url: "https://leibnitz.iteye.com/blog/993544"
---

it is a trick to understand  the shuffle principle in hadoop.let us to learn together.

if u find something wrong in this descriptions,please tell me why :)

![](http://dl.iteye.com/upload/attachment/468265/6cc5306c-2b2b-30a3-a342-9f184fbd6e60.png)

**here is a 4 maps + 3 reds**

 

1\.

why there are threes flows in the illustration(as marked by digit parts)?

when i check the property "mapred.local.dir",it says:

写道

The local directory where MapReduce stores intermediate  
data files. May be a comma-separated list of  
directories on different devices in order to \*\*spread disk i/o\*\*.

it is the really causes of that? it is necessary for me to chceck the sources to validate...TODO

 

 

2.u can see the merge oper before reduce,so there are two Sort phase in the shuffle in the fact.

someone asks:why it is necessary to sort after map before transfer to reduce?Performance! i think,if this,the Merge in Red is much more effective as shuffle used a "二路归并" sorting algorithm.