sijie commented on a change in pull request #3876: Add the multi version schema 
support
URL: https://github.com/apache/pulsar/pull/3876#discussion_r273291755
 
 

 ##########
 File path: 
pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/generic/GenericSchemaImpl.java
 ##########
 @@ -20,64 +20,77 @@
 
 import java.util.List;
 import java.util.stream.Collectors;
-import org.apache.pulsar.client.api.Schema;
-import org.apache.pulsar.client.api.schema.Field;
-import org.apache.pulsar.client.api.schema.GenericRecord;
-import org.apache.pulsar.client.api.schema.GenericSchema;
+
+import org.apache.pulsar.client.api.schema.*;
+import org.apache.pulsar.client.impl.schema.StructSchema;
 import org.apache.pulsar.common.schema.SchemaInfo;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
 
 /**
  * A generic schema representation.
  */
-public abstract class GenericSchemaImpl implements GenericSchema {
+public abstract class GenericSchemaImpl extends StructSchema<GenericRecord> 
implements GenericSchema {
 
-    protected final org.apache.avro.Schema schema;
     protected final List<Field> fields;
-    protected final SchemaInfo schemaInfo;
 
-    protected GenericSchemaImpl(SchemaInfo schemaInfo) {
-        this.schemaInfo = schemaInfo;
-        this.schema = new org.apache.avro.Schema.Parser().parse(
-            new String(schemaInfo.getSchema(), UTF_8)
-        );
-        this.fields = schema.getFields()
-            .stream()
-            .map(f -> new Field(f.name(), f.pos()))
-            .collect(Collectors.toList());
+    /**
+     * AUTO : decode by message's schema
+     * COMP : decode by consumer-defined schema
+     */
+    public enum DecodeType {
+        AUTO,
+        COMP
 
 Review comment:
   what does COMP stand for?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to