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 GitBox <gi...@apache.org> on 2021/03/29 09:34:08 UTC

[GitHub] [hadoop] jianghuazhu commented on a change in pull request #2831: HDFS-15920.Solve the problem that the value of SafeModeMonitor#RECHECK_INTERVAL can be configured.

jianghuazhu commented on a change in pull request #2831:
URL: https://github.com/apache/hadoop/pull/2831#discussion_r603147685



##########
File path: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManagerSafeMode.java
##########
@@ -640,7 +643,17 @@ private void reportStatus(String msg, boolean rightNow) {
    */
   private class SafeModeMonitor implements Runnable {
     /** Interval in msec for checking safe mode. */
-    private static final long RECHECK_INTERVAL = 1000;
+    private long recheckInterval = 1000;
+
+    public SafeModeMonitor() {
+      Configuration conf = new HdfsConfiguration();
+      long interval = conf.getLong(
+              DFS_NAMENODE_SAFEMODE_RECHECK_INTERVAL_KEY,
+              DFS_NAMENODE_SAFEMODE_RECHECK_INTERVAL_DEFAULT);
+      if (interval > 0) {
+        recheckInterval = interval;

Review comment:
       @ayushtkn , thank you very much for your suggestions, I will submit some improved codes later.




-- 
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



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