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/12/07 15:28:12 UTC

[GitHub] [pulsar] codelipenghui commented on a change in pull request #5716: [Issues 5709]remove the namespace checking

codelipenghui commented on a change in pull request #5716: [Issues 5709]remove the namespace checking
URL: https://github.com/apache/pulsar/pull/5716#discussion_r355127233
 
 

 ##########
 File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java
 ##########
 @@ -180,27 +180,18 @@
 
     // Check topics are valid.
     // - each topic is valid,
-    // - every topic has same namespace,
     // - topic names are unique.
     private static boolean topicNamesValid(Collection<String> topics) {
         checkState(topics != null && topics.size() >= 1,
             "topics should contain more than 1 topic");
 
-        final String namespace = TopicName.get(topics.stream().findFirst().get()).getNamespace();
-
         Optional<String> result = topics.stream()
             .filter(topic -> {
                 boolean topicInvalid = !TopicName.isValid(topic);
                 if (topicInvalid) {
                     return true;
                 }
-
-                String newNamespace =  TopicName.get(topic).getNamespace();
-                if (!namespace.equals(newNamespace)) {
-                    return true;
-                } else {
-                    return false;
-                }
+                return false;
 
 Review comment:
   Can simplify by 
   ```
   topic -> !TopicName.isValid(topic)
   ```

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