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 floatprivate static final StringFields inherited from class org.apache.hadoop.hbase.master.balancer.CostFunction
cluster -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected doublecost()protected doublevoidprepare(BalancerClusterState cluster) Called once per LB invocation to give the cost function to initialize it's state, and perform any costly calculation.protected voidregionMoved(int region, int oldServer, int newServer) private voidupdateStoreFilePerServerPerTableCosts(int newServer, int tableIdx, double[] costs) Methods inherited from class org.apache.hadoop.hbase.master.balancer.CostFromRegionLoadFunction
getRegionLoadCostMethods 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:CostFunctionCalled once per LB invocation to give the cost function to initialize it's state, and perform any costly calculation.- Overrides:
preparein classCostFromRegionLoadFunction
-
regionMoved
- Overrides:
regionMovedin classCostFromRegionLoadFunction
-
updateStoreFilePerServerPerTableCosts
-
cost
- Overrides:
costin classCostFromRegionLoadFunction
-
getCostFromRl
- Specified by:
getCostFromRlin classCostFromRegionLoadFunction
-