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.State
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.coprocessor.RegionObserver
org.apache.hadoop.hbase.coprocessor.RegionObserver.MutationType
-
Field Summary
Modifier and TypeFieldDescriptionprivate byte[]
private byte[]
private byte[]
private byte[]
private byte[]
private byte[]
private static final org.slf4j.Logger
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private byte[]
private byte[]
Fields inherited from interface org.apache.hadoop.hbase.Coprocessor
PRIORITY_HIGHEST, PRIORITY_LOWEST, PRIORITY_SYSTEM, PRIORITY_USER, VERSION
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionOptional<org.apache.hadoop.hbase.coprocessor.RegionObserver>
Optional<org.apache.hadoop.hbase.coprocessor.WALObserver>
boolean
boolean
boolean
boolean
boolean
boolean
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) Triggered afterHRegion
when WAL is Restoreed.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) 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) 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) Triggered beforeHRegion
when WAL is Restoreed.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) 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) 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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.hadoop.hbase.Coprocessor
getServices, start, stop
Methods inherited from interface org.apache.hadoop.hbase.coprocessor.RegionCoprocessor
getBulkLoadObserver, getEndpointObserver
Methods 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:
getWALObserver
in interfaceorg.apache.hadoop.hbase.coprocessor.WALCoprocessor
-
getRegionObserver
- Specified by:
getRegionObserver
in 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:
postWALWrite
in 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:
preWALWrite
in 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 beforeHRegion
when WAL is Restoreed.- Specified by:
preWALRestore
in 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:
preWALRoll
in 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:
postWALRoll
in 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 afterHRegion
when WAL is Restoreed.- Specified by:
postWALRestore
in interfaceorg.apache.hadoop.hbase.coprocessor.RegionObserver
- Throws:
IOException
-
isPreWALWriteCalled
-
isPostWALWriteCalled
-
isPreWALRestoreCalled
-
isPostWALRestoreCalled
-
isPreWALRollCalled
-
isPostWALRollCalled
-