Apache9 commented on a change in pull request #4258:
URL: https://github.com/apache/hbase/pull/4258#discussion_r832894727



##########
File path: 
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
##########
@@ -166,37 +178,37 @@ public StochasticLoadBalancer(MetricsStochasticBalancer 
metricsStochasticBalance
     super(metricsStochasticBalancer);
   }
 
-  private static CostFunction createCostFunction(Class<? extends CostFunction> 
clazz,
-    Configuration conf) {
-    try {
-      Constructor<? extends CostFunction> ctor = 
clazz.getDeclaredConstructor(Configuration.class);
-      return ReflectionUtils.instantiate(clazz.getName(), ctor, conf);
-    } catch (NoSuchMethodException e) {
-      // will try construct with no parameter
-    }
-    return ReflectionUtils.newInstance(clazz);
-  }
-
-  private void loadCustomCostFunctions(Configuration conf) {
-    String[] functionsNames = 
conf.getStrings(COST_FUNCTIONS_COST_FUNCTIONS_KEY);
+  private <T> List<? extends T> loadFunctions(Configuration conf, String 
configName) {

Review comment:
       Why change to T instead of CostFunction here?




-- 
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