@Override
  protected double cost() {
    double totalCost = 0;
    // Sum the imbalance cost over all tables.
    for (DoubleArrayCost dac : costsPerTable) {
      totalCost += dac.cost();
    }
    return totalCost;
  }
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.
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StoreFileTableSkewCostFunction.java