lucliu1108 commented on code in PR #20157:
URL: https://github.com/apache/kafka/pull/20157#discussion_r2202883337


##########
tools/src/main/java/org/apache/kafka/tools/streams/StreamsGroupCommand.java:
##########
@@ -830,6 +831,21 @@ Map<String, List<String>> 
retrieveInternalTopics(List<String> groupIds) {
                 }
             } catch (InterruptedException | ExecutionException e) {
                 if (e.getCause() instanceof UnsupportedVersionException) {
+                    List<String> internalTopics = new ArrayList<>();
+                    try {
+                        Set<String> allTopics = 
adminClient.listTopics().names().get();
+                        for (String topic : allTopics) {
+                            for (String groupId : groupIds) {
+                                if (isInferredInternalTopic(topic, groupId)) {
+                                    internalTopics.add(topic);
+                                    break;
+                                }
+                            }
+                        }
+                        System.out.println("Internal Topics: (" + 
String.join(",", internalTopics) + ").");

Review Comment:
   Thanks for the comment! Just revised the method:
   1. use Stream API
   2. Combine print internal topics in the `printError` message.



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