@Override
  public void serialize(ISchemaRegionPlan plan, OutputStream outputStream) throws IOException {
    DataOutputStream dataOutputStream = new DataOutputStream(outputStream);
    StringBuilder stringBuilder = new StringBuilder();
    // serialize plan type
    stringBuilder.append(plan.getPlanType().name()).append(FIELD_SEPARATOR);
    // serialize plan attributes
    plan.accept(new SchemaRegionPlanTxtSerializeVisitor(), stringBuilder);
    stringBuilder.append(LINE_SEPARATOR);
    dataOutputStream.write(stringBuilder.toString().getBytes());
  }
This class provides the ability to serialize the given SchemaRegionPlan into binary data as txt
format, which is used for MLogParser.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/logfile/visitor/SchemaRegionPlanTxtSerializer.java