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


##########
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:
   @hachikuji I had thought about `MetadataCache`. It has 1 accessor i.e. 
`partitionMetadata()` that is returning mutable `PartitionMetadata`, and is not 
making defensive copies. Rest all accessors are returning immutable objects, or 
making defensive copies. 
   Is it ok for `partitionMetadata()` to make defensive copies? That would lead 
to memory going up.



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