hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1204131 - in /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs: CHANGES.txt src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
Date Sun, 20 Nov 2011 06:28:37 GMT
Author: eli
Date: Sun Nov 20 06:28:37 2011
New Revision: 1204131

URL: http://svn.apache.org/viewvc?rev=1204131&view=rev
Log:
HDFS-2567. When 0 DNs are available, show a proper error when trying to browse DFS via web
UI. Contributed by Harsh J

Modified:
    hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
    hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1204131&r1=1204130&r2=1204131&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Sun Nov 20 06:28:37 2011
@@ -152,6 +152,9 @@ Release 0.23.1 - UNRELEASED
 
     HDFS-2502. hdfs-default.xml should include dfs.name.dir.restore.
     (harsh via eli)
+
+    HDFS-2567. When 0 DNs are available, show a proper error when
+    trying to browse DFS via web UI. (harsh via eli)
     
 Release 0.23.0 - 2011-11-01 
 

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java?rev=1204131&r1=1204130&r2=1204131&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NamenodeJspHelper.java
Sun Nov 20 06:28:37 2011
@@ -380,7 +380,13 @@ class NamenodeJspHelper {
     final NameNode nn = NameNodeHttpServer.getNameNodeFromContext(context);
     final Configuration conf = (Configuration) context
         .getAttribute(JspHelper.CURRENT_CONF);
-    final DatanodeID datanode = getRandomDatanode(nn);
+    // We can't redirect if there isn't a DN to redirect to.
+    // Lets instead show a proper error message.
+    if (nn.getNamesystem().getNumLiveDataNodes() < 1) {
+      throw new IOException("Can't browse the DFS since there are no " +
+          "live nodes available to redirect to.");
+    }
+    final DatanodeID datanode = getRandomDatanode(nn);;
     UserGroupInformation ugi = JspHelper.getUGI(context, request, conf);
     String tokenString = getDelegationToken(
         nn.getRpcServer(), request, conf, ugi);



Mime
View raw message