Class TestWALEventTracker
java.lang.Object
org.apache.hadoop.hbase.namequeues.TestWALEventTracker
-
Field Summary
Modifier and TypeFieldDescriptionstatic final HBaseClassTestRule
static org.apache.hadoop.conf.Configuration
private static final org.slf4j.Logger
private static HBaseTestingUtility
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate 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>
private int
getTableCount
(org.apache.hadoop.hbase.client.Connection connection) static void
setup()
static void
teardown()
void
private void
waitForWALEventTrackerTable
(org.apache.hadoop.hbase.client.Connection connection) void
-
Field Details
-
CLASS_RULE
-
LOG
-
TEST_UTIL
-
CONF
-
-
Constructor Details
-
TestWALEventTracker
public TestWALEventTracker()
-
-
Method Details
-
setup
- Throws:
Exception
-
teardown
- Throws:
Exception
-
waitForWalEventTrackerTableCreation
-
testWALRolling
- Throws:
Exception
-
checkWALRolledEventHasSize
private void checkWALRolledEventHasSize(List<org.apache.hadoop.hbase.namequeues.WALEventTrackerPayload> walEvents, String walName, long actualSize) -
compareEvents
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
- Parameters:
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.
-
waitForWALEventTrackerTable
private void waitForWALEventTrackerTable(org.apache.hadoop.hbase.client.Connection connection) throws IOException - Throws:
IOException
-
getRows
private List<org.apache.hadoop.hbase.namequeues.WALEventTrackerPayload> getRows(String rowKeyPrefix, org.apache.hadoop.hbase.client.Connection connection) throws IOException - Throws:
IOException
-
getPayload
private org.apache.hadoop.hbase.namequeues.WALEventTrackerPayload getPayload(List<org.apache.hadoop.hbase.Cell> cells) -
getTableCount
- Throws:
Exception
-