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

Method getOrCreateBlock

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

Source from the content-addressed store, hash-verified

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

Callers 7

ForMethod · 0.95
SetLastOffsetDeltaMethod · 0.95
SetLastStableOffsetMethod · 0.95

Calls

no outgoing calls

Tested by 1

ForMethod · 0.76