-
Notifications
You must be signed in to change notification settings - Fork 25k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify rebalancer's weight function (#51632)
This commit inlines the `weightShardAdded` and `weightShardRemoved` methods from the `BalancedShardsAllocator#WeightFunction` that respectively add and subtract 1 (±ε) from the result of `weight`. It then follows up with a number of simplifications that this inlining enables. As a side-effect it also somewhat reduces the number of calls to canRebalance and canAllocate during rebalancing when there are multiple shards of the same index on a node that is heavier than average.
- Loading branch information
1 parent
6209962
commit 635fe34
Showing
1 changed file
with
58 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters