msn-tldr commented on code in PR #15323:
URL: https://github.com/apache/kafka/pull/15323#discussion_r1486572035


##########
clients/src/main/java/org/apache/kafka/clients/Metadata.java:
##########
@@ -127,6 +127,13 @@ public synchronized Cluster fetch() {
         return cache.cluster();
     }
 
+    /**
+     * Get the current metadata cache.
+     */
+    public synchronized MetadataCache fetchCache() {

Review Comment:
   @hachikuji Interesting. 
   `Metadata.update()` requires mutual exclusion while updating `cache`, other 
internal data structures of `Metadata`. So it makes sense to keep the 
synchronizatiion, what do you think?
   Moreover, `fetchCache` is called once in `Sender::sendProducerData`, so it's 
not a bottle neck in the hotpath.



-- 
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: jira-unsubscr...@kafka.apache.org

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

Reply via email to