static RawSplit [ ] readSplitFile ( DataInput in ) throws IOException { byte [ ] header = new byte [ SPLIT_FILE_HEADER . length ] ; in . readFully ( header ) ; if ( ! Arrays . equals ( SPLIT_FILE_HEADER , header ) ) { throw new IOException ( "Invalid header on split file" ) ; } int vers = WritableUtils . readVInt ( in ) ; if ( vers != CURRENT_SPLIT_FILE_VERSION ) { throw new IOException ( "Unsupported split version " + vers ) ; } int len = WritableUtils . readVInt ( in ) ; RawSplit [ ] result = new RawSplit [ len ] ; for ( int i = 0 ; i < len ; ++ i ) { result [ i ] = new RawSplit ( ) ; result [ i ] . readFields ( in ) ; } return result ; }
Read a splits file into a list of raw splits