title: How does XML be parsed in hadoop in parallel
body: <p>If I have a large XML file, and I want to process it in parallel. 'Hadoop in practice' use mahout XMLInputFormat, and I find the <code>getSplits()</code> method is not overrided. In other words, it's using TextInputFormat's <code>getSplits()</code> method. And how does this method avoid splitting the file in the position of begin-tag and end-tag?</p>
  
  <p>When I have a XML file like this. And two mappers are used to process the XML file in parallel. </p>
  
  <pre><code> &lt;persons&gt;            
     &lt;person&gt;             
       &lt;name&gt;John&lt;/name&gt;  
       &lt;age&gt;12&lt;/age&gt;
     &lt;/person&gt;
  
     . . . . . . .
  
     &lt;person&gt;
                        ------- until here as the first FileSplit
       &lt;name&gt;Amy&lt;/name&gt;
       &lt;age&gt;14&lt;/age&gt;
     &lt;/person&gt;
  
     . . . . . . .
  
     &lt;person&gt;
       &lt;name&gt;Dan&lt;/name&gt;
       &lt;age&gt;12&lt;/age&gt;
     &lt;/person&gt;
   &lt;/persons&gt;          ------- remaining as the second FileSplit
  </code></pre>
  
  <p>When the mapper takes the second FileSplit, it can't recognize the Amy record, because it can't find the begin tag.</p>