public class TestWALObserver extends Object
MasterObserver
interface hooks at
all appropriate times during normal HMaster operations.Modifier and Type | Field and Description |
---|---|
static HBaseClassTestRule |
CLASS_RULE |
private org.apache.hadoop.conf.Configuration |
conf |
org.junit.rules.TestName |
currentTest |
private org.apache.hadoop.fs.FileSystem |
fs |
private org.apache.hadoop.fs.Path |
hbaseRootDir |
private org.apache.hadoop.fs.Path |
hbaseWALRootDir |
private static org.slf4j.Logger |
LOG |
private org.apache.hadoop.fs.Path |
logDir |
private org.apache.hadoop.fs.Path |
oldLogDir |
private static byte[][] |
TEST_FAMILY |
private static byte[][] |
TEST_QUALIFIER |
private static byte[] |
TEST_ROW |
private static byte[] |
TEST_TABLE |
private static HBaseTestingUtility |
TEST_UTIL |
private static byte[][] |
TEST_VALUE |
private org.apache.hadoop.hbase.wal.WALFactory |
wals |
Constructor and Description |
---|
TestWALObserver() |
Modifier and Type | Method and Description |
---|---|
private 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 has
tableName . |
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 |
setupBeforeClass() |
void |
tearDown() |
static void |
teardownAfterClass() |
void |
testEmptyWALEditAreNotSeen()
Coprocessors shouldn't get notice of empty waledits.
|
void |
testWALCoprocessorReplay()
Test WAL replay behavior with WALObserver.
|
void |
testWALObserverLoaded()
Test to see CP loaded successfully or not.
|
void |
testWALObserverRoll() |
void |
testWALObserverWriteToWAL()
Test WAL write behavior with WALObserver.
|
private void |
verifyWritesSeen(org.apache.hadoop.hbase.wal.WAL log,
SampleRegionWALCoprocessor cp,
boolean seesLegacy) |
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private static final HBaseTestingUtility TEST_UTIL
private static byte[] TEST_TABLE
private static byte[][] TEST_FAMILY
private static byte[][] TEST_QUALIFIER
private static byte[][] TEST_VALUE
private static byte[] TEST_ROW
public org.junit.rules.TestName currentTest
private org.apache.hadoop.conf.Configuration conf
private org.apache.hadoop.fs.FileSystem fs
private org.apache.hadoop.fs.Path hbaseRootDir
private org.apache.hadoop.fs.Path hbaseWALRootDir
private org.apache.hadoop.fs.Path oldLogDir
private org.apache.hadoop.fs.Path logDir
private org.apache.hadoop.hbase.wal.WALFactory wals
public TestWALObserver()
public static void setupBeforeClass() throws Exception
Exception
public static void teardownAfterClass() throws Exception
Exception
public void testWALObserverWriteToWAL() throws Exception
Exception
private void verifyWritesSeen(org.apache.hadoop.hbase.wal.WAL log, SampleRegionWALCoprocessor cp, boolean seesLegacy) throws Exception
Exception
public void testEmptyWALEditAreNotSeen() throws Exception
Exception
public void testWALCoprocessorReplay() throws Exception
Exception
public void testWALObserverLoaded() throws Exception
Exception
public void testWALObserverRoll() throws Exception
Exception
private SampleRegionWALCoprocessor getCoprocessor(org.apache.hadoop.hbase.wal.WAL wal, Class<? extends SampleRegionWALCoprocessor> clazz) throws Exception
Exception
private org.apache.hadoop.hbase.client.RegionInfo createBasicHRegionInfo(String tableName)
tableName
.tableName
- Name of table to use.private void deleteDir(org.apache.hadoop.fs.Path p) throws IOException
IOException
private org.apache.hadoop.hbase.client.Put creatPutWith2Families(byte[] row) throws IOException
IOException
private org.apache.hadoop.fs.Path runWALSplit(org.apache.hadoop.conf.Configuration c) throws IOException
IOException
private 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) throws IOException
IOException
private org.apache.hadoop.hbase.client.TableDescriptor getBasic3FamilyHTableDescriptor(org.apache.hadoop.hbase.TableName tableName)
private org.apache.hadoop.hbase.client.TableDescriptor createBasic3FamilyHTD(String tableName)
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.