Skip to content

Commit

Permalink
Merge pull request #12 from daisukebe/main
Browse files Browse the repository at this point in the history
rpadmin: add TriggerBalancer method
  • Loading branch information
daisukebe authored Aug 14, 2024
2 parents a0e2fec + aa3b205 commit 5a00908
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rpadmin/api_partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,8 @@ func (a *AdminAPI) TransferLeadership(ctx context.Context, ns, topic string, par
path := fmt.Sprintf("/v1/partitions/%s/%s/%d/transfer_leadership?target=%s", ns, topic, partition, target)
return a.sendOne(ctx, http.MethodPost, path, nil, nil, false)
}

// Trigger on-demand balancer.
func (a *AdminAPI) TriggerBalancer(ctx context.Context) error {
return a.sendToLeader(ctx, http.MethodPost, "/v1/partitions/rebalance", nil, nil)
}

0 comments on commit 5a00908

Please sign in to comment.