Class TestWALEventTracker
java.lang.Object
org.apache.hadoop.hbase.namequeues.TestWALEventTracker
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final HBaseClassTestRulestatic org.apache.hadoop.conf.Configurationprivate static final org.slf4j.Loggerprivate static HBaseTestingUtility -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcheckWALRolledEventHasSize(List<org.apache.hadoop.hbase.namequeues.WALEventTrackerPayload> walEvents, String walName, long actualSize) private voidcompareEvents(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_NAMEprivate org.apache.hadoop.hbase.namequeues.WALEventTrackerPayloadgetPayload(List<org.apache.hadoop.hbase.Cell> cells) private List<org.apache.hadoop.hbase.namequeues.WALEventTrackerPayload>private intgetTableCount(org.apache.hadoop.hbase.client.Connection connection) static voidsetup()static voidteardown()voidprivate voidwaitForWALEventTrackerTable(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
-