spark-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Akhil Das <ak...@sigmoidanalytics.com>
Subject Re: getting number of partition per topic in kafka
Date Sat, 03 Jan 2015 17:28:32 GMT
You can use the lowlevel consumer
<http://github.com/dibbhatt/kafka-spark-consumer> for this, it has an API
call
<https://github.com/dibbhatt/kafka-spark-consumer/blob/master/src/main/java/consumer/kafka/DynamicBrokersReader.java#L81>
to retrieve the number of partitions from a topic.

Easiest way would be to count the depth in:

yourZkPath + "/topics/" + topicName + "/partitions"


Thanks
Best Regards

On Sat, Jan 3, 2015 at 1:54 PM, Hafiz Mujadid <hafizmujadid00@gmail.com>
wrote:

> Hi experts!
>
> I am currently working on spark streaming with kafka. I have couple of
> questions related to this task.
>
> 1) Is there a way to find number of partitions given a topic name?
> 2)Is there a way to detect whether kafka server is running or not ?
>
>
> Thanks
>
>
>
>
> --
> View this message in context:
> http://apache-spark-user-list.1001560.n3.nabble.com/getting-number-of-partition-per-topic-in-kafka-tp20952.html
> Sent from the Apache Spark User List mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@spark.apache.org
> For additional commands, e-mail: user-help@spark.apache.org
>
>

Mime
View raw message