You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/05/17 09:38:10 UTC

[GitHub] [pulsar] ppgoml opened a new issue #4294: Is this code reasonable in GenericJsonSchema.java ?

ppgoml opened a new issue #4294: Is this code reasonable in GenericJsonSchema.java ?
URL: https://github.com/apache/pulsar/issues/4294
 
 
   /pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/generic/GenericJsonSchema.java
   
    public byte[] encode(GenericRecord message) {
           checkArgument(message instanceof GenericAvroRecord);
           GenericJsonRecord gjr = (GenericJsonRecord) message;
           try {
               return objectMapper.writeValueAsBytes(gjr.getJsonNode().toString());
           } catch (IOException ioe) {
               throw new SchemaSerializationException(ioe);
           }
       }
   
   I don't understand why there is a GenericAvroRecord check here in Json schema.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services