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


##########
tools/src/test/java/org/apache/kafka/tools/consumer/group/ConsumerGroupCommandTestUtils.java:
##########
@@ -74,16 +75,18 @@ static void generator(ClusterGenerator clusterGenerator) {
         // Following are test case config with new group coordinator
         serverProperties.put(NEW_GROUP_COORDINATOR_ENABLE_CONFIG, "true");
 
+        String[] array = {"newGroupCoordinator"};
+        ArrayList<String> tags = new ArrayList<>(Arrays.asList(array));
         ClusterConfig raftWithNewGroupCoordinator = 
ClusterConfig.defaultBuilder()
                 .setType(KRAFT)
-                .setName("newGroupCoordinator")
+                .setTags(tags)

Review Comment:
   ` .setTags(Collections.singletonList("newGroupCoordinator"))`



##########
core/src/test/java/kafka/test/ClusterConfig.java:
##########
@@ -306,11 +302,16 @@ public Builder setPerBrokerProperties(Map<Integer, 
Map<String, String>> perBroke
             return this;
         }
 
+        public Builder setTags(List<String> tags) {
+            this.tags = tags;

Review Comment:
   `this.tags = Collections.unmodifiableList(new ArrayList<>(tags));`
   



##########
core/src/test/java/kafka/test/ClusterConfig.java:
##########
@@ -153,13 +150,17 @@ public Map<Integer, Map<String, String>> 
perBrokerOverrideProperties() {
         return perBrokerOverrideProperties;
     }
 
-    public Map<String, String> nameTags() {
-        Map<String, String> tags = new LinkedHashMap<>(4);
-        name().ifPresent(name -> tags.put("Name", name));
-        tags.put("MetadataVersion", metadataVersion.toString());
-        tags.put("Security", securityProtocol.name());
-        listenerName().ifPresent(listener -> tags.put("Listener", listener));
-        return tags;
+    public Optional<List<String>> tags() {

Review Comment:
   ```java
       public List<String> tags() {
           return tags;
       }
   ```



##########
core/src/test/java/kafka/test/ClusterConfigTest.java:
##########
@@ -44,13 +45,15 @@ private static Map<String, Object> fields(ClusterConfig 
config) {
     @Test
     public void testCopy() throws IOException {
         File trustStoreFile = TestUtils.tempFile();
+        String[] array = {"name", "Generated Test"};
+        ArrayList<String> tags = new ArrayList<>(Arrays.asList(array));
 
         ClusterConfig clusterConfig = ClusterConfig.builder()
                 .setType(Type.KRAFT)
                 .setBrokers(3)
                 .setControllers(2)
                 .setDisksPerBroker(1)
-                .setName("builder-test")
+                .setTags(tags)

Review Comment:
   `Arrays.asList("name", "Generated Test")`



##########
core/src/test/java/kafka/test/ClusterConfig.java:
##########
@@ -83,6 +83,7 @@ private ClusterConfig(Type type, int brokers, int 
controllers, int disksPerBroke
         this.saslServerProperties = 
Objects.requireNonNull(saslServerProperties);
         this.saslClientProperties = 
Objects.requireNonNull(saslClientProperties);
         this.perBrokerOverrideProperties = 
Objects.requireNonNull(perBrokerOverrideProperties);
+        this.tags = tags;

Review Comment:
   `Objects.requireNonNull(tags);`



##########
core/src/test/java/kafka/test/ClusterConfig.java:
##########
@@ -153,13 +150,17 @@ public Map<Integer, Map<String, String>> 
perBrokerOverrideProperties() {
         return perBrokerOverrideProperties;
     }
 
-    public Map<String, String> nameTags() {
-        Map<String, String> tags = new LinkedHashMap<>(4);
-        name().ifPresent(name -> tags.put("Name", name));
-        tags.put("MetadataVersion", metadataVersion.toString());
-        tags.put("Security", securityProtocol.name());
-        listenerName().ifPresent(listener -> tags.put("Listener", listener));
-        return tags;
+    public Optional<List<String>> tags() {
+        return Optional.ofNullable(tags);
+    }
+
+    public Set<String> displayTags() {
+        Set<String> displayTags = new LinkedHashSet<>(4);

Review Comment:
   `Set<String> displayTags = new LinkedHashSet<>(tags);`



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