@Test
  public void testHFileLinkCleaning() throws Exception {
    // Link backref cannot be removed
    cleaner.chore();
    // CommonFSUtils.
    assertTrue(fs.exists(linkBackRef));
    assertTrue(fs.exists(hfilePath));

    // Link backref can be removed
    fs.rename(CommonFSUtils.getTableDir(rootDir, tableLinkName),
      CommonFSUtils.getTableDir(archiveDir, tableLinkName));
    cleaner.chore();
    assertFalse("Link should be deleted", fs.exists(linkBackRef));
  }
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