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


##########
connect/runtime/src/main/java/org/apache/kafka/connect/util/TopicAdmin.java:
##########
@@ -399,7 +398,7 @@ public TopicCreationResponse createOrFindTopics(NewTopic... 
topics) {
             }
         }
         if (topicsByName.isEmpty()) return EMPTY_CREATION;
-        String topicNameList = Utils.join(topicsByName.keySet(), "', '");
+        String topicNameList = String.join("', '", 
topicsByName.keySet()).replace("[", "").replace("]", "");

Review Comment:
   Why we need those `replace`?



##########
connect/runtime/src/main/java/org/apache/kafka/connect/util/TopicAdmin.java:
##########
@@ -630,7 +629,7 @@ public Map<String, Config> describeTopicConfigs(String... 
topicNames) {
         if (topics.isEmpty()) {
             return Collections.emptyMap();
         }
-        String topicNameList = String.join(", ", topics);
+        String topicNameList = String.join(", ", topics).replace("[", 
"").replace("]", "");

Review Comment:
   ditto



##########
connect/runtime/src/main/java/org/apache/kafka/connect/util/TopicAdmin.java:
##########
@@ -475,7 +474,7 @@ public Map<String, TopicDescription> 
describeTopics(String... topics) {
         if (topics == null) {
             return Collections.emptyMap();
         }
-        String topicNameList = String.join(", ", topics);
+        String topicNameList = String.join(", ", topics).replace("[", 
"").replace("]", "");

Review Comment:
   ditto



##########
storage/src/test/java/org/apache/kafka/tiered/storage/TieredStorageTestContext.java:
##########
@@ -216,7 +217,7 @@ public List<ConsumerRecord<String, String>> 
consume(TopicPartition topicPartitio
         Function0<String> messageSupplier = () ->
                 String.format("Could not consume %d records of %s from offset 
%d in %d ms. %d message(s) consumed:%s%s",
                         expectedTotalCount, topicPartition, fetchOffset, 
timeoutMs, records.size(), sep,
-                        Utils.join(records, sep));
+                        String.join(sep, Arrays.toString(records.toArray())));

Review Comment:
   `records.stream().map(Object::toString).collect(Collectors.joining(","))`



##########
tools/src/main/java/org/apache/kafka/tools/MetadataQuorumCommand.java:
##########
@@ -230,8 +231,8 @@ else if (leader.lastCaughtUpTimestamp().isPresent() && 
maxLagFollower.lastCaught
             "\nHighWatermark:          " + quorumInfo.highWatermark() +
             "\nMaxFollowerLag:         " + maxFollowerLag +
             "\nMaxFollowerLagTimeMs:   " + maxFollowerLagTimeMs +
-            "\nCurrentVoters:          " + 
Utils.mkString(quorumInfo.voters().stream().map(v -> v.replicaId()), "[", "]", 
",") +
-            "\nCurrentObservers:       " + 
Utils.mkString(quorumInfo.observers().stream().map(v -> v.replicaId()), "[", 
"]", ",")
+            "\nCurrentVoters:          " + "[" + 
quorumInfo.voters().stream().map(QuorumInfo.ReplicaState::replicaId).map(Object::toString).collect(Collectors.joining(","))
 + "]" +

Review Comment:
   
`quorumInfo.voters().stream().map(QuorumInfo.ReplicaState::replicaId).map(Object::toString).collect(Collectors.joining(",",
 "[", "]"))`



##########
tools/src/main/java/org/apache/kafka/tools/MetadataQuorumCommand.java:
##########
@@ -230,8 +231,8 @@ else if (leader.lastCaughtUpTimestamp().isPresent() && 
maxLagFollower.lastCaught
             "\nHighWatermark:          " + quorumInfo.highWatermark() +
             "\nMaxFollowerLag:         " + maxFollowerLag +
             "\nMaxFollowerLagTimeMs:   " + maxFollowerLagTimeMs +
-            "\nCurrentVoters:          " + 
Utils.mkString(quorumInfo.voters().stream().map(v -> v.replicaId()), "[", "]", 
",") +
-            "\nCurrentObservers:       " + 
Utils.mkString(quorumInfo.observers().stream().map(v -> v.replicaId()), "[", 
"]", ",")
+            "\nCurrentVoters:          " + "[" + 
quorumInfo.voters().stream().map(QuorumInfo.ReplicaState::replicaId).map(Object::toString).collect(Collectors.joining(","))
 + "]" +
+            "\nCurrentObservers:       " + "[" + 
quorumInfo.observers().stream().map(QuorumInfo.ReplicaState::replicaId).map(Objects::toString).collect(Collectors.joining(","))
 + "]"

Review Comment:
   ditto



##########
trogdor/src/main/java/org/apache/kafka/trogdor/workload/RoundTripWorker.java:
##########
@@ -318,7 +320,7 @@ void log() {
                 }
             }
             log.info("{}: consumer waiting for {} message(s), starting with: 
{}",
-                id, numToReceive, Utils.join(list, ", "));
+                id, numToReceive, String.join(", ", 
Arrays.toString(list.toArray())));

Review Comment:
   ditto



##########
tools/src/main/java/org/apache/kafka/tools/reassign/ReassignPartitionsCommand.java:
##########
@@ -488,12 +488,12 @@ private static void clearAllThrottles(Admin adminClient,
         targetParts.forEach(t -> brokers.addAll(t.getValue()));
 
         System.out.printf("Clearing broker-level throttles on broker%s %s%n",
-            brokers.size() == 1 ? "" : "s", Utils.join(brokers, ","));
+            brokers.size() == 1 ? "" : "s", String.join(",", 
Arrays.toString(brokers.toArray())));

Review Comment:
   `brokers.stream().map(Object::toString).collect(Collectors.joining(","))`



##########
trogdor/src/main/java/org/apache/kafka/trogdor/fault/ProcessStopFaultWorker.java:
##########
@@ -80,7 +80,7 @@ private void sendSignals(Platform platform, String 
signalName) throws Exception
                 id, javaProcessName, signalName);
         } else {
             log.info("{}: sending {} to {} pid(s) {}",
-                id, signalName, javaProcessName, Utils.join(pids, ", "));
+                id, signalName, javaProcessName, String.join(", ", 
Arrays.toString(pids.toArray())));

Review Comment:
   `pids.stream().map(Object::toString).collect(Collectors.joining(","))`



##########
server/src/main/java/org/apache/kafka/server/config/ReplicationConfigs.java:
##########
@@ -116,7 +115,7 @@ public class ReplicationConfigs {
     public static final String INTER_BROKER_SECURITY_PROTOCOL_DEFAULT = 
SecurityProtocol.PLAINTEXT.toString();
     public static final String INTER_BROKER_LISTENER_NAME_CONFIG = 
"inter.broker.listener.name";
     public static final String INTER_BROKER_SECURITY_PROTOCOL_DOC = "Security 
protocol used to communicate between brokers. Valid values are: " +
-            Utils.join(SecurityProtocol.names(), ", ") + ". It is an error to 
set this and " + INTER_BROKER_LISTENER_NAME_CONFIG +
+            String.join(", ", SecurityProtocol.names()).replace("[", 
"").replace("]", "") + ". It is an error to set this and " + 
INTER_BROKER_LISTENER_NAME_CONFIG +

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