public long getMaxFileTimestampOfUnSequenceFile() {
    long maxFileTimestamp = -1;
    resourceListLock.readLock().lock();
    try {
      for (TsFileResourceList resourceList : unsequenceFiles.values()) {
        TsFileResource lastResource = resourceList.get(resourceList.size() - 1);
        maxFileTimestamp = Math.max(maxFileTimestamp, lastResource.getTimePartition());
      }
    } finally {
      resourceListLock.readLock().unlock();
    }
    return maxFileTimestamp;
  }
This method is called after compaction to update memory.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileManager.java