public abstract static class StochasticLoadBalancer.CostFunction extends Object
Modifier and Type | Method and Description |
---|---|
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.
|
protected double costFromArray(double[] stats)
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.stats
- the costsprotected double scale(double min, double max, double value)
min
- Min valuemax
- The Max valuevalue
- The value to be scaled.Copyright © 2014 The Apache Software Foundation. All rights reserved.