@Override
  public synchronized ModificationFile recover(String modFilePath, TsFileResource tsFileResource)
      throws IOException {
    long[] levelAndModFileId = ModificationFile.parseFileName(new File(modFilePath).getName());
    long level = levelAndModFileId[0];
    long modFileId = levelAndModFileId[1];

    TreeMap<Long, ModificationFile> idModificationMap =
        levelModFileIdMap.computeIfAbsent(level, l -> new TreeMap<>());
    ModificationFile modificationFile =
        idModificationMap.computeIfAbsent(
            modFileId, id -> new ModificationFile(new File(modFilePath), true));

    modFileReferences.computeIfAbsent(modificationFile, f -> new HashSet<>()).add(tsFileResource);

    return modificationFile;
  }
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