public Pair<Long, Long> getTimePartitionIdBound(DataRegionId dataRegionId) {
    synchronized (timePartitionInfoMap) {
      Map<Long, TimePartitionInfo> timePartitionInfoMapForDataRegion =
          timePartitionInfoMap.get(dataRegionId);
      if (Objects.nonNull(timePartitionInfoMapForDataRegion)
          && !timePartitionInfoMapForDataRegion.isEmpty()
          && timePartitionInfoMapForDataRegion instanceof TreeMap) {
        return new Pair<>(
            ((TreeMap<Long, TimePartitionInfo>) timePartitionInfoMapForDataRegion).firstKey(),
            ((TreeMap<Long, TimePartitionInfo>) timePartitionInfoMapForDataRegion).lastKey());
      }
    }
    return null;
  }
Manage all the time partitions for all data regions and control the total memory of them
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/rescon/memory/TimePartitionManager.java