public void createOrUpdateTableDevice(
      final String tableName,
      final String[] devicePath,
      final IntSupplier attributePointerGetter,
      final IntConsumer attributeUpdater)
      throws MetadataException {
    // todo implement storage for device of diverse data types
    if (LOGGER.isDebugEnabled()) {
      LOGGER.debug("Start to create table device {}.{}", tableName, Arrays.toString(devicePath));
    }
    IMemMNode cur = storageGroupMNode.getChild(tableName);
    if (cur == null) {
      cur =
          store.addChild(
              storageGroupMNode, tableName, nodeFactory.createInternalMNode(cur, tableName));
    }

    for (final String childName : devicePath) {
      IMemMNode child = cur.getChild(childName);
      if (child == null) {
        child = store.addChild(cur, childName, nodeFactory.createInternalMNode(cur, childName));
      }
      cur = child;
    }

    final IDeviceMNode<IMemMNode> entityMNode;

    synchronized (this) {
      if (cur.isDevice()) {
        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug("Table device {}.{} already exists", tableName, Arrays.toString(devicePath));
        }
        entityMNode = cur.getAsDeviceMNode();
        if (!(entityMNode.getDeviceInfo() instanceof TableDeviceInfo)) {
          throw new MetadataException("Table device shall not create under tree model");
        }
        final TableDeviceInfo<IMemMNode> deviceInfo =
            (TableDeviceInfo<IMemMNode>) entityMNode.getDeviceInfo();
        attributeUpdater.accept(deviceInfo.getAttributePointer());
      } else {
        entityMNode = store.setToEntity(cur);
        final TableDeviceInfo<IMemMNode> deviceInfo = new TableDeviceInfo<>();
        deviceInfo.setAttributePointer(attributePointerGetter.getAsInt());
        entityMNode.getAsInternalMNode().setDeviceInfo(deviceInfo);
        regionStatistics.addTableDevice(tableName);
        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug("Table device {}.{} created", tableName, Arrays.toString(devicePath));
        }
      }
    }
  }
Get node by the path

@return last node in given seriesPath
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/MTreeBelowSGMemoryImpl.java