CalvinConfluent commented on code in PR #15470: URL: https://github.com/apache/kafka/pull/15470#discussion_r1526680281
########## clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java: ########## @@ -2185,9 +2179,143 @@ void handleFailure(Throwable throwable) { completeAllExceptionally(topicFutures.values(), throwable); } }; - if (!topicNamesList.isEmpty()) { - runnable.call(call, now); + return call; + } + + @SuppressWarnings({"MethodLength", "NPathComplexity"}) Review Comment: The handlerResponse still reports NPathComplexity after splitting the method, but it is not worth splitting that method further. Only apply the NPathComplexity suppress there. ########## clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java: ########## @@ -2256,6 +2384,26 @@ void handleFailure(Throwable throwable) { return new HashMap<>(topicFutures); } + private TopicDescription getTopicDescriptionFromDescribeTopicsResponseTopic( + DescribeTopicPartitionsResponseTopic topic, + Map<Integer, Node> nodes + ) { + List<DescribeTopicPartitionsResponsePartition> partitionInfos = topic.partitions(); + List<TopicPartitionInfo> partitions = new ArrayList<>(partitionInfos.size()); + for (DescribeTopicPartitionsResponsePartition partitionInfo : partitionInfos) { + TopicPartitionInfo topicPartitionInfo = new TopicPartitionInfo( + partitionInfo.partitionIndex(), + nodes.get(partitionInfo.leaderId()), + partitionInfo.replicaNodes().stream().map(id -> nodes.get(id)).collect(Collectors.toList()), + partitionInfo.isrNodes().stream().map(id -> nodes.get(id)).collect(Collectors.toList()), + partitionInfo.eligibleLeaderReplicas().stream().map(id -> nodes.get(id)).collect(Collectors.toList()), + partitionInfo.lastKnownElr().stream().map(id -> nodes.get(id)).collect(Collectors.toList())); Review Comment: Done. -- 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