public void registerTimePartitionInfo(TimePartitionInfo timePartitionInfo) {
    synchronized (timePartitionInfoMap) {
      TreeMap<Long, TimePartitionInfo> timePartitionInfoMapForRegion =
          (TreeMap<Long, TimePartitionInfo>)
              timePartitionInfoMap.computeIfAbsent(
                  timePartitionInfo.dataRegionId, k -> new TreeMap<>());

      timePartitionInfoMapForRegion.put(timePartitionInfo.partitionId, timePartitionInfo);

      // We need to ensure that the following method is called before
      // PipeInsertionDataNodeListener.listenToInsertNode.
      PipeTimePartitionListener.getInstance()
          .listenToTimePartitionGrow(
              String.valueOf(timePartitionInfo.dataRegionId.getId()),
              new Pair<>(
                  timePartitionInfoMapForRegion.firstKey(),
                  timePartitionInfoMapForRegion.lastKey()));
    }
  }
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