浏览代码

HADOOP-3220. Safemode message corrected. Contributed by Konstantin Shvachko.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/branches/branch-0.17@646575 13f79535-47bb-0310-9956-ffa450edef68
Konstantin Shvachko 17 年之前
父节点
当前提交
828bed5a82
共有 2 个文件被更改,包括 4 次插入2 次删除
  1. 2 0
      CHANGES.txt
  2. 2 2
      src/java/org/apache/hadoop/dfs/FSNamesystem.java

+ 2 - 0
CHANGES.txt

@@ -533,6 +533,8 @@ Release 0.17.0 - Unreleased
     HADOOP-3175. Fix FsShell.CommandFormat to handle "-" in arguments.
     (Edward J. Yoon via rangadi)
 
+    HADOOP-3220. Safemode message corrected. (shv)
+
 Release 0.16.3 - Unreleased
 
   BUG FIXES

+ 2 - 2
src/java/org/apache/hadoop/dfs/FSNamesystem.java

@@ -3874,8 +3874,8 @@ class FSNamesystem implements FSConstants, FSNamesystemMBean {
         return "Use \"hadoop dfs -safemode leave\" to turn safe mode off.";
       }
       String safeBlockRatioMsg = 
-        String.format(
-          "The ratio of reported blocks %.4f has not reached the threshold %.4f. ",
+        String.format("The ratio of reported blocks %.4f has " +
+          (reached == 0 ? "not " : "") + "reached the threshold %.4f. ",
           getSafeBlockRatio(), threshold) + autoOffMsg;
       if(reached == 0)  // threshold is not reached 
         return safeBlockRatioMsg + ".";