(topic string, partition, brokerID int32)
| 156 | } |
| 157 | |
| 158 | func (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 | |
| 168 | func (mmr *MockMetadataResponse) SetBroker(addr string, brokerID int32) *MockMetadataResponse { |
| 169 | mmr.brokers[addr] = brokerID |
no outgoing calls