MCPcopy
hub / github.com/IBM/sarama / findAnyBroker

Method findAnyBroker

admin.go:486–493  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

484}
485
486func (ca *clusterAdmin) findAnyBroker() (*Broker, error) {
487 brokers := ca.client.Brokers()
488 if len(brokers) > 0 {
489 index := rand.Intn(len(brokers))
490 return brokers[index], nil
491 }
492 return nil, errors.New("no available broker")
493}
494
495func (ca *clusterAdmin) ListTopics() (map[string]TopicDetail, error) {
496 // In order to build TopicDetails we need to first get the list of all

Callers 4

ListTopicsMethod · 0.95
DescribeConfigsMethod · 0.95
AlterConfigMethod · 0.95

Calls 1

BrokersMethod · 0.65

Tested by

no test coverage detected