[
https://issues.apache.org/jira/browse/KAFKA-6640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16399498#comment-16399498
]
ASF GitHub Bot commented on KAFKA-6640:
---
hachikuji closed pull request #4694: KAFKA-6640; Improve efficiency of
KafkaAdminClient.describeTopics()
URL: https://github.com/apache/kafka/pull/4694
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java
b/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java
index 36cbe6cad00..e455b9ce81c 100644
--- a/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java
+++ b/clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java
@@ -1276,15 +1276,16 @@ public DescribeTopicsResult describeTopics(final
Collection topicNames,
void handleResponse(AbstractResponse abstractResponse) {
MetadataResponse response = (MetadataResponse)
abstractResponse;
// Handle server responses for particular topics.
+Cluster cluster = response.cluster();
+Map errors = response.errors();
for (Map.Entry>
entry : topicFutures.entrySet()) {
String topicName = entry.getKey();
KafkaFutureImpl future =
entry.getValue();
-Errors topicError = response.errors().get(topicName);
+Errors topicError = errors.get(topicName);
if (topicError != null) {
future.completeExceptionally(topicError.exception());
continue;
}
-Cluster cluster = response.cluster();
if (!cluster.topics().contains(topicName)) {
future.completeExceptionally(new
InvalidTopicException("Topic " + topicName + " not found."));
continue;
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org
> Improve efficiency of KafkaAdminClient.describeTopics()
> ---
>
> Key: KAFKA-6640
> URL: https://issues.apache.org/jira/browse/KAFKA-6640
> Project: Kafka
> Issue Type: Improvement
>Reporter: Dong Lin
>Assignee: Dong Lin
>Priority: Major
>
> Currently in KafkaAdminClient.describeTopics(), for each topic in the
> request, an complete map of cluster and errors will be constructed for every
> topic and partition. This unnecessarily increases the complexity of
> describeTopics() to O(n^2).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)