@Override
  public void serialize(final ISchemaRegionPlan plan, final OutputStream outputStream)
      throws IOException {
    dataOutputStream.changeOutputStream(outputStream);
    // serialize plan type
    plan.getPlanType().serialize(dataOutputStream);
    // serialize plan attributes
    final SchemaRegionPlanSerializationResult result =
        plan.accept(new SchemaRegionPlanSerializeVisitor(), dataOutputStream);
    if (result.isFailed()) {
      throw result.getException();
    }
  }
This class provides the ability to serialize the given SchemaRegionPlan into binary data, 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/SchemaRegionPlanSerializer.java