[ https://issues.apache.org/jira/browse/HDFS-16273?focusedWorklogId=675355&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-675355 ]
ASF GitHub Bot logged work on HDFS-16273: ----------------------------------------- Author: ASF GitHub Bot Created on: 04/Nov/21 00:42 Start Date: 04/Nov/21 00:42 Worklog Time Spent: 10m Work Description: goiri commented on a change in pull request #3553: URL: https://github.com/apache/hadoop/pull/3553#discussion_r742198185 ########## File path: hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/fairness/NoRouterRpcFairnessPolicyController.java ########## @@ -46,4 +46,9 @@ public void releasePermit(String nsId) { public void shutdown() { // Nothing for now. } + + @Override + public String getAvailableHandlerOnPerNs(){ + return "N/A"; Review comment: Should we test for this? ########## File path: hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/fairness/AbstractRouterRpcFairnessPolicyController.java ########## @@ -75,4 +77,17 @@ protected void insertNameServiceWithPermits(String nsId, int maxPermits) { protected int getAvailablePermits(String nsId) { return this.permits.get(nsId).availablePermits(); } + + @Override + public String getAvailableHandlerOnPerNs() { + JSONObject json = new JSONObject(); + for (Map.Entry<String, Semaphore> entry : permits.entrySet()) { + try { + json.put(entry.getKey(), entry.getValue().availablePermits()); Review comment: Let's extract entry.getKey() and entry.getValue() to have a particular name. ########## File path: hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/fairness/NoRouterRpcFairnessPolicyController.java ########## @@ -46,4 +46,9 @@ public void releasePermit(String nsId) { public void shutdown() { // Nothing for now. } + + @Override + public String getAvailableHandlerOnPerNs(){ + return "N/A"; Review comment: Should we test for this? ########## File path: hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/fairness/AbstractRouterRpcFairnessPolicyController.java ########## @@ -75,4 +77,17 @@ protected void insertNameServiceWithPermits(String nsId, int maxPermits) { protected int getAvailablePermits(String nsId) { return this.permits.get(nsId).availablePermits(); } + + @Override + public String getAvailableHandlerOnPerNs() { + JSONObject json = new JSONObject(); + for (Map.Entry<String, Semaphore> entry : permits.entrySet()) { + try { + json.put(entry.getKey(), entry.getValue().availablePermits()); Review comment: Let's extract entry.getKey() and entry.getValue() to have a particular name. -- 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: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 675355) Time Spent: 1h 20m (was: 1h 10m) > RBF: RouterRpcFairnessPolicyController add availableHandleOnPerNs metrics > ------------------------------------------------------------------------- > > Key: HDFS-16273 > URL: https://issues.apache.org/jira/browse/HDFS-16273 > Project: Hadoop HDFS > Issue Type: Improvement > Components: rbf > Affects Versions: 3.4.0 > Reporter: Xiangyi Zhu > Assignee: Xiangyi Zhu > Priority: Major > Labels: pull-request-available > Time Spent: 1h 20m > Remaining Estimate: 0h > > Add the availableHandlerOnPerNs metrics to monitor whether the number of > handlers configured for each NS is reasonable when using > RouterRpcFairnessPolicyController. -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org