zhangmeng916 commented on a change in pull request #1732:
URL: https://github.com/apache/helix/pull/1732#discussion_r632728233



##########
File path: 
helix-core/src/main/java/org/apache/helix/monitoring/mbeans/PerInstanceResourceMonitor.java
##########
@@ -131,13 +140,41 @@ public synchronized void update(Map<Partition, String> 
stateMap, Set<String> tag
     int cnt = 0;
     for (String state : stateMap.values()) {
       // Skip DROPPED and initial state (e.g. OFFLINE)
-      if (state.equalsIgnoreCase(HelixDefinedState.DROPPED.name())
-          || state.equalsIgnoreCase(stateModelDef.getInitialState())) {
+      if (state.equalsIgnoreCase(HelixDefinedState.DROPPED.name()) || state
+          .equalsIgnoreCase(stateModelDef.getInitialState())) {
         continue;
       }
       cnt++;
     }
-    _partitions = cnt;
+    _partitions.updateValue(Long.valueOf(cnt));
+  }
+
+  @Override
+  public DynamicMBeanProvider register() throws JMException {
+    List<DynamicMetric<?, ?>> attributeList = new ArrayList<>();
+    attributeList.add(_partitions);
+    String beanName = getPerInstanceResourceBeanName(_participantName, 
_resourceName);
+    doRegister(attributeList, MBEAN_DESCRIPTION, getObjectName(beanName));
+    return this;
+  }
+
+  /**

Review comment:
       Discussed offline. We will have everything inside BeanName structure, 
and deprecate other related get bean name functions to concentrate all logic.




-- 
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to