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

Method SetLeader

mockresponses.go:158–166  ·  view source on GitHub ↗
(topic string, partition, brokerID int32)

Source from the content-addressed store, hash-verified

156}
157
158func (mmr *MockMetadataResponse) SetLeader(topic string, partition, brokerID int32) *MockMetadataResponse {
159 partitions := mmr.leaders[topic]
160 if partitions == nil {
161 partitions = make(map[int32]int32)
162 mmr.leaders[topic] = partitions
163 }
164 partitions[partition] = brokerID
165 return mmr
166}
167
168func (mmr *MockMetadataResponse) SetBroker(addr string, brokerID int32) *MockMetadataResponse {
169 mmr.brokers[addr] = brokerID

Calls

no outgoing calls