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 2021/03/23 16:17:02 UTC

[GitHub] [pulsar] merlimat commented on a change in pull request #10013: Add underReplicate state in the topic internal stats

merlimat commented on a change in pull request #10013:
URL: https://github.com/apache/pulsar/pull/10013#discussion_r599721880



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java
##########
@@ -1774,6 +1777,15 @@ public TopicStats getStats(boolean getPreciseBacklog, boolean subscriptionBacklo
 
         stats.ledgers = Lists.newArrayList();
         List<CompletableFuture<String>> futures = includeLedgerMetadata ? Lists.newArrayList() : null;
+        BookKeeperAdmin bookKeeperAdmin = brokerService.pulsar().getBookKeeperAdmin();
+        Collection<BookieId> allBookies;
+        try {
+            allBookies = bookKeeperAdmin.getAllBookies();

Review comment:
       This is mixing a blocking call into an async method. Instead we could be using the MetadataCache to have the list of bookies available.




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