@Test
  public void testRegionServerLastLogRollResults() throws IOException {
    String[] servers = new String[] { "server1", "server2", "server3" };
    Long[] timestamps = new Long[] { 100L, 102L, 107L };

    // validate the prefix scan in readRegionServerlastLogRollResult will get the right timestamps
    // when a backup root with the same prefix is present
    for (int i = 0; i < servers.length; i++) {
      table.writeRegionServerLastLogRollResult(servers[i], timestamps[i], "root");
      table.writeRegionServerLastLogRollResult(servers[i], timestamps[i], "root/backup");
    }

    HashMap<String, Long> result = table.readRegionServerLastLogRollResult("root");
    assertTrue(servers.length == result.size());
    Set<String> keys = result.keySet();
    String[] keysAsArray = new String[keys.size()];
    keys.toArray(keysAsArray);
    Arrays.sort(keysAsArray);

    for (int i = 0; i < keysAsArray.length; i++) {
      assertEquals(keysAsArray[i], servers[i]);
      Long ts1 = timestamps[i];
      Long ts2 = result.get(keysAsArray[i]);
      assertEquals(ts1, ts2);
    }

    cleanBackupTable();
  }
Test cases for backup system table API
hbase-backup/src/test/java/org/apache/hadoop/hbase/backup/TestBackupSystemTable.java