This is a best effort load balancer. Given a Cost function F(C) => x It will
randomly try and mutate the cluster to Cprime. If F(Cprime) < F(C) then the
new cluster state becomes the plan. It includes costs functions to compute the cost of:

Region Load

Table Load

Data Locality

Memstore Sizes

Storefile Sizes

Every cost function returns a number between 0 and 1 inclusive; where 0 is the lowest cost
best solution, and 1 is the highest possible cost and the worst solution. The computed costs are
scaled by their respective multipliers:

hbase.master.balancer.stochastic.regionLoadCost

hbase.master.balancer.stochastic.moveCost

hbase.master.balancer.stochastic.tableLoadCost

hbase.master.balancer.stochastic.localityCost

hbase.master.balancer.stochastic.memstoreSizeCost

hbase.master.balancer.stochastic.storefileSizeCost

In addition to the above configurations, the balancer can be tuned by the following
configuration values:

hbase.master.balancer.stochastic.maxMoveRegions which
controls what the max number of regions that can be moved in a single invocation of this
balancer.

hbase.master.balancer.stochastic.stepsPerRegion is the coefficient by which the number of
regions is multiplied to try and get the number of times the balancer will
mutate all servers.

hbase.master.balancer.stochastic.maxSteps which controls the maximum number of times that
the balancer will try and mutate all the servers. The balancer will use the minimum of this
value and the above computation.

This balancer is best used with hbase.master.loadbalance.bytable set to false
so that the balancer gets the full picture of all loads on the cluster.

Method Summary

Subclasses should implement this to return true if the cluster has nodes that hosts
multiple replicas for the same region, or, if there are multiple racks and the same
rack hosts replicas of the same region

areSomeRegionReplicasColocated

Subclasses should implement this to return true if the cluster has nodes that hosts
multiple replicas for the same region, or, if there are multiple racks and the same
rack hosts replicas of the same region