mumrah commented on code in PR #15470: URL: https://github.com/apache/kafka/pull/15470#discussion_r1551680241
########## clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java: ########## @@ -2185,9 +2185,157 @@ void handleFailure(Throwable throwable) { completeAllExceptionally(topicFutures.values(), throwable); } }; - if (!topicNamesList.isEmpty()) { - runnable.call(call, now); + } + + Call generateDescribeTopicsCallWithDescribeTopicPartitionsApi( + List<String> topicNamesList, + Map<String, KafkaFutureImpl<TopicDescription>> topicFutures, + Map<Integer, Node> nodes, + DescribeTopicsOptions options, + long now + ) { + Map<String, TopicRequest> topicsRequests = new LinkedHashMap<>(); + topicNamesList.stream().sorted().forEach(topic -> { + topicsRequests.put(topic, new TopicRequest().setName(topic)); + }); + return new Call("describeTopicPartitions", calcDeadlineMs(now, options.timeoutMs()), + new LeastLoadedNodeProvider()) { + Map<String, TopicRequest> pendingTopics = topicsRequests; Review Comment: Why do we need this inner assignment? Can we make `topicsRequest` final in the outer scope? ########## clients/src/main/java/org/apache/kafka/clients/admin/DescribeTopicsOptions.java: ########## @@ -47,8 +49,32 @@ public DescribeTopicsOptions includeAuthorizedOperations(boolean includeAuthoriz return this; } + /** + * Whether to use the DescribeTopicPartitions API. It should be set to false if DescribeTopicPartitions API is + * not supported. + * + */ + public DescribeTopicsOptions useDescribeTopicPartitionsApi(boolean useDescribeTopicPartitionsApi) { + this.useDescribeTopicPartitionsApi = useDescribeTopicPartitionsApi; + return this; + } + + // Note that, partitionSizeLimitPerResponse will not be effective if it is larger than the config + // max.request.partition.size.limit on the server side. Review Comment: @CalvinConfluent can you open a ticket for this so we don't forget about it? -- 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