public class TestWALEventTracker extends Object
Modifier and Type | Field and Description |
---|---|
static HBaseClassTestRule |
CLASS_RULE |
static org.apache.hadoop.conf.Configuration |
CONF |
private static org.slf4j.Logger |
LOG |
private static HBaseTestingUtil |
TEST_UTIL |
Constructor and Description |
---|
TestWALEventTracker() |
Modifier and Type | Method and Description |
---|---|
private void |
checkWALRolledEventHasSize(List<org.apache.hadoop.hbase.namequeues.WALEventTrackerPayload> walEvents,
String walName,
long actualSize) |
private void |
compareEvents(String hostName,
String walName,
List<org.apache.hadoop.hbase.namequeues.WALEventTrackerPayload> walEvents,
List<String> expectedStates,
boolean strict)
Compare the events from @
WALEventTrackerTableAccessor.WAL_EVENT_TRACKER_TABLE_NAME |
private org.apache.hadoop.hbase.namequeues.WALEventTrackerPayload |
getPayload(List<org.apache.hadoop.hbase.Cell> cells) |
private List<org.apache.hadoop.hbase.namequeues.WALEventTrackerPayload> |
getRows(String rowKeyPrefix,
org.apache.hadoop.hbase.client.Connection connection) |
private int |
getTableCount(org.apache.hadoop.hbase.client.Connection connection) |
static void |
setup() |
static void |
teardown() |
void |
testWALRolling() |
private void |
waitForWALEventTrackerTable(org.apache.hadoop.hbase.client.Connection connection) |
void |
waitForWalEventTrackerTableCreation() |
public static final HBaseClassTestRule CLASS_RULE
private static final org.slf4j.Logger LOG
private static HBaseTestingUtil TEST_UTIL
public static org.apache.hadoop.conf.Configuration CONF
public TestWALEventTracker()
public void waitForWalEventTrackerTableCreation()
public void testWALRolling() throws Exception
Exception
private void checkWALRolledEventHasSize(List<org.apache.hadoop.hbase.namequeues.WALEventTrackerPayload> walEvents, String walName, long actualSize)
private void compareEvents(String hostName, String walName, List<org.apache.hadoop.hbase.namequeues.WALEventTrackerPayload> walEvents, List<String> expectedStates, boolean strict)
WALEventTrackerTableAccessor.WAL_EVENT_TRACKER_TABLE_NAME
hostName
- hostnamewalName
- walnamewalEvents
- event from tableexpectedStates
- expected states for the hostname and wal namestrict
- whether to check strictly or not. Sometimes we lose the ACTIVE state
event for the first wal since it takes some time for hmaster to create
the table and by that time RS already creates the first WAL and will try
to persist ACTIVE event to waleventtracker table.private void waitForWALEventTrackerTable(org.apache.hadoop.hbase.client.Connection connection) throws IOException
IOException
private List<org.apache.hadoop.hbase.namequeues.WALEventTrackerPayload> getRows(String rowKeyPrefix, org.apache.hadoop.hbase.client.Connection connection) throws IOException
IOException
private org.apache.hadoop.hbase.namequeues.WALEventTrackerPayload getPayload(List<org.apache.hadoop.hbase.Cell> cells)
private int getTableCount(org.apache.hadoop.hbase.client.Connection connection) throws Exception
Exception
Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.