Class SampleRegionWALCoprocessor
java.lang.Object
org.apache.hadoop.hbase.coprocessor.SampleRegionWALCoprocessor
- All Implemented Interfaces:
org.apache.hadoop.hbase.Coprocessor,org.apache.hadoop.hbase.coprocessor.RegionCoprocessor,org.apache.hadoop.hbase.coprocessor.RegionObserver,org.apache.hadoop.hbase.coprocessor.WALCoprocessor,org.apache.hadoop.hbase.coprocessor.WALObserver
public class SampleRegionWALCoprocessor
extends Object
implements org.apache.hadoop.hbase.coprocessor.WALCoprocessor, org.apache.hadoop.hbase.coprocessor.RegionCoprocessor, org.apache.hadoop.hbase.coprocessor.WALObserver, org.apache.hadoop.hbase.coprocessor.RegionObserver
Class for testing WALObserver coprocessor. It will monitor WAL writing and restoring, and modify
passed-in WALEdit, i.e, ignore specified columns when writing, or add a KeyValue. On the other
side, it checks whether the ignored column is still in WAL when Restoreed at region reconstruct.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.Coprocessor
org.apache.hadoop.hbase.Coprocessor.StateNested classes/interfaces inherited from interface org.apache.hadoop.hbase.coprocessor.RegionObserver
org.apache.hadoop.hbase.coprocessor.RegionObserver.MutationType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]private byte[]private byte[]private byte[]private byte[]private byte[]private static final org.slf4j.Loggerprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate byte[]private byte[]Fields inherited from interface org.apache.hadoop.hbase.Coprocessor
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOptional<org.apache.hadoop.hbase.coprocessor.RegionObserver>Optional<org.apache.hadoop.hbase.coprocessor.WALObserver>booleanbooleanbooleanbooleanbooleanbooleanvoidpostWALRestore(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment> env, org.apache.hadoop.hbase.client.RegionInfo info, org.apache.hadoop.hbase.wal.WALKey logKey, org.apache.hadoop.hbase.wal.WALEdit logEdit) Triggered afterHRegionwhen WAL is Restoreed.voidpostWALRoll(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.WALCoprocessorEnvironment> ctx, org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath) voidpostWALWrite(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.WALCoprocessorEnvironment> env, org.apache.hadoop.hbase.client.RegionInfo info, org.apache.hadoop.hbase.wal.WALKey logKey, org.apache.hadoop.hbase.wal.WALEdit logEdit) voidpreWALRestore(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment> env, org.apache.hadoop.hbase.client.RegionInfo info, org.apache.hadoop.hbase.wal.WALKey logKey, org.apache.hadoop.hbase.wal.WALEdit logEdit) Triggered beforeHRegionwhen WAL is Restoreed.voidpreWALRoll(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.WALCoprocessorEnvironment> ctx, org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath) voidpreWALWrite(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.WALCoprocessorEnvironment> env, org.apache.hadoop.hbase.client.RegionInfo info, org.apache.hadoop.hbase.wal.WALKey logKey, org.apache.hadoop.hbase.wal.WALEdit logEdit) voidsetTestValues(byte[] tableName, byte[] row, byte[] igf, byte[] igq, byte[] chf, byte[] chq, byte[] addf, byte[] addq) Set values: with a table name, a column name which will be ignored, and a column name which will be added to WAL.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.hbase.Coprocessor
getServices, start, stopMethods inherited from interface org.apache.hadoop.hbase.coprocessor.RegionCoprocessor
getBulkLoadObserver, getEndpointObserverMethods inherited from interface org.apache.hadoop.hbase.coprocessor.RegionObserver
postAppend, postAppend, postAppendBeforeWAL, postBatchMutate, postBatchMutateIndispensably, postBulkLoadHFile, postCheckAndDelete, postCheckAndDelete, postCheckAndMutate, postCheckAndPut, postCheckAndPut, postClose, postCloseRegionOperation, postCommitStoreFile, postCompact, postCompactSelection, postDelete, postDelete, postExists, postFlush, postFlush, postGetOp, postIncrement, postIncrement, postIncrementBeforeWAL, postInstantiateDeleteTracker, postMemStoreCompaction, postMutationBeforeWAL, postOpen, postPut, postPut, postReplayWALs, postScannerClose, postScannerFilterRow, postScannerNext, postScannerOpen, postStartRegionOperation, postStoreFileReaderOpen, preAppend, preAppend, preAppendAfterRowLock, preBatchMutate, preBulkLoadHFile, preCheckAndDelete, preCheckAndDelete, preCheckAndDeleteAfterRowLock, preCheckAndDeleteAfterRowLock, preCheckAndMutate, preCheckAndMutateAfterRowLock, preCheckAndPut, preCheckAndPut, preCheckAndPutAfterRowLock, preCheckAndPutAfterRowLock, preClose, preCommitStoreFile, preCompact, preCompactScannerOpen, preCompactSelection, preDelete, preDelete, preExists, preFlush, preFlush, preFlushScannerOpen, preGetOp, preIncrement, preIncrement, preIncrementAfterRowLock, preMemStoreCompaction, preMemStoreCompactionCompact, preMemStoreCompactionCompactScannerOpen, preOpen, prePrepareTimeStampForDeleteVersion, prePut, prePut, preReplayWALs, preScannerClose, preScannerNext, preScannerOpen, preStoreFileReaderOpen, preStoreScannerOpen, preWALAppend
-
Field Details
-
LOG
-
tableName
-
row
-
ignoredFamily
-
ignoredQualifier
-
addedFamily
-
addedQualifier
-
changedFamily
-
changedQualifier
-
preWALWriteCalled
-
postWALWriteCalled
-
preWALRestoreCalled
-
postWALRestoreCalled
-
preWALRollCalled
-
postWALRollCalled
-
-
Constructor Details
-
SampleRegionWALCoprocessor
public SampleRegionWALCoprocessor()
-
-
Method Details
-
setTestValues
public void setTestValues(byte[] tableName, byte[] row, byte[] igf, byte[] igq, byte[] chf, byte[] chq, byte[] addf, byte[] addq) Set values: with a table name, a column name which will be ignored, and a column name which will be added to WAL. -
getWALObserver
- Specified by:
getWALObserverin interfaceorg.apache.hadoop.hbase.coprocessor.WALCoprocessor
-
getRegionObserver
- Specified by:
getRegionObserverin interfaceorg.apache.hadoop.hbase.coprocessor.RegionCoprocessor
-
postWALWrite
public void postWALWrite(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.WALCoprocessorEnvironment> env, org.apache.hadoop.hbase.client.RegionInfo info, org.apache.hadoop.hbase.wal.WALKey logKey, org.apache.hadoop.hbase.wal.WALEdit logEdit) throws IOException - Specified by:
postWALWritein interfaceorg.apache.hadoop.hbase.coprocessor.WALObserver- Throws:
IOException
-
preWALWrite
public void preWALWrite(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.WALCoprocessorEnvironment> env, org.apache.hadoop.hbase.client.RegionInfo info, org.apache.hadoop.hbase.wal.WALKey logKey, org.apache.hadoop.hbase.wal.WALEdit logEdit) throws IOException - Specified by:
preWALWritein interfaceorg.apache.hadoop.hbase.coprocessor.WALObserver- Throws:
IOException
-
preWALRestore
public void preWALRestore(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment> env, org.apache.hadoop.hbase.client.RegionInfo info, org.apache.hadoop.hbase.wal.WALKey logKey, org.apache.hadoop.hbase.wal.WALEdit logEdit) throws IOException Triggered beforeHRegionwhen WAL is Restoreed.- Specified by:
preWALRestorein interfaceorg.apache.hadoop.hbase.coprocessor.RegionObserver- Throws:
IOException
-
preWALRoll
public void preWALRoll(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.WALCoprocessorEnvironment> ctx, org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath) throws IOException - Specified by:
preWALRollin interfaceorg.apache.hadoop.hbase.coprocessor.WALObserver- Throws:
IOException
-
postWALRoll
public void postWALRoll(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.WALCoprocessorEnvironment> ctx, org.apache.hadoop.fs.Path oldPath, org.apache.hadoop.fs.Path newPath) throws IOException - Specified by:
postWALRollin interfaceorg.apache.hadoop.hbase.coprocessor.WALObserver- Throws:
IOException
-
postWALRestore
public void postWALRestore(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment> env, org.apache.hadoop.hbase.client.RegionInfo info, org.apache.hadoop.hbase.wal.WALKey logKey, org.apache.hadoop.hbase.wal.WALEdit logEdit) throws IOException Triggered afterHRegionwhen WAL is Restoreed.- Specified by:
postWALRestorein interfaceorg.apache.hadoop.hbase.coprocessor.RegionObserver- Throws:
IOException
-
isPreWALWriteCalled
-
isPostWALWriteCalled
-
isPreWALRestoreCalled
-
isPostWALRestoreCalled
-
isPreWALRollCalled
-
isPostWALRollCalled
-