public InternalScanner preCompact(final HStore store, final InternalScanner scanner,
    final ScanType scanType, final CompactionLifeCycleTracker tracker,
    final CompactionRequest request, final User user) throws IOException {
    InternalScanner defaultResult = scanner;
    if (coprocEnvironments.isEmpty()) {
      return defaultResult;
    }
    return execOperationWithResult(new ObserverOperationWithResult<RegionObserver, InternalScanner>(
      regionObserverGetter, defaultResult, user) {
      @Override
      public InternalScanner call(RegionObserver observer) throws IOException {
        InternalScanner scanner =
          observer.preCompact(this, store, getResult(), scanType, tracker, request);
        if (scanner == null) {
          throw new CoprocessorException("Null Scanner return disallowed!");
        }
        return scanner;
      }
    });
  }
Called prior to rewriting the store files selected for compaction
@param store    the store being compacted
@param scanner  the scanner used to read store data during compaction
@param scanType type of Scan
@param tracker  used to track the life cycle of a compaction
@param request  the compaction request
@param user     the user
@return Scanner to use (cannot be null!)
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java