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


##########
pulsar-client-api/src/main/java/org/apache/pulsar/client/api/PulsarClient.java:
##########
@@ -308,14 +308,32 @@ static ClientBuilder builder() {
      *
      * <p>This can be used to discover the partitions and create {@link 
Reader}, {@link Consumer} or {@link Producer}
      * instances directly on a particular partition.
-     *
+     * @Deprecated it is not suggested to use now; please use {@link 
#getPartitionsForTopic(String, boolean)}.
      * @param topic
      *            the topic name
      * @return a future that will yield a list of the topic partitions or 
{@link PulsarClientException} if there was any
      *         error in the operation.
+     *
      * @since 2.3.0
      */
-    CompletableFuture<List<String>> getPartitionsForTopic(String topic);
+    @Deprecated
+    default CompletableFuture<List<String>> getPartitionsForTopic(String 
topic) {
+        return getPartitionsForTopic(topic, true);
+    }
+
+    /**
+     * 1. Get the partitions if the topic exists. Return "[{partition-0}, 
{partition-1}....{partition-n}}]" if a
+     *   partitioned topic exists; return "[{topic}]" if a non-partitioned 
topic exists.
+     * 2. When {@param metadataAutoCreationEnabled} is "false", neither the 
partitioned topic nor non-partitioned
+     *   topic does not exist. You will get an {@link 
PulsarClientException.NotFoundException}.

Review Comment:
   - When using `HTTP LookupService`, you will get a NotFoundException parsed 
from `code: 404`.
   - When using `Binary LookupService`, you will get a 
TopicDoesNotExistException parsed from `code: 404`.
   
   I added two exceptions in the comment



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