@Override
      public int reseekTo(ExtendedCell key) throws IOException {
        // This function is identical to the corresponding seekTo function
        // except that we call reseekTo (and not seekTo) on the delegate.
        if (top) {
          if (PrivateCellUtil.compareKeyIgnoresMvcc(getComparator(), key, splitCell) < 0) {
            return -1;
          }
        } else {
          if (PrivateCellUtil.compareKeyIgnoresMvcc(getComparator(), key, splitCell) >= 0) {
            // we would place the scanner in the second half.
            // it might be an error to return false here ever...
            boolean res = delegate.seekBefore(splitCell);
            if (!res) {
              throw new IOException("Seeking for a key in bottom of file, but"
                + " key exists in top of file, failed on seekBefore(midkey)");
            }
            return 1;
          }
        }
        if (atEnd) {
          // skip the 'reseek' and just return 1.
          return 1;
        }
        return delegate.reseekTo(key);
      }
Creates a half file reader for a hfile referred to by an hfilelink.
@param context   Reader context info
@param fileInfo  HFile info
@param cacheConf CacheConfig
@param r         original reference file (contains top or bottom)
@param conf      Configuration
hbase-server/src/main/java/org/apache/hadoop/hbase/io/HalfStoreFileReader.java