ranganathg commented on code in PR #4258:
URL: https://github.com/apache/hbase/pull/4258#discussion_r1757017228


##########
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java:
##########
@@ -256,14 +276,41 @@ protected void loadConf(Configuration conf) {
     addCostFunction(new WriteRequestCostFunction(conf));
     addCostFunction(new MemStoreSizeCostFunction(conf));
     addCostFunction(new StoreFileCostFunction(conf));
-    loadCustomCostFunctions(conf);
+    List<CostFunction> additionals =
+      (List<CostFunction>) loadFunctions(conf, 
COST_FUNCTIONS_COST_FUNCTIONS_KEY);
+    if (!CollectionUtils.isEmpty(additionals)) {
+      for (CostFunction costFunction : additionals) {
+        addCostFunction(costFunction);
+      }
+    }
+
+    coarseCostFunctions = new ArrayList<>();
+    coarseCostFunctions.add(new RegionCountSkewCostFunction(conf));
+    coarseCostFunctions.add(new PrimaryRegionCountSkewCostFunction(conf));
+    coarseCostFunctions.add(new MoveCostFunction(conf, provider));
+    coarseCostFunctions.add(regionReplicaHostCostFunction);
+    coarseCostFunctions.add(regionReplicaRackCostFunction);
+    coarseCostFunctions.add(new TableSkewCostFunction(conf));
+
+    assert coarseCostFunctions.size() <= costFunctions.size()
+      : "Simple cost functions should be less than normal!";

Review Comment:
   Coarse cost function*?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to