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

Method AddTopicPartition

produce_response.go:322–338  ·  view source on GitHub ↗

Testing API

(topic string, partition int32, err KError)

Source from the content-addressed store, hash-verified

320// Testing API
321
322func (r *ProduceResponse) AddTopicPartition(topic string, partition int32, err KError) {
323 if r.Blocks == nil {
324 r.Blocks = make(map[string]map[int32]*ProduceResponseBlock)
325 }
326 byTopic, ok := r.Blocks[topic]
327 if !ok {
328 byTopic = make(map[int32]*ProduceResponseBlock)
329 r.Blocks[topic] = byTopic
330 }
331 block := &ProduceResponseBlock{
332 Err: err,
333 }
334 if r.Version >= 2 {
335 block.Timestamp = time.Now()
336 }
337 byTopic[partition] = block
338}

Calls

no outgoing calls