code: public boolean needPersistence(long fileId) {
      if (isFilePersisting(fileId) || isFilePersisted(fileId)) {
        return false;
      }
  
      try {
        String ufsFingerprint = ufsFingerprint(fileId);
        if (ufsFingerprint != null) {
          // mark as persisted
          addPersistedFile(fileId, ufsFingerprint);
          return false;
        }
      } catch (Exception e) {
        LOG.warn("Failed to check if file {} exists in under storage system: {}",
                 fileId, e.getMessage());
        LOG.debug("Exception: ", e);
      }
      return true;
    }
docs: Checks if the given file needs persistence.
  
  @param fileId the file id
  @return false if the file is being persisted, or is already persisted; otherwise true