Class TestWALObserver
java.lang.Object
org.apache.hadoop.hbase.coprocessor.TestWALObserver
@Tag("org.apache.hadoop.hbase.testclassification.CoprocessorTests") @Tag("org.apache.hadoop.hbase.testclassification.MediumTests")
public class TestWALObserver
extends Object
Tests invocation of the
MasterObserver interface
hooks at all appropriate times during normal HMaster operations.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.hadoop.conf.Configurationprivate Stringprivate org.apache.hadoop.fs.FileSystemprivate org.apache.hadoop.fs.Pathprivate org.apache.hadoop.fs.Pathprivate static final org.slf4j.Loggerprivate org.apache.hadoop.fs.Pathprivate org.apache.hadoop.fs.Pathprivate static byte[][]private static byte[][]private static byte[]private static byte[]private static final HBaseTestingUtilprivate static byte[][]private org.apache.hadoop.hbase.wal.WALFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddWALEdits(org.apache.hadoop.hbase.TableName tableName, org.apache.hadoop.hbase.client.RegionInfo hri, byte[] rowName, byte[] family, int count, org.apache.hadoop.hbase.util.EnvironmentEdge ee, org.apache.hadoop.hbase.wal.WAL wal, NavigableMap<byte[], Integer> scopes, org.apache.hadoop.hbase.regionserver.MultiVersionConcurrencyControl mvcc) private org.apache.hadoop.hbase.client.TableDescriptorcreateBasic3FamilyHTD(String tableName) private org.apache.hadoop.hbase.client.RegionInfocreateBasicHRegionInfo(String tableName) Creates an HRI around an HTD that hastableName.private org.apache.hadoop.hbase.client.PutcreatPutWith2Families(byte[] row) private voiddeleteDir(org.apache.hadoop.fs.Path p) private org.apache.hadoop.hbase.client.TableDescriptorgetBasic3FamilyHTableDescriptor(org.apache.hadoop.hbase.TableName tableName) private SampleRegionWALCoprocessorgetCoprocessor(org.apache.hadoop.hbase.wal.WAL wal, Class<? extends SampleRegionWALCoprocessor> clazz) private org.apache.hadoop.fs.PathrunWALSplit(org.apache.hadoop.conf.Configuration c) voidsetUp(org.junit.jupiter.api.TestInfo testInfo) static voidvoidtearDown()static voidvoidCoprocessors shouldn't get notice of empty waledits.voidTest WAL replay behavior with WALObserver.voidTest to see CP loaded successfully or not.voidvoidTest WAL write behavior with WALObserver.private voidverifyWritesSeen(org.apache.hadoop.hbase.wal.WAL log, SampleRegionWALCoprocessor cp, boolean seesLegacy)
-
Field Details
-
LOG
-
TEST_UTIL
-
TEST_TABLE
-
TEST_FAMILY
-
TEST_QUALIFIER
-
TEST_VALUE
-
TEST_ROW
-
currentTestName
-
conf
-
fs
-
hbaseRootDir
-
hbaseWALRootDir
-
oldLogDir
-
logDir
-
wals
-
-
Constructor Details
-
TestWALObserver
public TestWALObserver()
-
-
Method Details
-
setupBeforeClass
- Throws:
Exception
-
teardownAfterClass
- Throws:
Exception
-
setUp
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
testWALObserverWriteToWAL
Test WAL write behavior with WALObserver. The coprocessor monitors a WALEdit written to WAL, and ignore, modify, and add KeyValue's for the WALEdit.- Throws:
Exception
-
verifyWritesSeen
private void verifyWritesSeen(org.apache.hadoop.hbase.wal.WAL log, SampleRegionWALCoprocessor cp, boolean seesLegacy) throws Exception - Throws:
Exception
-
testEmptyWALEditAreNotSeen
Coprocessors shouldn't get notice of empty waledits.- Throws:
Exception
-
testWALCoprocessorReplay
Test WAL replay behavior with WALObserver.- Throws:
Exception
-
testWALObserverLoaded
Test to see CP loaded successfully or not. There is a duplication at TestHLog, but the purpose of that one is to see whether the loaded CP will impact existing WAL tests or not.- Throws:
Exception
-
testWALObserverRoll
- Throws:
Exception
-
getCoprocessor
private SampleRegionWALCoprocessor getCoprocessor(org.apache.hadoop.hbase.wal.WAL wal, Class<? extends SampleRegionWALCoprocessor> clazz) throws Exception - Throws:
Exception
-
createBasicHRegionInfo
Creates an HRI around an HTD that hastableName.- Parameters:
tableName- Name of table to use.
-
deleteDir
- Throws:
IOException
-
creatPutWith2Families
- Throws:
IOException
-
runWALSplit
private org.apache.hadoop.fs.Path runWALSplit(org.apache.hadoop.conf.Configuration c) throws IOException - Throws:
IOException
-
getBasic3FamilyHTableDescriptor
private org.apache.hadoop.hbase.client.TableDescriptor getBasic3FamilyHTableDescriptor(org.apache.hadoop.hbase.TableName tableName) -
createBasic3FamilyHTD
-