cmccabe commented on code in PR #12837: URL: https://github.com/apache/kafka/pull/12837#discussion_r1022017395
########## core/src/test/java/kafka/testkit/KafkaClusterTestKit.java: ########## @@ -130,18 +151,56 @@ public Builder setConfigProp(String key, String value) { return this; } - public Builder setMetadataFaultHandler(MockFaultHandler metadataFaultHandler) { - this.metadataFaultHandler = metadataFaultHandler; - return this; + private KafkaConfig createNodeConfig(TestKitNode node) { + BrokerNode brokerNode = nodes.brokerNodes().get(node.id()); + ControllerNode controllerNode = nodes.controllerNodes().get(node.id()); + + Map<String, String> props = new HashMap<>(configProps); + props.put(KafkaConfig$.MODULE$.ProcessRolesProp(), roles(node.id())); + props.put(KafkaConfig$.MODULE$.NodeIdProp(), + Integer.toString(node.id())); + // In combined mode, always prefer the metadata log directory of the controller node. + if (controllerNode != null) { + props.put(KafkaConfig$.MODULE$.MetadataLogDirProp(), + controllerNode.metadataDirectory()); + } else { + props.put(KafkaConfig$.MODULE$.MetadataLogDirProp(), + node.metadataDirectory()); + } + // Set the log.dirs according to the broker node setting (if there is a broker node) + if (brokerNode != null) { + props.put(KafkaConfig$.MODULE$.LogDirsProp(), + String.join(",", brokerNode.logDataDirectories())); + } + props.put(KafkaConfig$.MODULE$.ListenerSecurityProtocolMapProp(), + "EXTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT"); + props.put(KafkaConfig$.MODULE$.ListenersProp(), listeners(node.id())); + props.put(KafkaConfig$.MODULE$.InterBrokerListenerNameProp(), + nodes.interBrokerListenerName().value()); + props.put(KafkaConfig$.MODULE$.ControllerListenerNamesProp(), + "CONTROLLER"); + // Note: we can't accurately set controller.quorum.voters yet, since we don't + // yet know what ports each controller will pick. Set it to a dummy string \ Review Comment: that is weird. I think the IDE inserted it? It does nothing here. I will remove it -- 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