private InternalScanner createScanner(HStore store, List<KeyValueScanner> scanners)
    throws IOException {
    InternalScanner scanner = null;
    boolean success = false;
    try {
      RegionCoprocessorHost cpHost = store.getCoprocessorHost();
      ScanInfo scanInfo;
      if (cpHost != null) {
        scanInfo = cpHost.preMemStoreCompactionCompactScannerOpen(store);
      } else {
        scanInfo = store.getScanInfo();
      }
      scanner = new StoreScanner(store, scanInfo, scanners, ScanType.COMPACT_RETAIN_DELETES,
        store.getSmallestReadPoint(), PrivateConstants.OLDEST_TIMESTAMP);
      if (cpHost != null) {
        InternalScanner scannerFromCp = cpHost.preMemStoreCompactionCompact(store, scanner);
        if (scannerFromCp == null) {
          throw new CoprocessorException("Got a null InternalScanner when calling"
            + " preMemStoreCompactionCompact which is not acceptable");
        }
        success = true;
        return scannerFromCp;
      } else {
        success = true;
        return scanner;
      }
    } finally {
      if (!success) {
        Closeables.close(scanner, true);
        scanners.forEach(KeyValueScanner::close);
      }
    }
  }
Creates the scanner for compacting the pipeline.
@return the scanner
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/MemStoreCompactorSegmentsIterator.java