You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Ismael Juma (JIRA)" <ji...@apache.org> on 2018/02/08 21:12:00 UTC

[jira] [Commented] (KAFKA-6545) AdminUtils.fetchTopicMetadataFromZk is not available in 1.0.0

    [ https://issues.apache.org/jira/browse/KAFKA-6545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16357577#comment-16357577 ] 

Ismael Juma commented on KAFKA-6545:
------------------------------------

The commit description states why they were removed (they were internal APIs with no tests). The alternative is to use AdminClient (a public and supported API): https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/clients/admin/AdminClient.java

> AdminUtils.fetchTopicMetadataFromZk is not available in 1.0.0
> -------------------------------------------------------------
>
>                 Key: KAFKA-6545
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6545
>             Project: Kafka
>          Issue Type: Bug
>          Components: admin
>    Affects Versions: 1.0.0
>            Reporter: Chong Wang
>            Priority: Major
>
> Not sure why this function is deleted ([https://github.com/apache/kafka/commit/1d24e10aeab616eede416201336e928b9a8efa98#diff-5d4a4a97554d3ac24efe68d98eb27b64)]
> Our code was relying on it.
> {quote}final MetadataResponse.TopicMetadata topicMetadata = AdminUtils.fetchTopicMetadataFromZk(topicName, zkUtils);
>  final Topic topic = new Topic();
>  topic.setPartitions(topicMetadata.partitionMetadata().size());
>  final int replicas = topicMetadata.partitionMetadata().stream().mapToInt(e -> e.replicas().size()).sum();
>  topic.setReplications(replicas);
> {quote}
> Is there any alternatives?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)