@Override
  public Optional<ExtendedCell> getLastKey() {
    if (top) {
      return super.getLastKey();
    }
    // Get a scanner that caches the block and that uses pread.
    HFileScanner scanner = getScanner(true, true, false);
    try {
      if (scanner.seekBefore(this.splitCell)) {
        return Optional.ofNullable(scanner.getKey());
      }
    } catch (IOException e) {
      LOG.warn("Failed seekBefore " + Bytes.toStringBinary(this.splitkey), e);
    } finally {
      if (scanner != null) {
        scanner.close();
      }
    }
    return Optional.empty();
  }
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