@Override
  public Optional<ExtendedCell> getFirstKey() {
    if (!firstKeySeeked) {
      HFileScanner scanner = getScanner(true, true, false);
      try {
        if (scanner.seekTo()) {
          this.firstKey = Optional.ofNullable(scanner.getKey());
        }
        firstKeySeeked = true;
      } catch (IOException e) {
        LOG.warn("Failed seekTo first KV in the file", e);
      } finally {
        if (scanner != null) {
          scanner.close();
        }
      }
    }
    return this.firstKey;
  }
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