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


##########
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:
   Added



-- 
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: commits-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to