public synchronized void updateRatio(long memorySize, long diskSize) throws IOException {
    File oldFile = SystemFileFactory.INSTANCE.getFile(directory, oldFileName);

    totalMemorySize.addAndGet(memorySize);
    totalDiskSize += diskSize;
    if (memorySize < 0 || totalMemorySize.get() < 0) {
      LOGGER.warn(
          "The compression ratio is negative, current memTableSize: {}, totalMemTableSize: {}",
          memorySize,
          totalMemorySize);
    }
    File newFile =
        SystemFileFactory.INSTANCE.getFile(
            directory,
            String.format(
                Locale.ENGLISH, RATIO_FILE_PATH_FORMAT, totalMemorySize.get(), totalDiskSize));
    persist(oldFile, newFile);
  }
Whenever the task of closing a file ends, the compression ratio of the file is calculated and
call this method.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/flush/CompressionRatio.java