()
| 325 | } |
| 326 | |
| 327 | func (r *OffsetFetchRequest) ZeroPartitions() { |
| 328 | if r.Version >= 8 { |
| 329 | if len(r.Groups) == 0 { |
| 330 | r.Groups = []OffsetFetchRequestGroup{{GroupId: r.ConsumerGroup}} |
| 331 | } |
| 332 | if r.Groups[0].Partitions == nil { |
| 333 | r.Groups[0].Partitions = make(map[string][]int32) |
| 334 | } |
| 335 | return |
| 336 | } |
| 337 | if r.partitions == nil && r.Version >= 2 { |
| 338 | r.partitions = make(map[string][]int32) |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | // AddPartition appends a partition to the request. On v8+ it targets Groups[0] |
| 343 | // (seeded from ConsumerGroup if needed); use AddGroupPartition for v8 batches. |
no outgoing calls