You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2019/10/31 18:59:30 UTC

[GitHub] [helix] jiajunwang commented on a change in pull request #548: Add max capacity usage metric for instance monitor.

jiajunwang commented on a change in pull request #548: Add max capacity usage metric for instance monitor.
URL: https://github.com/apache/helix/pull/548#discussion_r341308652
 
 

 ##########
 File path: helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ClusterStatusMonitor.java
 ##########
 @@ -245,18 +245,11 @@ public void setClusterInstanceStatus(Set<String> liveInstanceSet, Set<String> in
       // Register beans for instances that are newly configured
       Set<String> toRegister = Sets.newHashSet(instanceSet);
       toRegister.removeAll(_instanceMonitorMap.keySet());
-      Set<InstanceMonitor> monitorsToRegister = Sets.newHashSet();
       for (String instanceName : toRegister) {
-        InstanceMonitor bean = new InstanceMonitor(_clusterName, instanceName);
+        InstanceMonitor bean = getOrCreateInstanceMonitor(instanceName);
 
 Review comment:
   This simplification might cause problem. The original design was to prevent stale instance object in the registed MBean list.
   Note we treat the new instance and to be updated instance separately.
   
   First part of your change, I think it will not change any behavior. Since we already "toRegister.removeAll(_instanceMonitorMap.keySet());".
   Second part of your change is not correctly, it will cause the update fails. Basically only removing but no creating.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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