GafferCoprocessor extends BaseRegionObserver { @Override public InternalScanner preCompact(final ObserverContext<RegionCoprocessorEnvironment> e, final Store store, final InternalScanner scanner, final ScanType scanType, final CompactionRequest request) throws IOException { return new StoreScanner(scanner, schema, serialisation); }  @Override void start(final CoprocessorEnvironment e); @Override InternalScanner preFlush(final ObserverContext<RegionCoprocessorEnvironment> e,
                                    final Store store,
                                    final InternalScanner scanner); @Override InternalScanner preCompact(final ObserverContext<RegionCoprocessorEnvironment> e,
                                      final Store store,
                                      final InternalScanner scanner,
                                      final ScanType scanType,
                                      final CompactionRequest request); @Override InternalScanner preCompact(final ObserverContext<RegionCoprocessorEnvironment> e,
                                      final Store store,
                                      final InternalScanner scanner,
                                      final ScanType scanType); @Override RegionScanner postScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> e, final Scan scan, final RegionScanner scanner);  }
@Test public void shouldDelegatePreCompactWithRequestToStoreScanner() throws IOException { final ObserverContext<RegionCoprocessorEnvironment> e = mock(ObserverContext.class); final Store store = mock(Store.class); final InternalScanner scanner = mock(InternalScanner.class); final CompactionRequest request = mock(CompactionRequest.class); final StoreScanner storeScanner = (StoreScanner) coprocessor.preCompact(e, store, scanner, ScanType.COMPACT_DROP_DELETES, request); assertNotNull(storeScanner); }
@Test public void shouldDelegatePreCompactToStoreScanner() throws IOException { final ObserverContext<RegionCoprocessorEnvironment> e = mock(ObserverContext.class); final Store store = mock(Store.class); final InternalScanner scanner = mock(InternalScanner.class); final StoreScanner storeScanner = (StoreScanner) coprocessor.preCompact(e, store, scanner, ScanType.COMPACT_DROP_DELETES); assertNotNull(storeScanner); }