@Override
  public void close() {
    if (this.scanner != null) {
      try {
        this.scanner.close();
        this.scanner = null;
      } catch (IOException ex) {
        LOG.warn("Exception while closing scanner", ex);
      }
    }
    if (this.region != null) {
      try {
        this.region.closeRegionOperation();
        this.region.close(true);
        this.region = null;
      } catch (IOException ex) {
        LOG.warn("Exception while closing region", ex);
      }
    }

    // In typical region operation, RegionServerServices would handle the lifecycle of
    // the MobFileCache and BlockCache. In ClientSideRegionScanner, we need to handle
    // the lifecycle of these components ourselves to avoid resource leaks.
    if (mobFileCache != null) {
      mobFileCache.shutdown();
      mobFileCache = null;
    }

    if (blockCache != null) {
      blockCache.shutdown();
      blockCache = null;
    }
  }
A client scanner for a region opened for read-only on the client side. Assumes region data is not
changing.
hbase-server/src/main/java/org/apache/hadoop/hbase/client/ClientSideRegionScanner.java