class ExampleRegionObserverWithMetrics.ExampleRegionObserver extends Object implements RegionCoprocessor, RegionObserver
Coprocessor.State
RegionObserver.MutationType
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION
Constructor and Description |
---|
ExampleRegionObserver() |
Modifier and Type | Method and Description |
---|---|
Optional<RegionObserver> |
getRegionObserver() |
private void |
performCostlyOperation() |
void |
postCompactSelection(ObserverContext<RegionCoprocessorEnvironment> c,
Store store,
List<? extends StoreFile> selected,
CompactionLifeCycleTracker tracker,
CompactionRequest request)
Called after the
StoreFile s to compact have been selected from the available
candidates. |
void |
postFlush(ObserverContext<RegionCoprocessorEnvironment> c,
FlushLifeCycleTracker tracker)
Called after the memstore is flushed to disk.
|
void |
postFlush(ObserverContext<RegionCoprocessorEnvironment> c,
Store store,
StoreFile resultFile,
FlushLifeCycleTracker tracker)
Called after a Store's memstore is flushed to disk.
|
void |
postGetOp(ObserverContext<RegionCoprocessorEnvironment> e,
Get get,
List<Cell> results)
Called after the client performs a Get
|
void |
preGetOp(ObserverContext<RegionCoprocessorEnvironment> e,
Get get,
List<Cell> results)
Called before the client performs a Get
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBulkLoadObserver, getEndpointObserver
getServices, start, stop
postAppend, postAppendBeforeWAL, postBatchMutate, postBatchMutateIndispensably, postBulkLoadHFile, postCheckAndDelete, postCheckAndDelete, postCheckAndPut, postCheckAndPut, postClose, postCloseRegionOperation, postCommitStoreFile, postCompact, postDelete, postExists, postIncrement, postIncrementBeforeWAL, postInstantiateDeleteTracker, postMemStoreCompaction, postMutationBeforeWAL, postOpen, postPut, postReplayWALs, postScannerClose, postScannerFilterRow, postScannerNext, postScannerOpen, postStartRegionOperation, postStoreFileReaderOpen, postWALRestore, preAppend, preAppendAfterRowLock, preBatchMutate, preBulkLoadHFile, preCheckAndDelete, preCheckAndDelete, preCheckAndDeleteAfterRowLock, preCheckAndDeleteAfterRowLock, preCheckAndPut, preCheckAndPut, preCheckAndPutAfterRowLock, preCheckAndPutAfterRowLock, preClose, preCommitStoreFile, preCompact, preCompactScannerOpen, preCompactSelection, preDelete, preExists, preFlush, preFlush, preFlushScannerOpen, preIncrement, preIncrementAfterRowLock, preMemStoreCompaction, preMemStoreCompactionCompact, preMemStoreCompactionCompactScannerOpen, preOpen, prePrepareTimeStampForDeleteVersion, prePut, preReplayWALs, preScannerClose, preScannerNext, preScannerOpen, preStoreFileReaderOpen, preStoreScannerOpen, preWALAppend, preWALRestore
ExampleRegionObserver()
public Optional<RegionObserver> getRegionObserver()
getRegionObserver
in interface RegionCoprocessor
public void preGetOp(ObserverContext<RegionCoprocessorEnvironment> e, Get get, List<Cell> results) throws IOException
RegionObserver
Call CoprocessorEnvironment#bypass to skip default actions. If 'bypass' is set, we skip out on calling any subsequent chained coprocessors.
preGetOp
in interface RegionObserver
e
- the environment provided by the region serverget
- the Get requestresults
- The result to return to the client if default processing
is bypassed. Can be modified. Will not be used if default processing
is not bypassed.IOException
public void postGetOp(ObserverContext<RegionCoprocessorEnvironment> e, Get get, List<Cell> results) throws IOException
RegionObserver
Note: Do not retain references to any Cells in 'result' beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
postGetOp
in interface RegionObserver
e
- the environment provided by the region serverget
- the Get requestresults
- the result to return to the client, modify as necessaryIOException
public void postFlush(ObserverContext<RegionCoprocessorEnvironment> c, FlushLifeCycleTracker tracker) throws IOException
RegionObserver
postFlush
in interface RegionObserver
c
- the environment provided by the region servertracker
- tracker used to track the life cycle of a flushIOException
- if an error occurred on the coprocessorpublic void postFlush(ObserverContext<RegionCoprocessorEnvironment> c, Store store, StoreFile resultFile, FlushLifeCycleTracker tracker) throws IOException
RegionObserver
postFlush
in interface RegionObserver
c
- the environment provided by the region serverstore
- the store being flushedresultFile
- the new store file written out during compactiontracker
- tracker used to track the life cycle of a flushIOException
public void postCompactSelection(ObserverContext<RegionCoprocessorEnvironment> c, Store store, List<? extends StoreFile> selected, CompactionLifeCycleTracker tracker, CompactionRequest request)
RegionObserver
StoreFile
s to compact have been selected from the available
candidates.postCompactSelection
in interface RegionObserver
c
- the environment provided by the region serverstore
- the store being compactedselected
- the store files selected to compacttracker
- tracker used to track the life cycle of a compactionrequest
- the requested compactionprivate void performCostlyOperation()
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.