You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Biju N <bi...@gmail.com> on 2019/04/17 11:28:34 UTC

Stochastic Load Balancer - Cost calculation

Hi All,
   Trying to understand the CostFromArray method in Stochastic load
balancer class (
https://github.com/apache/hbase/blob/baf3ae80f5588ee848176adefc9f56818458a387/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java#L1039)
and in particular the calculation for max and min used to scale the cost
value. For e.g.

// Compute max as if all region servers had 0 and one had the sum of all
costs.  This must be

// a zero sum cost for this to make sense.

double max = ((count - 1) * mean) + (total - mean);

The max value based on this calculation will be close to double the total
of all costs passed in the array. But the comment seem to imply that the
max should the be sum of all the costs in the array (I may be wrong). If
anyone can provide some guidance in understanding the reasoning behind the
max/min calculation or provide any other reference it would be very
helpful. Appreciate your help in advance.

Thank you,
Biju