public BlockLocation [ ] getFileBlockLocations ( FileStatus file , long start , long len ) throws IOException { if ( file == null ) { return null ; } if ( ( start < 0 ) || ( len < 0 ) ) { throw new IllegalArgumentException ( "Invalid start or len parameter" ) ; } if ( file . getLen ( ) < start ) { return new BlockLocation [ 0 ] ; } String [ ] name = { "localhost:50010" } ; String [ ] host = { "localhost" } ; return new BlockLocation [ ] { new BlockLocation ( name , host , 0 , file . getLen ( ) ) } ; }
Return an array containing hostnames offset and size of portions of the given file . For a nonexistent file or regions null will be returned .