public boolean setNextKeyValue ( Text key , Row value ) throws IOException { if ( ! _rows . hasNext ( ) ) { Closeables . close ( this , true ) ; return false ; } try { Map < String , Object > content = _rows . next ( ) ; key . set ( Coordinate . fromJson ( content ) . toString ( ) ) ; value . set ( content ) ; _rowsRead += 1 ; } catch ( Exception e ) { for ( Throwable cause : Throwables . getCausalChain ( e ) ) { Throwables . propagateIfInstanceOf ( cause , IOException . class ) ; } throw new IOException ( "Failed to read next row" , e ) ; } return true ; }
Read the next row from the split storing the coordinate in key and the content in value . If there are no more rows then false is returned and key and value are not modified .