@Test
  public void testMobFileCompactionAfterSnapshotClone() throws InterruptedException, IOException {
    final TableName clone = TableName.valueOf(TestMobUtils.getTableName(test) + "-clone");
    LOG.info("MOB compaction of cloned snapshot, " + description() + " started");
    loadAndFlushThreeTimes(rows, table, famStr);
    LOG.debug("Taking snapshot and cloning table {}", table);
    admin.snapshot(TestMobUtils.getTableName(test), table);
    admin.cloneSnapshot(TestMobUtils.getTableName(test), clone);
    assertEquals("Should have 3 hlinks per region in MOB area from snapshot clone", 3 * numRegions,
      getNumberOfMobFiles(clone, famStr));
    mobCompact(admin.getDescriptor(clone), familyDescriptor);
    assertEquals("Should have 3 hlinks + 1 MOB file per region due to clone + compact",
      4 * numRegions, getNumberOfMobFiles(clone, famStr));
    cleanupAndVerifyCounts(clone, famStr, 3 * rows);
    LOG.info("MOB compaction of cloned snapshot, " + description() + " finished OK");
  }
Mob file compaction base test. 1. Enables batch mode for regular MOB compaction, Sets batch size
to 7 regions. (Optional) 2. Disables periodic MOB compactions, sets minimum age to archive to 10
sec 3. Creates MOB table with 20 regions 4. Loads MOB data (randomized keys, 1000 rows), flushes
data. 5. Repeats 4. two more times 6. Verifies that we have 20 *3 = 60 mob files (equals to
number of regions x 3) 7. Runs major MOB compaction. 8. Verifies that number of MOB files in a
mob directory is 20 x4 = 80 9. Waits for a period of time larger than minimum age to archive 10.
Runs Mob cleaner chore 11 Verifies that number of MOB files in a mob directory is 20. 12 Runs
scanner and checks all 3 * 1000 rows.
hbase-server/src/test/java/org/apache/hadoop/hbase/mob/TestMobCompactionWithDefaults.java