@Override
  public void close(boolean evictOnClose) throws IOException {
    if (closed.compareAndSet(false, true)) {
      if (evictOnClose) {
        final HFileReaderImpl.HFileScannerImpl s =
          (HFileReaderImpl.HFileScannerImpl) super.getScanner(false, true, false);
        final String reference = this.reader.getHFileInfo().getHFileContext().getHFileName();
        final String referred = StoreFileInfo.getReferredToRegionAndFile(reference).getSecond();
        s.seekTo(splitCell);
        if (s.getCurBlock() != null) {
          long offset = s.getCurBlock().getOffset();
          LOG.trace("Seeking to split cell in reader: {} for file: {} top: {}, split offset: {}",
            this, reference, top, offset);
          ((HFileReaderImpl) reader).getCacheConf().getBlockCache().ifPresent(cache -> {
            int numEvictedReferred = top
              ? cache.evictBlocksRangeByHfileName(referred, offset, Long.MAX_VALUE)
              : cache.evictBlocksRangeByHfileName(referred, 0, offset);
            int numEvictedReference = cache.evictBlocksByHfileName(reference);
            LOG.trace(
              "Closing reference: {}; referred file: {}; was top? {}; evicted for referred: {};"
                + "evicted for reference: {}",
              reference, referred, top, numEvictedReferred, numEvictedReference);
          });
        }
        s.close();
        reader.close(false);
      } else {
        reader.close(evictOnClose);
      }
    }
  }
Overrides close method to handle cache evictions for the referred file. If evictionOnClose is
true, we will seek to the block containing the splitCell and evict all blocks from offset 0 up
to that block offset if this is a bottom half reader, or the from the split block offset up to
the end of the file if this is a top half reader.
@param evictOnClose true if it should evict the file blocks from the cache.
hbase-server/src/main/java/org/apache/hadoop/hbase/io/HalfStoreFileReader.java