chia7712 commented on code in PR #15715:
URL: https://github.com/apache/kafka/pull/15715#discussion_r1584322426


##########
core/src/test/java/kafka/test/junit/ClusterTestExtensions.java:
##########
@@ -196,16 +197,35 @@ private void processClusterTest(ExtensionContext context, 
ClusterTest annot, Clu
         }
 
         Map<String, String> serverProperties = new HashMap<>();
+        Map<Integer, Map<String, String>> perBrokerProperties = new 
HashMap<>();
+        Map<Integer, Map<String, String>> perControllerProperties = new 
HashMap<>();
         for (ClusterConfigProperty property : defaults.serverProperties()) {
-            serverProperties.put(property.key(), property.value());
+            processClusterConfigProperty(property, serverProperties, 
perBrokerProperties, perControllerProperties);
         }
         for (ClusterConfigProperty property : annot.serverProperties()) {
-            serverProperties.put(property.key(), property.value());
+            processClusterConfigProperty(property, serverProperties, 
perBrokerProperties, perControllerProperties);
         }
-        configBuilder.setServerProperties(serverProperties);
+        configBuilder.setServerProperties(serverProperties)
+            .setPerBrokerProperties(perBrokerProperties)
+            .setPerControllerProperties(perControllerProperties);
         type.invocationContexts(context.getRequiredTestMethod().getName(), 
configBuilder.build(), testInvocations);
     }
 
+    private void processClusterConfigProperty(ClusterConfigProperty property,
+                                              Map<String, String> 
serverProperties,
+                                              Map<Integer, Map<String, 
String>> perBrokerProperties,
+                                              Map<Integer, Map<String, 
String>> perControllerProperties) {
+        if (property.id() == -1) {
+            serverProperties.put(property.key(), property.value());
+        } else if (property.id() >= TestKitNodes.CONTROLLER_ID_OFFSET) {

Review Comment:
   It seems we don't need to have two per"xxx"properties. In kraft mode, broker 
and quorum controller have different id. In kraft-combined mode, the combined 
broker/controller share the same config.
   
   Hence, we can keep one `perServerProerties`.



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