public void deserializeFromOldMemTableSnapshot(
      DataInputStream stream, boolean multiTvListInMemChunk) throws IOException {
    seriesNumber = stream.readInt();
    memSize = stream.readLong();
    tvListRamCost = stream.readLong();
    totalPointsNum = stream.readLong();
    totalPointsNumThreshold = stream.readLong();
    maxPlanIndex = stream.readLong();
    minPlanIndex = stream.readLong();

    int memTableMapSize = stream.readInt();
    for (int i = 0; i < memTableMapSize; ++i) {
      PartialPath devicePath;
      try {
        devicePath =
            DataNodeDevicePathCache.getInstance()
                .getPartialPath(ReadWriteIOUtils.readString(stream));
      } catch (IllegalPathException e) {
        throw new IllegalArgumentException("Cannot deserialize OldMemTableSnapshot", e);
      }
      IDeviceID deviceID = deviceIDFactory.getDeviceID(devicePath);
      boolean isAligned = ReadWriteIOUtils.readBool(stream);
      IWritableMemChunkGroup memChunkGroup;
      if (multiTvListInMemChunk) {
        if (isAligned) {
          memChunkGroup = AlignedWritableMemChunkGroup.deserialize(stream, deviceID.isTableModel());
        } else {
          memChunkGroup = WritableMemChunkGroup.deserialize(stream);
        }
      } else {
        if (isAligned) {
          memChunkGroup =
              AlignedWritableMemChunkGroup.deserializeSingleTVListMemChunks(
                  stream, deviceID.isTableModel());
        } else {
          memChunkGroup = WritableMemChunkGroup.deserializeSingleTVListMemChunks(stream);
        }
      }
      memTableMap.put(deviceID, memChunkGroup);
    }
  }
Notice: this method is concurrent unsafe.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/memtable/AbstractMemTable.java