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


##########
tools/src/test/java/org/apache/kafka/tools/MetadataQuorumCommandTest.java:
##########
@@ -73,7 +74,7 @@ public void testDescribeQuorumReplicationSuccessful() throws 
InterruptedExceptio
         );
 
         List<String> outputs = 
stream(describeOutput.split("\n")).skip(1).collect(Collectors.toList());
-        if (cluster.config().clusterType() == Type.CO_KRAFT)
+        if 
(cluster.config().clusterTypes().equals(Collections.singletonList(Type.CO_KRAFT)))

Review Comment:
   `cluster.config().clusterTypes().contains(Type.CO_KRAFT)`



##########
core/src/test/java/kafka/test/ClusterConfig.java:
##########
@@ -219,8 +220,8 @@ public static class Builder {
 
         private Builder() {}
 
-        public Builder setType(Type type) {
-            this.type = type;
+        public Builder setTypes(List<Type> types) {

Review Comment:
   ```java
           public Builder setTypes(Set<Type> types) {
               this.types = Collections.unmodifiableSet(new HashSet<>(types));
               return this;
           }
   ```



##########
tools/src/test/java/org/apache/kafka/tools/MetadataQuorumCommandTest.java:
##########
@@ -59,12 +60,12 @@ public MetadataQuorumCommandTest(ClusterInstance cluster) {
      * 3. Fewer brokers than controllers
      */
     @ClusterTests({
-        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 2, controllers = 
2),
-        @ClusterTest(clusterType = Type.KRAFT, brokers = 2, controllers = 2),
-        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 2, controllers = 
1),
-        @ClusterTest(clusterType = Type.KRAFT, brokers = 2, controllers = 1),
-        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 1, controllers = 
2),
-        @ClusterTest(clusterType = Type.KRAFT, brokers = 1, controllers = 2)
+        @ClusterTest(clusterTypes = {Type.CO_KRAFT}, brokers = 2, controllers 
= 2),

Review Comment:
   ```java
       @ClusterTests({
           @ClusterTest(clusterTypes = {Type.CO_KRAFT, Type.KRAFT}, brokers = 
2, controllers = 2),
           @ClusterTest(clusterTypes = {Type.CO_KRAFT, Type.KRAFT}, brokers = 
2, controllers = 1),
           @ClusterTest(clusterTypes = {Type.CO_KRAFT, Type.KRAFT}, brokers = 
1, controllers = 2),
       })
   ```



##########
core/src/test/java/kafka/test/ClusterConfig.java:
##########
@@ -85,8 +86,8 @@ private ClusterConfig(Type type, int brokers, int 
controllers, int disksPerBroke
         this.perBrokerOverrideProperties = 
Objects.requireNonNull(perBrokerOverrideProperties);
     }
 
-    public Type clusterType() {
-        return type;
+    public List<Type> clusterTypes() {

Review Comment:
   `Set` is better since we don't want to run duplicate clusters



##########
tools/src/test/java/org/apache/kafka/tools/MetadataQuorumCommandTest.java:
##########
@@ -86,7 +87,7 @@ public void testDescribeQuorumReplicationSuccessful() throws 
InterruptedExceptio
         assertEquals(cluster.config().numControllers() - 1, 
outputs.stream().filter(o -> followerPattern.matcher(o).find()).count());
 
         Pattern observerPattern = 
Pattern.compile("\\d+\\s+\\d+\\s+\\d+\\s+[\\dmsago\\s]+-?[\\dmsago\\s]+Observer\\s*");
-        if (cluster.config().clusterType() == Type.CO_KRAFT)
+        if 
(cluster.config().clusterTypes().equals(Collections.singletonList(Type.CO_KRAFT)))

Review Comment:
   `cluster.config().clusterTypes().contains(Type.CO_KRAFT)`



##########
tools/src/test/java/org/apache/kafka/tools/MetadataQuorumCommandTest.java:
##########
@@ -100,12 +101,12 @@ public void testDescribeQuorumReplicationSuccessful() 
throws InterruptedExceptio
      * 3. Fewer brokers than controllers
      */
     @ClusterTests({
-        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 2, controllers = 
2),
-        @ClusterTest(clusterType = Type.KRAFT, brokers = 2, controllers = 2),
-        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 2, controllers = 
1),
-        @ClusterTest(clusterType = Type.KRAFT, brokers = 2, controllers = 1),
-        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 1, controllers = 
2),
-        @ClusterTest(clusterType = Type.KRAFT, brokers = 1, controllers = 2)
+        @ClusterTest(clusterTypes = {Type.CO_KRAFT}, brokers = 2, controllers 
= 2),

Review Comment:
   ditto



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