private boolean isArchivedFileStillReferenced(final Path filePath,
      final Map<Path, Integer> snapshotFilesMap) {

      Integer c = snapshotFilesMap.get(filePath);

      // Check if there are other snapshots or table from clone_snapshot() (via back-reference)
      // still reference to it.
      if ((c != null) && (c == 1)) {
        Path parentDir = filePath.getParent();
        Path backRefDir = HFileLink.getBackReferencesDir(parentDir, filePath.getName());
        try {
          if (CommonFSUtils.listStatus(fs, backRefDir) == null) {
            return false;
          }
        } catch (IOException e) {
          // For the purpose of this function, IOException is ignored and treated as
          // the file is still being referenced.
        }
      }
      return true;
    }
Check if for a give file in archive, if there are other snapshots/tables still reference it.
@param filePath         file path in archive
@param snapshotFilesMap a map for store files in snapshots about how many snapshots refer to
                        it.
@return true or false
hbase-server/src/main/java/org/apache/hadoop/hbase/snapshot/SnapshotInfo.java