@InterfaceAudience.Private public class ConstraintProcessor extends Object implements RegionCoprocessor, RegionObserver
Constraints on a given table.
This is an ease of use mechanism - all the functionality here could be implemented on any given system by a coprocessor.
Coprocessor.StateRegionObserver.MutationType| Modifier and Type | Field and Description |
|---|---|
private ClassLoader |
classloader |
private List<? extends Constraint> |
constraints |
private static org.slf4j.Logger |
LOG |
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION| Constructor and Description |
|---|
ConstraintProcessor()
Create the constraint processor.
|
| Modifier and Type | Method and Description |
|---|---|
Optional<RegionObserver> |
getRegionObserver() |
boolean |
postScannerFilterRow(ObserverContext<RegionCoprocessorEnvironment> e,
InternalScanner s,
Cell curRowCell,
boolean hasMore)
This will be called by the scan flow when the current scanned row is being filtered out by the
filter.
|
void |
prePut(ObserverContext<RegionCoprocessorEnvironment> e,
Put put,
WALEdit edit,
Durability durability)
Called before the client stores a value.
|
void |
start(CoprocessorEnvironment environment)
Called by the
CoprocessorEnvironment during it's own startup to initialize the
coprocessor. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetBulkLoadObserver, getEndpointObservergetServices, stoppostAppend, postAppendBeforeWAL, postBatchMutate, postBatchMutateIndispensably, postBulkLoadHFile, postCheckAndDelete, postCheckAndDelete, postCheckAndPut, postCheckAndPut, postClose, postCloseRegionOperation, postCommitStoreFile, postCompact, postCompactSelection, postDelete, postExists, postFlush, postFlush, postGetOp, postIncrement, postIncrementBeforeWAL, postInstantiateDeleteTracker, postMemStoreCompaction, postMutationBeforeWAL, postOpen, postPut, postReplayWALs, postScannerClose, 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, preGetOp, preIncrement, preIncrementAfterRowLock, preMemStoreCompaction, preMemStoreCompactionCompact, preMemStoreCompactionCompactScannerOpen, preOpen, prePrepareTimeStampForDeleteVersion, preReplayWALs, preScannerClose, preScannerNext, preScannerOpen, preStoreFileReaderOpen, preStoreScannerOpen, preWALAppend, preWALRestoreprivate static final org.slf4j.Logger LOG
private final ClassLoader classloader
private List<? extends Constraint> constraints
public ConstraintProcessor()
Stores the current classloader.
public Optional<RegionObserver> getRegionObserver()
getRegionObserver in interface RegionCoprocessorpublic void start(CoprocessorEnvironment environment)
CoprocessorCoprocessorEnvironment during it's own startup to initialize the
coprocessor.start in interface Coprocessorpublic void prePut(ObserverContext<RegionCoprocessorEnvironment> e, Put put, WALEdit edit, Durability durability) throws IOException
RegionObserverCall CoprocessorEnvironment#bypass to skip default actions. If 'bypass' is set, we skip out on calling any subsequent chained coprocessors.
Note: Do not retain references to any Cells in 'put' beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
prePut in interface RegionObservere - the environment provided by the region serverput - The Put objectedit - The WALEdit object that will be written to the waldurability - Persistence guarantee for this PutIOExceptionpublic boolean postScannerFilterRow(ObserverContext<RegionCoprocessorEnvironment> e, InternalScanner s, Cell curRowCell, boolean hasMore) throws IOException
RegionObserverboolean filterRowKey(byte [] buffer, int offset, int length) returning trueboolean filterRow() returning truedefault void filterRow(List<KeyValue> kvs) removing all the kvs from
the passed ListNote: Do not retain references to any Cells returned by scanner, beyond the life of this invocation. If need a Cell reference for later use, copy the cell and use that.
postScannerFilterRow in interface RegionObservere - the environment provided by the region servers - the scannercurRowCell - The cell in the current row which got filtered outhasMore - the 'has more' indicationIOExceptionCopyright © 2007–2020 The Apache Software Foundation. All rights reserved.