You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2022/08/09 10:33:54 UTC

[GitHub] [iotdb] 23931017wu commented on a diff in pull request #6923: [IOTDB-4038] Add the leader metrics to the cluster

23931017wu commented on code in PR #6923:
URL: https://github.com/apache/iotdb/pull/6923#discussion_r941175170


##########
confignode/src/main/java/org/apache/iotdb/confignode/manager/load/LoadManager.java:
##########
@@ -590,7 +591,54 @@ public int getUnknownDataNodesNum() {
     return allDataNodes.size();
   }
 
-  public void addMetrics() {
+  /**
+   * Get the LeaderCount of each DataNodeId
+   *
+   * @return Map<DataNodeId, LeaderCount>
+   */
+  public Map<Integer, Integer> getLeadershipCountByDatanode() {
+    Map<Integer, Integer> idToCountMap = new ConcurrentHashMap<>();
+
+    regionGroupCacheMap.forEach(

Review Comment:
   Okay, learned ~



-- 
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: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org