hachikuji commented on code in PR #15323:
URL: https://github.com/apache/kafka/pull/15323#discussion_r1483386345


##########
clients/src/main/java/org/apache/kafka/clients/MetadataCache.java:
##########
@@ -52,7 +52,7 @@ public class MetadataCache {
     private final Map<TopicPartition, PartitionMetadata> metadataByPartition;
     private final Map<String, Uuid> topicIds;
     private final Map<Uuid, String> topicNames;
-    private Cluster clusterInstance;
+    private InternalCluster clusterInstance;

Review Comment:
   The javadoc for `MetadataCache` describes it as mutable, but as far as I can 
tell, we do not actually modify any of the collections. We always build new 
instances instead of updating an existing one. That makes me wonder if we can 
change the javadoc and use `MetadataCache` as the immutable snapshot of 
metadata state. Then we could drop `InternalCluster` in favor of 
`MetadataCache`. Would that work?



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