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 2022/10/08 02:30:58 UTC

[GitHub] [pulsar] mattisonchao commented on a diff in pull request #17922: Make BookieId work with PulsarRegistrationDriver (second take)

mattisonchao commented on code in PR #17922:
URL: https://github.com/apache/pulsar/pull/17922#discussion_r990575754


##########
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/bookkeeper/PulsarRegistrationClient.java:
##########
@@ -153,4 +212,56 @@ private static Set<BookieId> convertToBookieAddresses(List<String> children) {
         }
         return newBookieAddrs;
     }
+
+    @Override
+    public CompletableFuture<Versioned<BookieServiceInfo>> getBookieServiceInfo(BookieId bookieId) {
+        // this method cannot perform blocking calls to the MetadataStore
+        // or return a CompletableFuture that is completed on the MetadataStore main thread
+        // this is because there are a few cases in which some operations on the main thread
+        // wait for the result. This is due to the fact that resolving the address of a bookie
+        // is needed in many code paths.
+        Versioned<BookieServiceInfo> resultFromCache = bookieServiceInfoCache.get(bookieId);

Review Comment:
   What about `bookieServiceInfoMetadataCache#getIfCached` method?



-- 
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-unsubscribe@pulsar.apache.org

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