@Test
  public void testReconstruction() throws Exception {
    Table table = TEST_UTIL.createMultiRegionTable(TABLE_NAME, FAMILY);

    // Load up the table with simple rows and count them
    int initialCount = TEST_UTIL.loadTable(table, FAMILY);
    int count = TEST_UTIL.countRows(table);

    assertEquals(initialCount, count);

    for (int i = 0; i < 4; i++) {
      TEST_UTIL.loadTable(table, FAMILY);
    }
    RegionServerThread rsThread = TEST_UTIL.getHBaseCluster().getRegionServerThreads().get(0);
    int index = 0;
    LOG.info("Expiring {}", TEST_UTIL.getMiniHBaseCluster().getRegionServer(index));
    TEST_UTIL.expireRegionServerSession(index);
    // make sure that the RS is fully down before reading, so that we will read the data from other
    // RSes.
    TEST_UTIL.waitFor(30000, new ExplainingPredicate<Exception>() {

      @Override
      public boolean evaluate() throws Exception {
        return !rsThread.isAlive();
      }

      @Override
      public String explainFailure() throws Exception {
        return rsThread.getRegionServer() + " is still alive";
      }
    });
    LOG.info("Starting count");

    int newCount = TEST_UTIL.countRows(table);
    assertEquals(count, newCount);
    table.close();
  }
Test the whole reconstruction loop. Build a table with regions aaa to zzz and load every one of
them multiple times with the same date and do a flush at some point. Kill one of the region
servers and scan the table. We should see all the rows.
hbase-server/src/test/java/org/apache/hadoop/hbase/TestFullLogReconstruction.java