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

    // simulate after removing the reference in data directory, the Link backref can be removed
    fs.delete(new Path(familyLinkPath, hfileLinkName), false);
    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