Review Board 1.7.22


HBASE-6427 Pluggable compaction policies via coprocessors

Review Request #6186 - Created July 28, 2012 and updated

Lars Hofhansl
trunk
Reviewers
hbase
apurtell, tedyu
hbase
Extends the coprocessor framework.

New RegionObserver methods:
    void postFlush(final ObserverContext<RegionCoprocessorEnvironment> c, final Store store, final StoreFile resultFile) throws IOException;

    InternalScanner preFlush(final ObserverContext<RegionCoprocessorEnvironment> c, final Store store, final InternalScanner scanner) throws IOException;

    InternalScanner preFlushScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c, final Store store, final KeyValueScanner memstoreScanner, final InternalScanner s) throws IOException;

    InternalScanner preCompactScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c, final Store store, List<? extends KeyValueScanner> scanners, final ScanType scanType, final long earliestPutTs, final InternalScanner s) throws IOException;

    KeyValueScanner preStoreScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> c, final Store store, final Scan scan, final NavigableSet<byte[]> targetCols, final KeyValueScanner s) throws IOException;

Deprecate RegionObserver methods:

    void postFlush(final ObserverContext<RegionCoprocessorEnvironment> c) throws IOException;
    void preFlush(final ObserverContext<RegionCoprocessorEnvironment> c) throws IOException;

The new {pre|post}Flush are called per Store (instead of per region, which didn't really make much sense) in analogy to {pre|post}Compact.

With a comprocessor can seize full control over the compaction process.
- TestCoprocessorScanPolicies
- All tests in TestFromClientSide and TestCompaction with coprocessor re-implementing default behavior through test subclasses.
Review request changed
Updated (July 30, 2012, 1:29 a.m.)
Addressing Himanshu's comments.