Class StoreFileTableSkewCostFunction
java.lang.Object
org.apache.hadoop.hbase.master.balancer.CostFunction
org.apache.hadoop.hbase.master.balancer.CostFromRegionLoadFunction
org.apache.hadoop.hbase.master.balancer.StoreFileTableSkewCostFunction
Lightweight cost function that mirrors TableSkewCostFunction but aggregates storefile sizes (in
MB) per table using the CostFromRegionLoadFunction framework. For each table, it computes a
per-server aggregated storefile size by summing the average storefile size for each region (if
there are multiple load metrics, it averages them). The imbalance cost (as computed by
DoubleArrayCost) is then used to drive the balancer to reduce differences between servers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DoubleArrayCost[]
private static final float
private static final String
Fields inherited from class org.apache.hadoop.hbase.master.balancer.CostFunction
cluster
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected double
cost()
protected double
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) private void
updateStoreFilePerServerPerTableCosts
(int newServer, int tableIdx, double[] costs) Methods inherited from class org.apache.hadoop.hbase.master.balancer.CostFromRegionLoadFunction
getRegionLoadCost
Methods inherited from class org.apache.hadoop.hbase.master.balancer.CostFunction
getCostEpsilon, getMultiplier, isNeeded, postAction, scale, setMultiplier, updateWeight
-
Field Details
-
STOREFILE_TABLE_SKEW_COST_KEY
- See Also:
-
DEFAULT_STOREFILE_TABLE_SKEW_COST
- See Also:
-
costsPerTable
-
-
Constructor Details
-
StoreFileTableSkewCostFunction
-
-
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 classCostFromRegionLoadFunction
-
regionMoved
- Overrides:
regionMoved
in classCostFromRegionLoadFunction
-
updateStoreFilePerServerPerTableCosts
-
cost
- Overrides:
cost
in classCostFromRegionLoadFunction
-
getCostFromRl
- Specified by:
getCostFromRl
in classCostFromRegionLoadFunction
-