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/03/21 09:54:07 UTC

[GitHub] [pulsar] sijie commented on a change in pull request #3876: Add the multi version schema support

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

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
 ##########
 @@ -152,6 +155,17 @@
     static <T> ConsumerImpl<T> newConsumerImpl(PulsarClientImpl client, String topic, ConsumerConfigurationData<T> conf,
                  ExecutorService listenerExecutor, int partitionIndex, CompletableFuture<Consumer<T>> subscribeFuture,
                  SubscriptionMode subscriptionMode, MessageId startMessageId, Schema<T> schema, ConsumerInterceptors<T> interceptors) {
+        if(schema instanceof AvroSchema && schema.supportSchemaVersioning()){
+            Map<String, MultiVersionSchema> multiVersionSchemaCatch = client.getMultiVersionSchemaCatch();
+            if(multiVersionSchemaCatch.get(topic) != null){
 
 Review comment:
   ```suggestion
               MultiVersionSchema schema = multiVersionSchemaCache.get(topic);
               if(schema == null) {
                  ...
               }
   ```

----------------------------------------------------------------
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