code: private static int getBlockIdInFile(DistributedFileSystem srcFs, 
        Path srcPath, long blockId) throws IOException {
      FileStatus srcStat = srcFs.getFileStatus(srcPath);
      LocatedBlocks lbs =
          srcFs.getClient().getLocatedBlocks(srcPath.toUri().getPath(), 0, 
              srcStat.getLen());
      
      int i = 0;
      LOG.info("Look for block " + blockId + " in file " + srcPath);
      for (LocatedBlock lb: lbs.getLocatedBlocks()) {
        if (lb.getBlock().getBlockId() == blockId) {
          return i;
        }
        i++;
      }
      
      return -1;
    }
docs: Get the index of a block in a file, according to the blockId.
  
  Any better ways to do this?