lib/kafka/cluster.rb
def partitions_for(topic)
      add_target_topics([topic])
      refresh_metadata_if_necessary!
      cluster_info.partitions_for(topic)
    rescue Kafka::ProtocolError
      mark_as_stale!
      raise
    end
# Initializes a Cluster with a set of seed brokers.
#
# The cluster will try to fetch cluster metadata from one of the brokers.
#
# @param seed_brokers [Array<URI>]
# @param broker_pool [Kafka::BrokerPool]
# @param logger [Logger]
Initializes a Cluster with a set of seed brokers.
The cluster will try to fetch cluster metadata from one of the brokers.
Initializes a Cluster with a set of seed brokers . The cluster will try to fetch cluster metadata from one of the brokers .
def partitions_for(topic)
      add_target_topics([topic])
      refresh_metadata_if_necessary!
      cluster_info.partitions_for(topic)
    rescue Kafka::ProtocolError
      mark_as_stale!
      raise
    end
def partitions_for ( topic ) add_target_topics ( [ topic ] ) refresh_metadata_if_necessary! cluster_info . partitions_for ( topic ) rescue Kafka :: ProtocolError mark_as_stale! raise end
Initializes a Cluster with a set of seed brokers.
Initializes a Cluster with a set of seed brokers .
topic
None