Re: Get replication and partition count of a topic

2015-03-25 Thread srikannan
Ewen Cheslack-Postava writes: Im also searching the shortest way to find topic partition count, so that the initialization code in the thread pool can set up the right number of threads. so far i found below is the shortest way. public static void main(String[] args){

Re: Get replication and partition count of a topic

2015-01-12 Thread Ewen Cheslack-Postava
I think the closest thing to what you want is ZkUtils.getPartitionsForTopics, which returns a list of partition IDs for each topic you specify. -Ewen On Mon, Jan 12, 2015 at 12:55 AM, Manikumar Reddy wrote: > Hi, > > kafka-topics.sh script can be used to retrieve topic information. > > Ex: sh k

Re: Get replication and partition count of a topic

2015-01-12 Thread Manikumar Reddy
Hi, kafka-topics.sh script can be used to retrieve topic information. Ex: sh kafka-topics.sh --zookeeper localhost:2181 --describe --topic TOPIC1 You can look into TopicCommand.scala code https://git-wip-us.apache.org/repos/asf?p=kafka.git;a=blob;f=core/src/main/scala/kafka/admin/TopicCommand.sc

Get replication and partition count of a topic

2015-01-12 Thread Ankit Jain
Hi All, I want to get the replication and partition count of a topic. I tried the following piece of code: java.util.Set topics = new HashSet(); topics.add("topicName"); Set topicMetadatas = AdminUtils.fetchTopicMetadataFromZk(JavaConversions.asScalaSet(topics), zkCli