hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject svn commit: r1134434 - in /hadoop/hdfs/branches/branch-0.22: CHANGES.txt src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java src/test/hdfs/org/apache/hadoop/hdfs/TestMissingBlocksAlert.java src/webapps/hdfs/dfshealth.jsp
Date Fri, 10 Jun 2011 20:38:55 GMT
Author: shv
Date: Fri Jun 10 20:38:55 2011
New Revision: 1134434

URL: http://svn.apache.org/viewvc?rev=1134434&view=rev
Log:
HDFS-1954. Merge -c 1134424 from trunk to branch 0.22.

Modified:
    hadoop/hdfs/branches/branch-0.22/CHANGES.txt
    hadoop/hdfs/branches/branch-0.22/src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
    hadoop/hdfs/branches/branch-0.22/src/test/hdfs/org/apache/hadoop/hdfs/TestMissingBlocksAlert.java
    hadoop/hdfs/branches/branch-0.22/src/webapps/hdfs/dfshealth.jsp

Modified: hadoop/hdfs/branches/branch-0.22/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/branch-0.22/CHANGES.txt?rev=1134434&r1=1134433&r2=1134434&view=diff
==============================================================================
--- hadoop/hdfs/branches/branch-0.22/CHANGES.txt (original)
+++ hadoop/hdfs/branches/branch-0.22/CHANGES.txt Fri Jun 10 20:38:55 2011
@@ -260,6 +260,9 @@ Release 0.22.0 - Unreleased
     HDFS-1948  Forward port 'hdfs-1520 lightweight namenode operation to
     trigger lease reccovery' (stack)
 
+    HDFS-1954. Improved corrupt files warning on NameNode web UI.
+    (Patrick Hunt via shv)
+
   OPTIMIZATIONS
 
     HDFS-1140. Speedup INode.getPathComponents. (Dmytro Molkov via shv)

Modified: hadoop/hdfs/branches/branch-0.22/src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/branch-0.22/src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java?rev=1134434&r1=1134433&r2=1134434&view=diff
==============================================================================
--- hadoop/hdfs/branches/branch-0.22/src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
(original)
+++ hadoop/hdfs/branches/branch-0.22/src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
Fri Jun 10 20:38:55 2011
@@ -133,12 +133,25 @@ class NamenodeJspHelper {
         + getUpgradeStatusText(fsn) + "\n</table></div>";
   }
 
-  static String getWarningText(FSNamesystem fsn) {
-    // Ideally this should be displayed in RED
+  /**
+   * Generate warning text if there are corrupt files.
+   * @return a warning if files are corrupt, otherwise return an empty string.
+   */
+  static String getCorruptFilesWarning(FSNamesystem fsn) {
     long missingBlocks = fsn.getMissingBlocksCount();
     if (missingBlocks > 0) {
-      return "<br> WARNING :" + " There are about " + missingBlocks
-          + " missing blocks. Please check the log or run fsck. <br><br>";
+      StringBuilder result = new StringBuilder();
+
+      // Warning class is typically displayed in RED
+      result.append("<br/><a class=\"warning\" href=\"/corrupt_files.jsp\" title=\"List
corrupt files\">\n");
+      result.append("<b>WARNING : There are " + missingBlocks
+          + " missing blocks. Please check the logs or run fsck in order to identify the
missing blocks.</b>");
+      result.append("</a>");
+
+      result.append("<br/><div class=\"small\">See the Hadoop FAQ for common
causes and potential solutions.");
+      result.append("<br/><br/>\n");
+
+      return result.toString();
     }
     return "";
   }

Modified: hadoop/hdfs/branches/branch-0.22/src/test/hdfs/org/apache/hadoop/hdfs/TestMissingBlocksAlert.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/branch-0.22/src/test/hdfs/org/apache/hadoop/hdfs/TestMissingBlocksAlert.java?rev=1134434&r1=1134433&r2=1134434&view=diff
==============================================================================
--- hadoop/hdfs/branches/branch-0.22/src/test/hdfs/org/apache/hadoop/hdfs/TestMissingBlocksAlert.java
(original)
+++ hadoop/hdfs/branches/branch-0.22/src/test/hdfs/org/apache/hadoop/hdfs/TestMissingBlocksAlert.java
Fri Jun 10 20:38:55 2011
@@ -89,7 +89,7 @@ public class TestMissingBlocksAlert exte
       URL url = new URL("http://" + conf.get(DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY)
+ 
                         "/dfshealth.jsp");
       String dfsFrontPage = DFSTestUtil.urlGet(url);
-      String warnStr = "WARNING : There are about ";
+      String warnStr = "WARNING : There are ";
       assertTrue("HDFS Front page does not contain expected warning", 
                  dfsFrontPage.contains(warnStr + "1 missing blocks"));
 

Modified: hadoop/hdfs/branches/branch-0.22/src/webapps/hdfs/dfshealth.jsp
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/branch-0.22/src/webapps/hdfs/dfshealth.jsp?rev=1134434&r1=1134433&r2=1134434&view=diff
==============================================================================
--- hadoop/hdfs/branches/branch-0.22/src/webapps/hdfs/dfshealth.jsp (original)
+++ hadoop/hdfs/branches/branch-0.22/src/webapps/hdfs/dfshealth.jsp Fri Jun 10 20:38:55 2011
@@ -50,9 +50,7 @@
 <b> <%= NamenodeJspHelper.getSecurityModeText()%> </b>
 <b> <%= NamenodeJspHelper.getSafeModeText(fsn)%> </b>
 <b> <%= NamenodeJspHelper.getInodeLimitText(fsn)%> </b>
-<a class="warning" href="/corrupt_files.jsp" title="List corrupt files">
-  <%= NamenodeJspHelper.getWarningText(fsn)%>
-</a>
+<%= NamenodeJspHelper.getCorruptFilesWarning(fsn)%>
 
 <% healthjsp.generateHealthReport(out, nn, request); %>
 <hr>



Mime
View raw message