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


##########
core/src/test/java/kafka/testkit/TestKitNodes.java:
##########
@@ -90,9 +100,17 @@ public Builder setNumBrokerNodes(int numBrokerNodes) {
                 if (!brokerNodeBuilders.isEmpty()) {
                     nextId = brokerNodeBuilders.lastKey() + 1;
                 }
-                brokerNodeBuilders.put(nextId,
-                    new BrokerNode.Builder().
-                        setId(nextId));
+                BrokerNode.Builder brokerNodeBuilder = new 
BrokerNode.Builder().setId(nextId);
+                // Keeping consistent behaviour for existing tests when 
disksPerBroker == 1
+                if (disksPerBroker > 1) {
+                    int brokerId = nextId; // this is because the lambda below 
requires a final
+                    List<String> logDataDirectories = IntStream
+                            .range(0, disksPerBroker)
+                            .mapToObj(i -> String.format("broker_%d_data%d", 
brokerId, i))
+                            .collect(Collectors.toList());
+                    brokerNodeBuilder.setLogDirectories(logDataDirectories);
+                }

Review Comment:
   noted that we should consider the `combined` mode. see 
https://github.com/apache/kafka/blob/trunk/core/src/test/java/kafka/testkit/BrokerNode.java#L80



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