class ThemisRegionObserver extends BaseRegionObserver {

  @Override
  public InternalScanner preFlushScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c,
      final Store store, final KeyValueScanner memstoreScanner, final InternalScanner s)
      throws IOException {
    if (expiredDataCleanEnable
        && (ThemisMasterObserver.isThemisEnableFamily(store.getFamily()) || ColumnUtil
            .isCommitFamily(store.getFamily().getName()))) {
      InternalScanner scanner = getScannerToCleanExpiredThemisData(store, store.scanInfo,
        Collections.singletonList(memstoreScanner), ScanType.MINOR_COMPACT, store.getHRegion()
            .getSmallestReadPoint(), HConstants.OLDEST_TIMESTAMP, false);
      if (scanner != null) {
        return scanner;
      }
    }
    return s;
  }

}