@Override
  public void updatePartitionFlushedTime(long timePartitionId, long maxFlushedTime) {
    ILastFlushTime flushTimeMapForPartition =
        partitionLatestFlushedTime.computeIfAbsent(
            timePartitionId, id -> new PartitionLastFlushTime(maxFlushedTime));

    if (flushTimeMapForPartition instanceof PartitionLastFlushTime) {
      long memIncr = Long.BYTES;
      flushTimeMapForPartition.updateLastFlushTime(null, maxFlushedTime);
      memCostForEachPartition.putIfAbsent(timePartitionId, memIncr);
    } else {
      // go here when DeviceLastFlushTime was recovered by wal recovery
      DeviceLastFlushTime deviceLastFlushTime = (DeviceLastFlushTime) flushTimeMapForPartition;
      Map<IDeviceID, Long> flushedTimeMap = deviceLastFlushTime.getDeviceLastFlushTimeMap();
      for (Map.Entry<IDeviceID, Long> entry : flushedTimeMap.entrySet()) {
        flushTimeMapForPartition.updateLastFlushTime(entry.getKey(), entry.getValue());
      }
    }
  }
record memory cost of map for each partitionId
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/HashLastFlushTimeMap.java