@InterfaceAudience.Private public class WriteHeavyIncrementObserver extends Object implements RegionCoprocessor, RegionObserver
We will convert increment to put, and do aggregating when get. And of course the return value of increment is useless then.
Notice that this is only an example so we do not handle most corner cases, for example, you must provide a qualifier when doing a get.
Coprocessor.StateRegionObserver.MutationTypePRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION| Constructor and Description |
|---|
WriteHeavyIncrementObserver() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBulkLoadObserver, getEndpointObservergetServices, start, stoppostAppend, postBatchMutate, postBatchMutateIndispensably, postBulkLoadHFile, postCheckAndDelete, postCheckAndPut, postClose, postCloseRegionOperation, postCommitStoreFile, postCompact, postCompactSelection, postDelete, postExists, postFlush, postFlush, postGetOp, postIncrement, postInstantiateDeleteTracker, postMemStoreCompaction, postMutationBeforeWAL, postOpen, postPut, postReplayWALs, postScannerClose, postScannerFilterRow, postScannerNext, postScannerOpen, postStartRegionOperation, postStoreFileReaderOpen, postWALRestore, preAppend, preAppendAfterRowLock, preBatchMutate, preBulkLoadHFile, preCheckAndDelete, preCheckAndDeleteAfterRowLock, preCheckAndPut, preCheckAndPutAfterRowLock, preClose, preCommitStoreFile, preCompactSelection, preDelete, preExists, preFlush, preIncrementAfterRowLock, preMemStoreCompaction, preOpen, prePrepareTimeStampForDeleteVersion, prePut, preReplayWALs, preScannerClose, preScannerNext, preScannerOpen, preStoreFileReaderOpen, preWALRestorepublic Optional<RegionObserver> getRegionObserver()
getRegionObserver in interface RegionCoprocessorpublic void preFlushScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store, ScanOptions options, FlushLifeCycleTracker tracker) throws IOException
preFlushScannerOpen in interface RegionObserverIOExceptionpublic InternalScanner preFlush(ObserverContext<RegionCoprocessorEnvironment> c, Store store, InternalScanner scanner, FlushLifeCycleTracker tracker) throws IOException
preFlush in interface RegionObserverIOExceptionpublic void preCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store, ScanType scanType, ScanOptions options, CompactionLifeCycleTracker tracker, CompactionRequest request) throws IOException
preCompactScannerOpen in interface RegionObserverIOExceptionpublic InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> c, Store store, InternalScanner scanner, ScanType scanType, CompactionLifeCycleTracker tracker, CompactionRequest request) throws IOException
preCompact in interface RegionObserverIOExceptionpublic void preMemStoreCompactionCompactScannerOpen(ObserverContext<RegionCoprocessorEnvironment> c, Store store, ScanOptions options) throws IOException
preMemStoreCompactionCompactScannerOpen in interface RegionObserverIOExceptionpublic InternalScanner preMemStoreCompactionCompact(ObserverContext<RegionCoprocessorEnvironment> c, Store store, InternalScanner scanner) throws IOException
preMemStoreCompactionCompact in interface RegionObserverIOExceptionpublic void preGetOp(ObserverContext<RegionCoprocessorEnvironment> c, Get get, List<Cell> result) throws IOException
preGetOp in interface RegionObserverIOExceptionpublic Result preIncrement(ObserverContext<RegionCoprocessorEnvironment> c, Increment increment) throws IOException
preIncrement in interface RegionObserverIOExceptionpublic void preStoreScannerOpen(ObserverContext<RegionCoprocessorEnvironment> ctx, Store store, ScanOptions options) throws IOException
preStoreScannerOpen in interface RegionObserverIOExceptionCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.