public synchronized void decreaseFileReference(final File hardlink) throws IOException {
    final Integer updatedReference =
        hardlinkToReferenceMap.computeIfPresent(
            hardlink.getPath(), (file, reference) -> reference - 1);

    if (updatedReference != null && updatedReference == 0) {
      Files.deleteIfExists(hardlink.toPath());
      hardlinkToReferenceMap.remove(hardlink.getPath());
    }
  }
given a hardlink, decrease its reference count, if the reference count is 0, delete the file.
if the given file is not a hardlink, do nothing.

@param hardlink the hardlinked file
@throws IOException when delete file failed
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/resource/wal/hardlink/PipeWALHardlinkResourceManager.java