@Override
  public synchronized void releaseFor(
      TsFileResource tsFileResource, ModificationFile modificationFile) throws IOException {
    Set<TsFileResource> references = modFileReferences.get(modificationFile);
    references.remove(tsFileResource);
    if (references.isEmpty()) {
      modFileReferences.remove(modificationFile);
      modificationFile.remove();
    }
  }
LevelModFileManager manages the shared mod files within one time partition.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/modification/PartitionLevelModFileManager.java