Skip to content

Commit

Permalink
add var for leader id
Browse files Browse the repository at this point in the history
  • Loading branch information
travisjeffery committed Feb 13, 2017
1 parent fee05bf commit 2ce0047
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions broker/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,12 @@ func (b *Broker) CreateTopic(topic string, partitions int32) error {

for i := int32(0); i < partitions; i++ {
// TODO: need to know replica assignment here
leader := c[i%cLen].ID
partition := &jocko.Partition{
Topic: topic,
ID: i,
Leader: c[i%cLen].ID,
PreferredLeader: c[i%cLen].ID,
Leader: leader,
PreferredLeader: leader,
Replicas: []int32{},
}
if err := b.AddPartition(partition); err != nil {
Expand Down

0 comments on commit 2ce0047

Please sign in to comment.