brandboat commented on code in PR #15761:
URL: https://github.com/apache/kafka/pull/15761#discussion_r1573855899


##########
core/src/test/java/kafka/test/ClusterConfig.java:
##########
@@ -67,13 +69,16 @@ public class ClusterConfig {
         this.listenerName = listenerName;
         this.trustStoreFile = trustStoreFile;
         this.metadataVersion = metadataVersion;
-        this.serverProperties = copyOf(serverProperties);
-        this.producerProperties = copyOf(producerProperties);
-        this.consumerProperties = copyOf(consumerProperties);
-        this.adminClientProperties = copyOf(adminClientProperties);
-        this.saslServerProperties = copyOf(saslServerProperties);
-        this.saslClientProperties = copyOf(saslClientProperties);
-        perBrokerOverrideProperties.forEach((brokerId, props) -> 
this.perBrokerOverrideProperties.put(brokerId, copyOf(props)));
+        this.serverProperties = Collections.unmodifiableMap(serverProperties);
+        this.producerProperties = 
Collections.unmodifiableMap(producerProperties);
+        this.consumerProperties = 
Collections.unmodifiableMap(consumerProperties);
+        this.adminClientProperties = 
Collections.unmodifiableMap(adminClientProperties);
+        this.saslServerProperties = 
Collections.unmodifiableMap(saslServerProperties);
+        this.saslClientProperties = 
Collections.unmodifiableMap(saslClientProperties);
+        this.perBrokerOverrideProperties = Collections.unmodifiableMap(

Review Comment:
   Pardon me, I'm not quite clear about this comment. Could you explain more ? 
:smiley: 
   For convenience, this pr add something like `public Builder 
putServerProperty(String key, String value) ` in each configurations like 
`serverProperties`, `consumerProperties`. So we don't need to do deep copy in 
ClusterConfig.Builder. 
   Or did you mean we need to use `setServerProperty(Map<String, String> 
serverProperties)`  instead of `putServerProperty(String key, String value)`  ?



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