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
postReplayWALs
(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment> ctx, org.apache.hadoop.hbase.client.RegionInfo info, org.apache.hadoop.fs.Path edits) 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
preReplayWALs
(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment> ctx, org.apache.hadoop.hbase.client.RegionInfo info, org.apache.hadoop.fs.Path edits) 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, 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, preScannerClose, preScannerNext, preScannerOpen, preStoreFileReaderOpen, preStoreScannerOpen, preWALAppend
-
Field Details
-
LOG
-
tableName
-
row
-
ignoredFamily
-
ignoredQualifier
-
addedFamily
-
addedQualifier
-
changedFamily
-
changedQualifier
-
preWALWriteCalled
-
postWALWriteCalled
-
preWALRollCalled
-
postWALRollCalled
-
preReplayWALsCalled
-
postReplayWALsCalled
-
-
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
-
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
-
preReplayWALs
public void preReplayWALs(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment> ctx, org.apache.hadoop.hbase.client.RegionInfo info, org.apache.hadoop.fs.Path edits) throws IOException - Specified by:
preReplayWALs
in interfaceorg.apache.hadoop.hbase.coprocessor.RegionObserver
- Throws:
IOException
-
postReplayWALs
public void postReplayWALs(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment> ctx, org.apache.hadoop.hbase.client.RegionInfo info, org.apache.hadoop.fs.Path edits) throws IOException - Specified by:
postReplayWALs
in interfaceorg.apache.hadoop.hbase.coprocessor.RegionObserver
- Throws:
IOException
-
isPreWALWriteCalled
-
isPostWALWriteCalled
-
isPreWALRollCalled
-
isPostWALRollCalled
-
isPreReplayWALsCalled
-
isPostReplayWALsCalled
-