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

Method AddGroupBlock

offset_fetch_response.go:455–466  ·  view source on GitHub ↗

AddGroupBlock adds a block for groupID/topic/partition, creating the group entry if needed. On v0-7 it falls back to AddBlock and ignores groupID.

(groupID string, topic string, partition int32, block *OffsetFetchResponseBlock)

Source from the content-addressed store, hash-verified

453// AddGroupBlock adds a block for groupID/topic/partition, creating the group
454// entry if needed. On v0-7 it falls back to AddBlock and ignores groupID.
455func (r *OffsetFetchResponse) AddGroupBlock(groupID string, topic string, partition int32, block *OffsetFetchResponseBlock) {
456 if r.Version < 8 {
457 r.AddBlock(topic, partition, block)
458 return
459 }
460 group := r.GetGroup(groupID)
461 if group == nil {
462 r.Groups = append(r.Groups, OffsetFetchResponseGroup{GroupId: groupID})
463 group = &r.Groups[len(r.Groups)-1]
464 }
465 group.AddBlock(topic, partition, block)
466}

Calls 2

AddBlockMethod · 0.95
GetGroupMethod · 0.95

Tested by 1