private FileInfo getFileInfoFromCache(TsFileResource resource) throws IOException {
    if (fileInfoCache.containsKey(resource)) {
      return fileInfoCache.get(resource);
    }
    TsFileID tsFileID = resource.getTsFileID();
    synchronized (globalFileInfoCacheForFailedCompaction) {
      FileInfo fileInfo = globalFileInfoCacheForFailedCompaction.get(tsFileID);
      if (fileInfo != null) {
        fileInfoCache.put(resource, fileInfo);
        return fileInfo;
      }
    }
    try (TsFileSequenceReader reader = getReader(resource.getTsFilePath())) {
      FileInfo fileInfo = CompactionEstimateUtils.calculateFileInfo(reader);
      fileInfoCache.put(resource, fileInfo);
      if (globalFileInfoCacheEnabled) {
        synchronized (globalFileInfoCacheForFailedCompaction) {
          globalFileInfoCacheForFailedCompaction.put(tsFileID, fileInfo);
        }
        synchronized (globalRoughInfoCacheForCompaction) {
          globalRoughInfoCacheForCompaction.put(tsFileID, fileInfo.getSimpleFileInfo());
        }
      }
      return fileInfo;
    }
  }
The size of global compaction estimation rough file info cahce.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/compaction/selector/estimator/AbstractCompactionEstimator.java