hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jiten...@apache.org
Subject svn commit: r1241568 - in /hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs: ./ src/main/java/org/apache/hadoop/hdfs/server/namenode/ src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/
Date Tue, 07 Feb 2012 19:29:39 GMT
Author: jitendra
Date: Tue Feb  7 19:29:39 2012
New Revision: 1241568

URL: http://svn.apache.org/viewvc?rev=1241568&view=rev
Log:
HDFS-2901. Improvements for SBN web UI - not show under-replicated/missing blocks. Contributed
by Brandon Li.

Modified:
    hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
    hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
    hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestHAWebUI.java

Modified: hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt?rev=1241568&r1=1241567&r2=1241568&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-1623.txt
Tue Feb  7 19:29:39 2012
@@ -178,3 +178,5 @@ HDFS-2894. HA: automatically determine t
 HDFS-2733. Document HA configuration and CLI. (atm)
 
 HDFS-2794. Active NN may purge edit log files before standby NN has a chance to read them
(todd)
+
+HDFS-2901. Improvements for SBN web UI - not show under-replicated/missing blocks. (Brandon
Li via jitendra)

Modified: hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java?rev=1241568&r1=1241567&r2=1241568&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
Tue Feb  7 19:29:39 2012
@@ -36,6 +36,7 @@ import javax.servlet.http.HttpServletRes
 import javax.servlet.jsp.JspWriter;
 
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.ha.HAServiceProtocol.HAServiceState;
 import org.apache.hadoop.hdfs.DFSConfigKeys;
 import org.apache.hadoop.hdfs.DFSUtil;
 import org.apache.hadoop.hdfs.protocol.Block;
@@ -308,7 +309,16 @@ class NamenodeJspHelper {
 
       long bpUsed = fsnStats[6];
       float percentBpUsed = DFSUtil.getPercentUsed(bpUsed, total);
-      
+
+      // don't show under-replicated/missing blocks or corrupt files for SBN
+      // since the standby namenode doesn't compute replication queues 
+      String underReplicatedBlocks = "";
+      if (nn.getServiceState() == HAServiceState.ACTIVE) {
+    	  underReplicatedBlocks = new String(rowTxt() 
+              + colTxt("Excludes missing blocks.")
+              + "Number of Under-Replicated Blocks" + colTxt() + ":" + colTxt()
+              + fsn.getBlockManager().getUnderReplicatedNotMissingBlocks()); 
+      }
       out.print("<div id=\"dfstable\"> <table>\n" + rowTxt() + colTxt()
           + "Configured Capacity" + colTxt() + ":" + colTxt()
           + StringUtils.byteDesc(total) + rowTxt() + colTxt() + "DFS Used"
@@ -343,10 +353,8 @@ class NamenodeJspHelper {
           + rowTxt() + colTxt()
           + "<a href=\"dfsnodelist.jsp?whatNodes=DECOMMISSIONING\">"
           + "Decommissioning Nodes</a> "
-          + colTxt() + ":" + colTxt() + decommissioning.size() 
-          + rowTxt() + colTxt("Excludes missing blocks.")
-          + "Number of Under-Replicated Blocks" + colTxt() + ":" + colTxt()
-          + fsn.getBlockManager().getUnderReplicatedNotMissingBlocks()
+          + colTxt() + ":" + colTxt() + decommissioning.size()
+          + underReplicatedBlocks
           + "</table></div><br>\n");
 
       if (live.isEmpty() && dead.isEmpty()) {

Modified: hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestHAWebUI.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestHAWebUI.java?rev=1241568&r1=1241567&r2=1241568&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestHAWebUI.java
(original)
+++ hadoop/common/branches/HDFS-1623/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestHAWebUI.java
Tue Feb  7 19:29:39 2012
@@ -32,11 +32,11 @@ public class TestHAWebUI {
 
   /**
    * Tests that the web UI of the name node provides a link to browse the file
-   * system only in active state
+   * system and summary of under-replicated blocks only in active state
    * 
    */
   @Test
-  public void testLinkToBrowseFilesystem() throws Exception {
+  public void testLinkAndClusterSummary() throws Exception {
     Configuration conf = new Configuration();
 
     MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf)
@@ -50,18 +50,21 @@ public class TestHAWebUI {
           + NameNode.getHttpAddress(cluster.getConfiguration(0)).getPort()
           + "/dfshealth.jsp"));
       assertTrue(pageContents.contains("Browse the filesystem"));
+      assertTrue(pageContents.contains("Number of Under-Replicated Blocks"));
 
       cluster.transitionToStandby(0);
       pageContents = DFSTestUtil.urlGet(new URL("http://localhost:"
           + NameNode.getHttpAddress(cluster.getConfiguration(0)).getPort()
           + "/dfshealth.jsp"));
       assertFalse(pageContents.contains("Browse the filesystem"));
+      assertFalse(pageContents.contains("Number of Under-Replicated Blocks"));
 
       cluster.transitionToActive(0);
       pageContents = DFSTestUtil.urlGet(new URL("http://localhost:"
           + NameNode.getHttpAddress(cluster.getConfiguration(0)).getPort()
           + "/dfshealth.jsp"));
       assertTrue(pageContents.contains("Browse the filesystem"));
+      assertTrue(pageContents.contains("Number of Under-Replicated Blocks"));
 
     } finally {
       cluster.shutdown();



Mime
View raw message