MCPcopy Create free account
hub / github.com/IBM/sarama / ZeroPartitions

Method ZeroPartitions

offset_fetch_request.go:327–340  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

325}
326
327func (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.

Callers 1

Calls

no outgoing calls

Tested by 1