Class TestWALEventTracker

java.lang.Object
org.apache.hadoop.hbase.namequeues.TestWALEventTracker

public class TestWALEventTracker extends Object
  • Field Details

  • Constructor Details

  • Method Details

    • setup

      public static void setup() throws Exception
      Throws:
      Exception
    • teardown

      public static void teardown() throws Exception
      Throws:
      Exception
    • waitForWalEventTrackerTableCreation

    • testWALRolling

      public void testWALRolling() throws Exception
      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 - hostname
      walName - walname
      walEvents - event from table
      expectedStates - expected states for the hostname and wal name
      strict - 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

      private int getTableCount(org.apache.hadoop.hbase.client.Connection connection) throws Exception
      Throws:
      Exception