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

Method AddTopicPartition

offset_response.go:257–267  ·  view source on GitHub ↗

testing API

(topic string, partition int32, offset int64)

Source from the content-addressed store, hash-verified

255// testing API
256
257func (r *OffsetResponse) AddTopicPartition(topic string, partition int32, offset int64) {
258 if r.Blocks == nil {
259 r.Blocks = make(map[string]map[int32]*OffsetResponseBlock)
260 }
261 byTopic, ok := r.Blocks[topic]
262 if !ok {
263 byTopic = make(map[int32]*OffsetResponseBlock)
264 r.Blocks[topic] = byTopic
265 }
266 byTopic[partition] = &OffsetResponseBlock{Offsets: []int64{offset}, Offset: offset}
267}

Calls

no outgoing calls