@Override
    public ISchemaRegionPlan visitCreateTimeSeries(
        final ICreateTimeSeriesPlan createTimeSeriesPlan, final ByteBuffer buffer) {
      final int length = buffer.getInt();
      final byte[] bytes = new byte[length];
      buffer.get(bytes);
      try {
        createTimeSeriesPlan.setPath(
            new MeasurementPath(new String(bytes, TSFileConfig.STRING_CHARSET)));
      } catch (final IllegalPathException e) {
        LOGGER.error("Cannot deserialize SchemaRegionPlan from buffer", e);
      }

      createTimeSeriesPlan.setDataType(TSDataType.deserialize(buffer.get()));
      createTimeSeriesPlan.setEncoding(TSEncoding.deserialize(buffer.get()));
      createTimeSeriesPlan.setCompressor(CompressionType.deserialize(buffer.get()));
      createTimeSeriesPlan.setTagOffset(buffer.getLong());

      // alias
      if (buffer.get() == 1) {
        createTimeSeriesPlan.setAlias(ReadWriteIOUtils.readString(buffer));
      }

      // props
      if (buffer.get() == 1) {
        createTimeSeriesPlan.setProps(ReadWriteIOUtils.readMap(buffer));
      }

      // tags
      if (buffer.get() == 1) {
        createTimeSeriesPlan.setTags(ReadWriteIOUtils.readMap(buffer));
      }

      // attributes
      if (buffer.get() == 1) {
        createTimeSeriesPlan.setAttributes(ReadWriteIOUtils.readMap(buffer));
      }

      // deserialize a long to keep compatible with old version (raft index)
      buffer.getLong();

      return createTimeSeriesPlan;
    }
This class provides the ability to deserialize a SchemaRegionPlan from binary data in given
ByteBuffer, the format of which is compatible with that of PhysicalPlan in 0.14 snapshot
versions.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/logfile/visitor/SchemaRegionPlanDeserializer.java