crossoverJie commented on code in PR #21228:
URL: https://github.com/apache/pulsar/pull/21228#discussion_r1387442429


##########
pip/pip-303.md:
##########
@@ -0,0 +1,207 @@
+
+# Motivation
+
+When a topic has a large number of producers or consumers (over 1k), querying 
the `pulsarAdmin.topics().getPartitionedStats()` interface is slow and the 
response size is also large.
+As a result, it's essential to give users the option of querying producer and 
consumer information.
+
+
+
+# Goals
+
+## In Scope
+
+Add the API for `org.apache.pulsar.client.admin.Topics`
+```java
+CompletableFuture<PartitionedTopicStats> getPartitionedStatsAsync(
+        String topic, boolean perPartition, GetStatsOptions options);
+
+CompletableFuture<TopicStats> getStatsAsync(String topic, GetStatsOptions 
options);
+```
+
+
+
+## Out of Scope
+
+None.
+
+
+# High Level Design
+
+Implement the `getPartitionedStatsAsync` method, and add the 
`exclusivePublishers` and `exclusiveConsumers` parameters to 
`{tenant}/{namespace}/{topic}/partitioned-stats` API in `PersistentTopics` and 
`NonPersistentTopics`.
+
+# Detailed Design
+
+## Design & Implementation Details
+
+
+Add two fields for `org.apache.pulsar.client.admin.GetStatsOptions`
+```java
+@Data
+@Builder
+public class GetStatsOptions {
+    /**
+     * Whether to exclusive publishers.
+     */
+    private final boolean exclusivePublishers;
+
+    /**
+     * Whether to exclusive subscriptions.
+     */
+    private final boolean exclusiveConsumers;
+    
+}
+```
+
+Implement the `getPartitionedStatsAsync` and `getStatsAsync` interface for 
`org.apache.pulsar.client.admin.internal.TopicsImpl`
+```java
+@Override
+public CompletableFuture<PartitionedTopicStats> 
getPartitionedStatsAsync(String topic,
+        boolean perPartition, boolean getPreciseBacklog, boolean 
subscriptionBacklogSize,boolean getEarliestTimeInBacklog,

Review Comment:
   Done.



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