Hi All,
I want to get the replication and partition count of a topic. I tried the
following piece of code:
java.util.Set<String> topics = new HashSet<String>();
topics.add("topicName");
Set<TopicMetadata> topicMetadatas =
AdminUtils.fetchTopicMetadataFromZk(JavaConversions.asScalaSet(topics),
zkClient);
Iterator<TopicMetadata> topicMetadataIterator =
topicMetadatas.iterator();
while (topicMetadataIterator.hasNext()) {
topicMetadataIterator.next();
topicMetadataIterator.next().
Iterator<PartitionMetadata> partitionMetadataIterator =
topicMetadataIterator.next().partitionsMetadata().iterator();
}
But, the above code returning me the metadata of each partition and also
replica details of each partition.
Is there any simple API available in kafka to get the partition and replica
count for a topic.
Thanks,
Ankit
________________________________
NOTE: This message may contain information that is confidential, proprietary,
privileged or otherwise protected by law. The message is intended solely for
the named addressee. If received in error, please destroy and notify the
sender. Any use of this email is prohibited when received in error. Impetus
does not represent, warrant and/or guarantee, that the integrity of this
communication has been maintained nor that the communication is free of errors,
virus, interception or interference.