private ICachedMNode checkAndAutoCreateDeviceNode(String deviceName, ICachedMNode deviceParent)
      throws MetadataException {
    if (deviceParent == null) {
      // device is sg
      pinMNode(storageGroupMNode);
      return storageGroupMNode;
    }
    ICachedMNode device = store.getChild(deviceParent, deviceName);
    if (device == null) {
      device =
          store.addChild(
              deviceParent, deviceName, nodeFactory.createInternalMNode(deviceParent, deviceName));
    }

    if (device.isMeasurement()) {
      throw new PathAlreadyExistException(device.getFullPath());
    }
    return device;
  }
Create aligned timeseries with full paths from root to one leaf node. Before creating
timeseries, the * database should be set first, throw exception otherwise

@param devicePath device path
@param measurements measurements list
@param dataTypes data types list
@param encodings encodings list
@param compressors compressor
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/pbtree/MTreeBelowSGCachedImpl.java