@After
  public void cleanup() throws IOException, InterruptedException {
    // HFile can be removed
    Thread.sleep(TTL * 2);
    cleaner.chore();
    assertFalse("HFile should be deleted", fs.exists(hfilePath));
    // Remove everything
    for (int i = 0; i < 4; ++i) {
      Thread.sleep(TTL * 2);
      cleaner.chore();
    }
    assertFalse("HFile should be deleted",
      fs.exists(CommonFSUtils.getTableDir(archiveDir, tableName)));
    assertFalse("Link should be deleted",
      fs.exists(CommonFSUtils.getTableDir(archiveDir, tableLinkName)));
  }
Test the HFileLink Cleaner. HFiles with links cannot be deleted until a link is present.
hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestHFileLinkCleaner.java