public static class TestCoprocessorInterface.CoprocessorImpl extends BaseRegionObserver
RegionObserver.MutationType
Coprocessor.State
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION
Constructor and Description |
---|
CoprocessorImpl() |
Modifier and Type | Method and Description |
---|---|
void |
postClose(ObserverContext<RegionCoprocessorEnvironment> e,
boolean abortRequested)
Called after the region is reported as closed to the master.
|
void |
postCompact(ObserverContext<RegionCoprocessorEnvironment> e,
Store store,
StoreFile resultFile)
Called after compaction has completed and the new store file has been moved in to place.
|
void |
postFlush(ObserverContext<RegionCoprocessorEnvironment> e)
Called after the memstore is flushed to disk.
|
void |
postOpen(ObserverContext<RegionCoprocessorEnvironment> e)
Called after the region is reported as open to the master.
|
RegionScanner |
postScannerOpen(ObserverContext<RegionCoprocessorEnvironment> e,
Scan scan,
RegionScanner s)
Called after the client opens a new scanner.
|
void |
postSplit(ObserverContext<RegionCoprocessorEnvironment> e,
Region l,
Region r)
Called after the region is split.
|
void |
preClose(ObserverContext<RegionCoprocessorEnvironment> e,
boolean abortRequested)
Called before the region is reported as closed to the master.
|
InternalScanner |
preCompact(ObserverContext<RegionCoprocessorEnvironment> e,
Store store,
InternalScanner scanner,
ScanType scanType)
Called prior to writing the
StoreFile s selected for compaction into a new
StoreFile . |
void |
preFlush(ObserverContext<RegionCoprocessorEnvironment> e)
Called before the memstore is flushed to disk.
|
void |
preOpen(ObserverContext<RegionCoprocessorEnvironment> e)
Called before the region is reported as open to the master.
|
void |
preSplit(ObserverContext<RegionCoprocessorEnvironment> e)
Called before the region is split.
|
void |
preSplit(ObserverContext<RegionCoprocessorEnvironment> c,
byte[] splitRow)
Called before the region is split.
|
void |
start(CoprocessorEnvironment e) |
void |
stop(CoprocessorEnvironment e) |
postAppend, postBatchMutate, postBatchMutateIndispensably, postBulkLoadHFile, postCheckAndDelete, postCheckAndPut, postCloseRegionOperation, postCompact, postCompactSelection, postCompactSelection, postCompleteSplit, postDelete, postExists, postFlush, postGetClosestRowBefore, postGetOp, postIncrement, postIncrementColumnValue, postInstantiateDeleteTracker, postLogReplay, postMutationBeforeWAL, postPut, postRollBackSplit, postScannerClose, postScannerFilterRow, postScannerNext, postStartRegionOperation, postStoreFileReaderOpen, postWALRestore, postWALRestore, preAppend, preAppendAfterRowLock, preBatchMutate, preBulkLoadHFile, preCheckAndDelete, preCheckAndDeleteAfterRowLock, preCheckAndPut, preCheckAndPutAfterRowLock, preCompact, preCompactScannerOpen, preCompactScannerOpen, preCompactSelection, preCompactSelection, preDelete, preExists, preFlush, preFlushScannerOpen, preGetClosestRowBefore, preGetOp, preIncrement, preIncrementAfterRowLock, preIncrementColumnValue, prePrepareTimeStampForDeleteVersion, prePut, preRollBackSplit, preScannerClose, preScannerNext, preScannerOpen, preSplitAfterPONR, preSplitBeforePONR, preStoreFileReaderOpen, preStoreScannerOpen, preWALRestore, preWALRestore
public void start(CoprocessorEnvironment e)
start
in interface Coprocessor
start
in class BaseRegionObserver
public void stop(CoprocessorEnvironment e)
stop
in interface Coprocessor
stop
in class BaseRegionObserver
public void preOpen(ObserverContext<RegionCoprocessorEnvironment> e)
RegionObserver
preOpen
in interface RegionObserver
preOpen
in class BaseRegionObserver
e
- the environment provided by the region serverpublic void postOpen(ObserverContext<RegionCoprocessorEnvironment> e)
RegionObserver
postOpen
in interface RegionObserver
postOpen
in class BaseRegionObserver
e
- the environment provided by the region serverpublic void preClose(ObserverContext<RegionCoprocessorEnvironment> e, boolean abortRequested)
RegionObserver
preClose
in interface RegionObserver
preClose
in class BaseRegionObserver
e
- the environment provided by the region serverabortRequested
- true if the region server is abortingpublic void postClose(ObserverContext<RegionCoprocessorEnvironment> e, boolean abortRequested)
RegionObserver
postClose
in interface RegionObserver
postClose
in class BaseRegionObserver
e
- the environment provided by the region serverabortRequested
- true if the region server is abortingpublic InternalScanner preCompact(ObserverContext<RegionCoprocessorEnvironment> e, Store store, InternalScanner scanner, ScanType scanType)
RegionObserver
StoreFile
s selected for compaction into a new
StoreFile
. To override or modify the compaction process, implementing classes have two
options:
InternalScanner
with a custom implementation that is returned
from this method. The custom scanner can then inspect
KeyValue
s from the wrapped
scanner, applying its own policy to what gets written.ObserverContext.bypass()
and provide a
custom implementation for writing of new StoreFile
s. Note: any implementations
bypassing core compaction using this approach must write out new store files themselves or the
existing data will no longer be available after compaction.preCompact
in interface RegionObserver
preCompact
in class BaseRegionObserver
e
- the environment provided by the region serverstore
- the store being compactedscanner
- the scanner over existing data used in the store file rewritingscanType
- type of Scannull
unless the
implementation is writing new store files on its own.public void postCompact(ObserverContext<RegionCoprocessorEnvironment> e, Store store, StoreFile resultFile)
RegionObserver
postCompact
in interface RegionObserver
postCompact
in class BaseRegionObserver
e
- the environment provided by the region serverstore
- the store being compactedresultFile
- the new store file written out during compactionpublic void preFlush(ObserverContext<RegionCoprocessorEnvironment> e)
RegionObserver
preFlush
in interface RegionObserver
preFlush
in class BaseRegionObserver
e
- the environment provided by the region serverpublic void postFlush(ObserverContext<RegionCoprocessorEnvironment> e)
RegionObserver
postFlush
in interface RegionObserver
postFlush
in class BaseRegionObserver
e
- the environment provided by the region serverpublic void preSplit(ObserverContext<RegionCoprocessorEnvironment> e)
RegionObserver
preSplit
in interface RegionObserver
preSplit
in class BaseRegionObserver
e
- the environment provided by the region server
(e.getRegion() returns the parent region)public void preSplit(ObserverContext<RegionCoprocessorEnvironment> c, byte[] splitRow) throws IOException
RegionObserver
preSplit
in interface RegionObserver
preSplit
in class BaseRegionObserver
c
- the environment provided by the region server
(e.getRegion() returns the parent region)IOException
- if an error occurred on the coprocessorpublic void postSplit(ObserverContext<RegionCoprocessorEnvironment> e, Region l, Region r)
RegionObserver
postSplit
in interface RegionObserver
postSplit
in class BaseRegionObserver
e
- the environment provided by the region server
(e.getRegion() returns the parent region)l
- the left daughter regionr
- the right daughter regionpublic RegionScanner postScannerOpen(ObserverContext<RegionCoprocessorEnvironment> e, Scan scan, RegionScanner s) throws IOException
RegionObserver
Call CoprocessorEnvironment#complete to skip any subsequent chained coprocessors
postScannerOpen
in interface RegionObserver
postScannerOpen
in class BaseRegionObserver
e
- the environment provided by the region serverscan
- the Scan specifications
- if not null, the base scannerIOException
- if an error occurred on the coprocessor