jiajunwang commented on a change in pull request #490: Add latency metric 
components for WAGED rebalancer
URL: https://github.com/apache/helix/pull/490#discussion_r329786570
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/controller/stages/BestPossibleStateCalcStage.java
 ##########
 @@ -249,8 +253,15 @@ private boolean validateOfflineInstancesLimit(final 
ResourceControllerDataProvid
     // Init rebalancer with the rebalance preferences.
     Map<ClusterConfig.GlobalRebalancePreferenceKey, Integer> preferences = 
cache.getClusterConfig()
         .getGlobalRebalancePreference();
+
+    // TODO: Add an appropriate entityName
+    if (METRIC_COLLECTOR_THREAD_LOCAL.get() == null) {
+      METRIC_COLLECTOR_THREAD_LOCAL.set(new 
MetricCollector(helixManager.getClusterName(), ""));
 
 Review comment:
   I guess the lazy init is not required here.
   Let's just put it to the constructor of the stage object.
   
   It's always better to have the metrics code "disappear", you know.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@helix.apache.org
For additional commands, e-mail: reviews-h...@helix.apache.org

Reply via email to