(topic string, partition int32)
| 598 | } |
| 599 | |
| 600 | func (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 | |
| 618 | func encodeKV(key, value Encoder) ([]byte, []byte) { |
| 619 | var kb []byte |
no outgoing calls