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

Method getOrCreateBlock

fetch_response.go:600–616  ·  view source on GitHub ↗
(topic string, partition int32)

Source from the content-addressed store, hash-verified

598}
599
600func (r *FetchResponse) getOrCreateBlock(topic string, partition int32) *FetchResponseBlock {
601 if r.Blocks == nil {
602 r.Blocks = make(map[string]map[int32]*FetchResponseBlock)
603 }
604 partitions, ok := r.Blocks[topic]
605 if !ok {
606 partitions = make(map[int32]*FetchResponseBlock)
607 r.Blocks[topic] = partitions
608 }
609 frb, ok := partitions[partition]
610 if !ok {
611 frb = new(FetchResponseBlock)
612 partitions[partition] = frb
613 }
614
615 return frb
616}
617
618func encodeKV(key, value Encoder) ([]byte, []byte) {
619 var kb []byte

Callers 7

ForMethod · 0.95
SetLastOffsetDeltaMethod · 0.95
SetLastStableOffsetMethod · 0.95

Calls

no outgoing calls

Tested by 1

ForMethod · 0.76