You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "virajjasani (via GitHub)" <gi...@apache.org> on 2023/05/26 16:11:37 UTC

[GitHub] [hadoop] virajjasani commented on a diff in pull request #5691: HDFS-17026. Configuring NamenodeHeartbeatService to update JMX on low…

virajjasani commented on code in PR #5691:
URL: https://github.com/apache/hadoop/pull/5691#discussion_r1207016560


##########
hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/NamenodeHeartbeatService.java:
##########
@@ -482,17 +508,36 @@ private void updateHAStatusParameters(NamenodeStatusReport report) {
     }
   }
 
+  /**
+   * Evaluates whether the JMX report should be refreshed by
+   * calling the Namenode, based on the following conditions:
+   * 1. JMX Updates must be enabled.
+   * 2. The last attempt to update JMX occurred before the
+   *    configured interval (if any).
+   */
+  private boolean shouldUpdateJmx() {
+    return updateJmxEnabled
+        && (updateJmxIntervalMs < 0
+        || Time.monotonicNow() - lastJmxUpdateAttempt > updateJmxIntervalMs);

Review Comment:
   can we only rely on one config rather than both? here we can get rid of `updateJmxEnabled` and only rely on `updateJmxIntervalMs`?
   
   something like:
   
   if updateJmxIntervalMs < 0   => return false (disabled)
   if updateJmxIntervalMs == 0 => return true (enabled)
   if updateJmxIntervalMs > 0   => return `Time.monotonicNow() - lastJmxUpdateAttempt > updateJmxIntervalMs`



-- 
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-unsubscribe@hadoop.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org