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

Method Add

balance_strategy.go:33–41  ·  view source on GitHub ↗

Add assigns a topic with a number partitions to a member.

(memberID, topic string, partitions ...int32)

Source from the content-addressed store, hash-verified

31
32// Add assigns a topic with a number partitions to a member.
33func (p BalanceStrategyPlan) Add(memberID, topic string, partitions ...int32) {
34 if len(partitions) == 0 {
35 return
36 }
37 if _, ok := p[memberID]; !ok {
38 p[memberID] = make(map[string][]int32, 1)
39 }
40 p[memberID][topic] = append(p[memberID][topic], partitions...)
41}
42
43// --------------------------------------------------------------------
44

Callers 3

NewBalanceStrategyRangeFunction · 0.45
PlanMethod · 0.45
PlanMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected