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 2017/11/17 04:20:50 UTC

[GitHub] jai1 commented on a change in pull request #884: Restrict partitioned-metadata rest-api access for cpp-client older than 1.21

jai1 commented on a change in pull request #884: Restrict partitioned-metadata rest-api access for cpp-client older than 1.21
URL: https://github.com/apache/incubator-pulsar/pull/884#discussion_r151600599
 
 

 ##########
 File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/PersistentTopics.java
 ##########
 @@ -470,9 +474,22 @@ public PartitionedTopicMetadata getPartitionedMetadata(@PathParam("property") St
             @PathParam("destination") @Encoded String destination,
             @QueryParam("authoritative") @DefaultValue("false") boolean authoritative) {
         destination = decode(destination);
-       return getPartitionedTopicMetadata(property, cluster, namespace, destination, authoritative);
+        PartitionedTopicMetadata metadata = getPartitionedTopicMetadata(property, cluster, namespace, destination, authoritative);
+        if (metadata.partitions > 1) {
+            try {
+                validateClientVersion();
+            } catch (UnsupportedOperationException ue) {
 
 Review comment:
   Would prefer isClientVersionValid instead of the throwing  and catching exceptions.
   
   But otherwise - LGTM.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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