private void getMemChunkHandleFromMemTable(
      IDeviceID deviceID,
      WritableMemChunkGroup writableMemChunkGroup,
      Map<String, List<IChunkMetadata>> chunkMetadataMap,
      Map<String, List<IChunkHandle>> memChunkHandleMap,
      long ttlLowerBound,
      List<Pair<ModEntry, IMemTable>> modsToMemTabled) {

    for (Entry<String, IWritableMemChunk> entry :
        writableMemChunkGroup.getMemChunkMap().entrySet()) {

      String measurementId = entry.getKey();
      WritableMemChunk writableMemChunk = (WritableMemChunk) entry.getValue();

      List<TimeRange> deletionList = new ArrayList<>();
      if (modsToMemTabled != null) {
        deletionList =
            ModificationUtils.constructDeletionList(
                deviceID, measurementId, this, modsToMemTabled, ttlLowerBound);
      }
      long[] timestamps = writableMemChunk.getFilteredTimestamp(deletionList);
      chunkMetadataMap
          .computeIfAbsent(measurementId, k -> new ArrayList<>())
          .add(
              buildChunkMetaDataForMemoryChunk(
                  measurementId,
                  timestamps[0],
                  timestamps[timestamps.length - 1],
                  Collections.emptyList()));
      memChunkHandleMap
          .computeIfAbsent(measurementId, k -> new ArrayList<>())
          .add(new MemChunkHandleImpl(deviceID, measurementId, timestamps));
    }
  }
Create this MemChunk if it's not exist.

@param deviceId device id
@param schemaList measurement schemaList
@return this MemChunkGroup
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AbstractMemTable.java