public class WriteSinkCoprocessor extends BaseRegionObserver
This coprocessor 'shallows' all the writes. It allows to test a pure write workload, going through all the communication layers. The reads will work as well, but they as we never write, they will always always return an empty structure. The WAL is also skipped. Obviously, the region will never be split automatically. It's up to the user to split and move it.
For a table created like this: create 'usertable', {NAME => 'f1', VERSIONS => 1}
You can then add the coprocessor with this command: alter 'usertable', 'coprocessor' => '|org.apache.hadoop.hbase.tool.WriteSinkCoprocessor|'
And then put 'usertable', 'f1', 'f1', 'f1'
scan 'usertable' Will return: 0 row(s) in 0.0050 seconds
RegionObserver.MutationTypeCoprocessor.StatePRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION| Constructor and Description |
|---|
WriteSinkCoprocessor() |
| Modifier and Type | Method and Description |
|---|---|
void |
preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c,
MiniBatchOperationInProgress<Mutation> miniBatchOp)
This will be called for every batch mutation operation happening at the server.
|
void |
preOpen(ObserverContext<RegionCoprocessorEnvironment> e)
Called before the region is reported as open to the master.
|
postAppend, postBatchMutate, postBatchMutateIndispensably, postBulkLoadHFile, postCheckAndDelete, postCheckAndPut, postClose, postCloseRegionOperation, postCommitStoreFile, postCompact, postCompact, postCompactSelection, postCompactSelection, postCompleteSplit, postDelete, postExists, postFlush, postFlush, postGetClosestRowBefore, postGetOp, postIncrement, postIncrementColumnValue, postInstantiateDeleteTracker, postLogReplay, postMutationBeforeWAL, postOpen, postPut, postRollBackSplit, postScannerClose, postScannerFilterRow, postScannerNext, postScannerOpen, postSplit, postStartRegionOperation, postStoreFileReaderOpen, postWALRestore, postWALRestore, preAppend, preAppendAfterRowLock, preBulkLoadHFile, preCheckAndDelete, preCheckAndDeleteAfterRowLock, preCheckAndPut, preCheckAndPutAfterRowLock, preClose, preCommitStoreFile, preCompact, preCompact, preCompactScannerOpen, preCompactScannerOpen, preCompactScannerOpen, preCompactSelection, preCompactSelection, preDelete, preExists, preFlush, preFlush, preFlushScannerOpen, preFlushScannerOpen, preGetClosestRowBefore, preGetOp, preIncrement, preIncrementAfterRowLock, preIncrementColumnValue, prePrepareTimeStampForDeleteVersion, prePut, preRollBackSplit, preScannerClose, preScannerNext, preScannerOpen, preSplit, preSplit, preSplitAfterPONR, preSplitBeforePONR, preStoreFileReaderOpen, preStoreScannerOpen, preWALRestore, preWALRestore, start, stoppublic void preOpen(ObserverContext<RegionCoprocessorEnvironment> e) throws IOException
RegionObserverpreOpen in interface RegionObserverpreOpen in class BaseRegionObservere - the environment provided by the region serverIOException - if an error occurred on the coprocessorpublic void preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c, MiniBatchOperationInProgress<Mutation> miniBatchOp) throws IOException
RegionObserverMiniBatchOperationInProgress.setOperationStatus(int, OperationStatus)),
RegionObserver can make Region to skip these Mutations.preBatchMutate in interface RegionObserverpreBatchMutate in class BaseRegionObserverc - the environment provided by the region serverminiBatchOp - batch of Mutations getting applied to region.IOException - if an error occurred on the coprocessorCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.