codelipenghui commented on code in PR #22854:
URL: https://github.com/apache/pulsar/pull/22854#discussion_r1668712267


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java:
##########
@@ -1573,4 +1548,51 @@ protected void setCurrentReceiverQueueSize(int newSize) {
         CURRENT_RECEIVER_QUEUE_SIZE_UPDATER.set(this, newSize);
         resumeReceivingFromPausedConsumersIfNeeded();
     }
+
+    /**
+     * Get the exists partitions of a partitioned topic, the result does not 
contain the partitions which has not been
+     * created yet(in other words, the partitions that do not exist in the 
response of "pulsar-admin topics list").
+     * @return sorted partitions list if it is a partitioned topic; @return an 
empty list if it is a non-partitioned
+     * topic.
+     */
+    private CompletableFuture<List<Integer>> getExistsPartitions(String topic) 
{
+        TopicName topicName = TopicName.get(topic);
+        if (!topicName.isPersistent()) {
+            return FutureUtil.failedFuture(new IllegalArgumentException("The 
method getExistsPartitions"
+                    + " does not support non-persistent topic yet."));
+        }
+        return 
client.getLookup().getTopicsUnderNamespace(topicName.getNamespaceObject(),
+                CommandGetTopicsOfNamespace.Mode.PERSISTENT,
+                TopicName.getPattern(topicName.getPartitionedTopicName()),

Review Comment:
   Please help add a comment here that the server side will match all the 
partitions, e.g. the broker will return `abc-partition-0` and `abc-partition-1` 
if the provided pattern is `^abc$`.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to