Re: Get replication and partition count of a topic

2015-03-25 Thread srikannan
Ewen Cheslack-Postava ewen@... 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){

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.SetString topics = new HashSetString(); topics.add(topicName); SetTopicMetadata topicMetadatas =

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

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 ku...@nmsworks.co.in wrote: Hi, kafka-topics.sh script can be used to retrieve topic