Class TestWALObserver
java.lang.Object
org.apache.hadoop.hbase.coprocessor.TestWALObserver
Tests invocation of the
MasterObserver
interface
hooks at all appropriate times during normal HMaster operations.-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
private org.apache.hadoop.conf.Configuration
org.junit.rules.TestName
private org.apache.hadoop.fs.FileSystem
private org.apache.hadoop.fs.Path
private org.apache.hadoop.fs.Path
private static final org.slf4j.Logger
private org.apache.hadoop.fs.Path
private org.apache.hadoop.fs.Path
private static byte[][]
private static byte[][]
private static byte[]
private static byte[]
private static final HBaseTestingUtil
private static byte[][]
private org.apache.hadoop.hbase.wal.WALFactory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
addWALEdits
(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.TableDescriptor
createBasic3FamilyHTD
(String tableName) private org.apache.hadoop.hbase.client.RegionInfo
createBasicHRegionInfo
(String tableName) Creates an HRI around an HTD that hastableName
.private org.apache.hadoop.hbase.client.Put
creatPutWith2Families
(byte[] row) private void
deleteDir
(org.apache.hadoop.fs.Path p) private org.apache.hadoop.hbase.client.TableDescriptor
getBasic3FamilyHTableDescriptor
(org.apache.hadoop.hbase.TableName tableName) private SampleRegionWALCoprocessor
getCoprocessor
(org.apache.hadoop.hbase.wal.WAL wal, Class<? extends SampleRegionWALCoprocessor> clazz) private org.apache.hadoop.fs.Path
runWALSplit
(org.apache.hadoop.conf.Configuration c) void
setUp()
static void
void
tearDown()
static void
void
Coprocessors shouldn't get notice of empty waledits.void
Test WAL replay behavior with WALObserver.void
Test to see CP loaded successfully or not.void
void
Test WAL write behavior with WALObserver.private void
verifyWritesSeen
(org.apache.hadoop.hbase.wal.WAL log, SampleRegionWALCoprocessor cp, boolean seesLegacy)
-
Field Details
-
CLASS_RULE
-
LOG
-
TEST_UTIL
-
TEST_TABLE
-
TEST_FAMILY
-
TEST_QUALIFIER
-
TEST_VALUE
-
TEST_ROW
-
currentTest
-
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
-