@InterfaceAudience.Private public class HeterogeneousRegionCountCostFunction extends Object
* rs[0-9] 200 * rs1[0-9] 50
RegionServers with hostname matching the first rules will have a limit of 200, and the others 50. If there's no match, a default is set. The costFunction is trying to fill all RegionServers linearly, meaning that if the global usage is at 50%, then all RegionServers should hold half of their capacity in terms of regions. In order to use this CostFunction, you need to set the following options:| Modifier and Type | Field and Description |
|---|---|
protected org.apache.hadoop.hbase.master.balancer.BalancerClusterState |
cluster |
static double |
COST_EPSILON |
| Modifier and Type | Method and Description |
|---|---|
protected double |
cost() |
protected void |
regionMoved(int region,
int oldServer,
int newServer) |
protected static double |
scale(double min,
double max,
double value)
Scale the value between 0 and 1.
|
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.
|
public static final double COST_EPSILON
protected org.apache.hadoop.hbase.master.balancer.BalancerClusterState cluster
protected double cost()
protected void regionMoved(int region,
int oldServer,
int newServer)
public void updateWeight(double[] weights)
weights - the weights for every generator.protected static double scale(double min,
double max,
double value)
min - Min valuemax - The Max valuevalue - The value to be scaled.Copyright © 2007–2020 The Apache Software Foundation. All rights reserved.