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.MutationType
Coprocessor.State
Modifier and Type | Field and Description |
---|---|
private static org.apache.commons.logging.Log |
LOG |
private AtomicLong |
ops |
private String |
regionName |
PRIORITY_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, 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, preCompact, preCompact, preCompactScannerOpen, preCompactScannerOpen, preCompactSelection, preCompactSelection, preDelete, preExists, preFlush, preFlush, preFlushScannerOpen, preGetClosestRowBefore, preGetOp, preIncrement, preIncrementAfterRowLock, preIncrementColumnValue, prePrepareTimeStampForDeleteVersion, prePut, preRollBackSplit, preScannerClose, preScannerNext, preScannerOpen, preSplit, preSplit, preSplitAfterPONR, preSplitBeforePONR, preStoreFileReaderOpen, preStoreScannerOpen, preWALRestore, preWALRestore, start, stop
private static final org.apache.commons.logging.Log LOG
private final AtomicLong ops
private String regionName
public void preOpen(ObserverContext<RegionCoprocessorEnvironment> e) throws IOException
RegionObserver
preOpen
in interface RegionObserver
preOpen
in class BaseRegionObserver
e
- the environment provided by the region serverIOException
- if an error occurred on the coprocessorpublic void preBatchMutate(ObserverContext<RegionCoprocessorEnvironment> c, MiniBatchOperationInProgress<Mutation> miniBatchOp) throws IOException
RegionObserver
MiniBatchOperationInProgress.setOperationStatus(int, OperationStatus)
),
RegionObserver
can make Region to skip these Mutations.preBatchMutate
in interface RegionObserver
preBatchMutate
in class BaseRegionObserver
c
- 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.