You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-commits@hadoop.apache.org by to...@apache.org on 2011/05/28 02:27:12 UTC
svn commit: r1128542 - in /hadoop/hdfs/trunk: CHANGES.txt
src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
src/webapps/hdfs/dfshealth.jsp
Author: todd
Date: Sat May 28 00:27:11 2011
New Revision: 1128542
URL: http://svn.apache.org/viewvc?rev=1128542&view=rev
Log:
HDFS-1954. Improve corrupt files warning message on NameNode web UI. Contributed by Patrick Hunt.
Modified:
hadoop/hdfs/trunk/CHANGES.txt
hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
hadoop/hdfs/trunk/src/webapps/hdfs/dfshealth.jsp
Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=1128542&r1=1128541&r2=1128542&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Sat May 28 00:27:11 2011
@@ -878,6 +878,9 @@ Release 0.22.0 - Unreleased
HDFS-1957. Add documentation for HFTP. (Ari Rabkin via todd)
+ HDFS-1954. Improve corrupt files warning message on NameNode web UI.
+ (Patrick Hunt via todd)
+
OPTIMIZATIONS
HDFS-1140. Speedup INode.getPathComponents. (Dmytro Molkov via shv)
Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java?rev=1128542&r1=1128541&r2=1128542&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java (original)
+++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java Sat May 28 00:27:11 2011
@@ -142,12 +142,29 @@ class NamenodeJspHelper {
+ "\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 (incl. link to detail page) 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 " + 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 log or run fsck.</b>");
+ result.append("</a>");
+
+ result.append("<br/><div class=\"small\">Hint: A common mis-configuration is not ");
+ result.append("overriding \"" + DFSConfigKeys.DFS_DATANODE_DATA_DIR_KEY
+ + "\" on all datanodes");
+ result.append("(the default is typically /tmp which is not persistent)</div>");
+ result.append("<br/><br/>\n");
+
+ return result.toString();
}
return "";
}
Modified: hadoop/hdfs/trunk/src/webapps/hdfs/dfshealth.jsp
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/webapps/hdfs/dfshealth.jsp?rev=1128542&r1=1128541&r2=1128542&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/webapps/hdfs/dfshealth.jsp (original)
+++ hadoop/hdfs/trunk/src/webapps/hdfs/dfshealth.jsp Sat May 28 00:27:11 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>