title: is the output of map phase of the mapreduce job always sorted?
body: <p>I am a bit confused with the output I get from Mapper.</p>
  
  <p>For example, when I run a simple wordcount program, with this input text:</p>
  
  <pre><code>hello world
  Hadoop programming
  mapreduce wordcount
  lets see if this works
  12345678
  hello world
  mapreduce wordcount
  </code></pre>
  
  <p>this is the output that I get:</p>
  
  <pre><code>12345678    1
  Hadoop  1
  hello   1
  hello   1
  if  1
  lets    1
  mapreduce   1
  mapreduce   1
  programming 1
  see 1
  this    1
  wordcount   1
  wordcount   1
  works   1
  world   1
  world   1
  </code></pre>
  
  <p>As you can see, the output from mapper is already sorted. I did not run <code>Reducer</code> at all.
  But I find in a different project that the output from mapper is not sorted.
  So I am totally clear about this..</p>
  
  <p>My questions are:</p>
  
  <ol>
  <li>Is the mapper's output always sorted?</li>
  <li>Is the sort phase integrated into the mapper phase already, so that the output of map phase is already sorted in the intermediate data?</li>
  <li>Is there a way to collect the data from <code>sort and shuffle</code> phase and persist it before it goes to Reducer? A reducer is presented with a key and a list of iterables. Is there a way, I could persist this data?</li>
  </ol>