[#227] netmap: Do not export bucket weight calculator

`GetBucketWeight` is not usable outside placement context.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2022-06-07 09:03:50 +03:00 committed by LeL
parent 86bdc670d5
commit 5bfdb64251
2 changed files with 3 additions and 3 deletions

View file

@ -74,8 +74,8 @@ const (
AttrContinent = "Continent"
)
// GetBucketWeight computes weight for a Bucket.
func GetBucketWeight(ns nodes, a aggregator, wf weightFunc) float64 {
// calcBucketWeight computes weight for a Bucket.
func calcBucketWeight(ns nodes, a aggregator, wf weightFunc) float64 {
for i := range ns {
a.Add(wf(ns[i]))
}

View file

@ -97,7 +97,7 @@ func (c *context) getSelection(p *PlacementPolicy, s *Selector) ([]nodes, error)
if len(c.pivot) != 0 {
weights := make([]float64, len(res))
for i := range res {
weights[i] = GetBucketWeight(res[i], c.aggregator(), c.weightFunc)
weights[i] = calcBucketWeight(res[i], c.aggregator(), c.weightFunc)
}
hrw.SortSliceByWeightValue(res, weights, c.pivotHash)