Class RegionCountSkewCostFunction
java.lang.Object
org.apache.hadoop.hbase.master.balancer.CostFunction
org.apache.hadoop.hbase.master.balancer.RegionCountSkewCostFunction
Compute the cost of a potential cluster state from skew in number of regions on a cluster.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final DoubleArrayCost
(package private) static final float
(package private) static final String
Fields inherited from class org.apache.hadoop.hbase.master.balancer.CostFunction
cluster, COST_EPSILON
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected double
cost()
(package private) void
prepare
(BalancerClusterState cluster) Called once per LB invocation to give the cost function to initialize it's state, and perform any costly calculation.protected void
regionMoved
(int region, int oldServer, int newServer) final void
updateWeight
(double[] weights) Add the cost of this cost function to the weight of the candidate generator that is optimized for this cost function.Methods inherited from class org.apache.hadoop.hbase.master.balancer.CostFunction
getMultiplier, isNeeded, postAction, scale, setMultiplier
-
Field Details
-
REGION_COUNT_SKEW_COST_KEY
- See Also:
-
DEFAULT_REGION_COUNT_SKEW_COST
- See Also:
-
cost
-
-
Constructor Details
-
RegionCountSkewCostFunction
RegionCountSkewCostFunction(org.apache.hadoop.conf.Configuration conf)
-
-
Method Details
-
prepare
Description copied from class:CostFunction
Called once per LB invocation to give the cost function to initialize it's state, and perform any costly calculation.- Overrides:
prepare
in classCostFunction
-
cost
- Specified by:
cost
in classCostFunction
-
regionMoved
- Overrides:
regionMoved
in classCostFunction
-
updateWeight
Description copied from class:CostFunction
Add the cost of this cost function to the weight of the candidate generator that is optimized for this cost function. By default it is the RandomCandiateGenerator for a cost function. Called once per init or after postAction.- Overrides:
updateWeight
in classCostFunction
- Parameters:
weights
- the weights for every generator.
-