@Override
  public IMemMNode generatePrefix(final PartialPath storageGroupPath) {
    final String[] nodes = storageGroupPath.getNodes();
    // nodes[0] must be root
    final IMemMNode res = nodeFactory.createAboveDatabaseMNode(null, nodes[0]);
    IMemMNode cur = res;
    IMemMNode child;
    for (int i = 1; i < nodes.length - 1; i++) {
      child = nodeFactory.createAboveDatabaseMNode(cur, nodes[i]);
      cur.addChild(nodes[i], child);
      cur = child;
    }
    root.setParent(cur);
    cur.addChild(root);
    requestMemory(root.estimateSize());
    return res;
  }
This is a memory-based implementation of IMTreeStore. All MNodes are stored in memory.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/MemMTreeStore.java