org.apache.hadoop.hbase.master.balancer
Class StochasticLoadBalancer.CostFunction

java.lang.Object
  extended by org.apache.hadoop.hbase.master.balancer.StochasticLoadBalancer.CostFunction
Direct Known Subclasses:
StochasticLoadBalancer.CostFromRegionLoadFunction, StochasticLoadBalancer.LocalityCostFunction, StochasticLoadBalancer.MoveCostFunction, StochasticLoadBalancer.RegionCountSkewCostFunction, StochasticLoadBalancer.TableSkewCostFunction
Enclosing class:
StochasticLoadBalancer

public abstract static class StochasticLoadBalancer.CostFunction
extends Object

Base class of StochasticLoadBalancer's Cost Functions.


Method Summary
protected  double costFromArray(double[] stats)
          Function to compute a scaled cost using DescriptiveStatistics.
protected  double scale(double min, double max, double value)
          Scale the value between 0 and 1.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

costFromArray

protected double costFromArray(double[] stats)
Function to compute a scaled cost using DescriptiveStatistics. It assumes that this is a zero sum set of costs. It assumes that the worst case possible is all of the elements in one region server and the rest having 0.

Parameters:
stats - the costs
Returns:
a scaled set of costs.

scale

protected double scale(double min,
                       double max,
                       double value)
Scale the value between 0 and 1.

Parameters:
min - Min value
max - The Max value
value - The value to be scaled.
Returns:
The scaled value.


Copyright © 2007–2015 The Apache Software Foundation. All rights reserved.