private void doPread(FSDataInputStream stm, long position, byte[] buffer, int offset, int length)
    throws IOException {
    int nread = 0;
    // long totalRead = 0;
    // DFSInputStream dfstm = null;

    /*
     * Disable. This counts do not add up. Some issue in original hdfs tests? if
     * (stm.getWrappedStream() instanceof DFSInputStream) { dfstm = (DFSInputStream)
     * (stm.getWrappedStream()); totalRead = dfstm.getReadStatistics().getTotalBytesRead(); }
     */

    while (nread < length) {
      int nbytes = stm.read(position + nread, buffer, offset + nread, length - nread);
      assertTrue("Error in pread", nbytes > 0);
      nread += nbytes;
    }

    /*
     * Disable. This counts do not add up. Some issue in original hdfs tests? if (dfstm != null) {
     * if (isHedgedRead) { assertTrue("Expected read statistic to be incremented", length <=
     * dfstm.getReadStatistics().getTotalBytesRead() - totalRead); } else {
     * assertEquals("Expected read statistic to be incremented", length, dfstm
     * .getReadStatistics().getTotalBytesRead() - totalRead); } }
     */
  }
Ugly test that ensures we can get at the hedged read counters in dfsclient. Does a bit of
preading with hedged reads enabled using code taken from hdfs TestPread.
hbase-server/src/test/java/org/apache/hadoop/hbase/util/TestFSUtils.java