Search in sources :

Example 1 with ProcedureStoreTracker

use of org.apache.hadoop.hbase.procedure2.store.ProcedureStoreTracker in project hbase by apache.

the class TestWALProcedureStore method trackersLoadedForAllOldLogs.

/**
   * Tests that tracker for all old logs are loaded back after procedure store is restarted.
   */
@Test
public void trackersLoadedForAllOldLogs() throws Exception {
    for (int i = 0; i <= 20; ++i) {
        procStore.insert(new TestProcedure(i), null);
        if (i > 0 && (i % 5) == 0) {
            LoadCounter loader = new LoadCounter();
            storeRestart(loader);
        }
    }
    assertEquals(5, procStore.getActiveLogs().size());
    for (int i = 0; i < procStore.getActiveLogs().size() - 1; ++i) {
        ProcedureStoreTracker tracker = procStore.getActiveLogs().get(i).getTracker();
        assertTrue(tracker != null && !tracker.isEmpty());
    }
}
Also used : TestProcedure(org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility.TestProcedure) LoadCounter(org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility.LoadCounter) ProcedureStoreTracker(org.apache.hadoop.hbase.procedure2.store.ProcedureStoreTracker) Test(org.junit.Test)

Aggregations

LoadCounter (org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility.LoadCounter)1 TestProcedure (org.apache.hadoop.hbase.procedure2.ProcedureTestingUtility.TestProcedure)1 ProcedureStoreTracker (org.apache.hadoop.hbase.procedure2.store.ProcedureStoreTracker)1 Test (org.junit.Test)1