Skip to content

Commit

Permalink
add LeastBytes balancer (be explicit about no risks of overflow)
Browse files Browse the repository at this point in the history
  • Loading branch information
Achille Roussel committed Jun 20, 2017
1 parent 27321f0 commit ea25e09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (lb *LeastBytes) Balance(msg Message, partitions ...int) int {
}

c := &lb.counters[minIndex]
c.bytes += uint64(len(msg.Key) + len(msg.Value))
c.bytes += uint64(len(msg.Key)) + uint64(len(msg.Value))
return c.partition
}

Expand Down

0 comments on commit ea25e09

Please sign in to comment.