Method: Kafka::Client#partitions_for

Defined in:
lib/kafka/client.rb

#partitions_for(topic) ⇒ Integer

Counts the number of partitions in a topic.

Parameters:

  • topic (String)

Returns:

  • (Integer)

    the number of partitions in the topic.



739
740
741
# File 'lib/kafka/client.rb', line 739

def partitions_for(topic)
  @cluster.partitions_for(topic).count
end