hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jiten...@apache.org
Subject svn commit: r1076482 - in /hadoop/hdfs/branches/HDFS-1052: CHANGES.txt src/java/org/apache/hadoop/hdfs/server/common/JspHelper.java src/test/hdfs/org/apache/hadoop/hdfs/server/common/TestJspHelper.java
Date Thu, 03 Mar 2011 01:24:26 GMT
Author: jitendra
Date: Thu Mar  3 01:24:26 2011
New Revision: 1076482

URL: http://svn.apache.org/viewvc?rev=1076482&view=rev
Log:
Federation: Failure in browsing data on new namenodes.

Modified:
    hadoop/hdfs/branches/HDFS-1052/CHANGES.txt
    hadoop/hdfs/branches/HDFS-1052/src/java/org/apache/hadoop/hdfs/server/common/JspHelper.java
    hadoop/hdfs/branches/HDFS-1052/src/test/hdfs/org/apache/hadoop/hdfs/server/common/TestJspHelper.java

Modified: hadoop/hdfs/branches/HDFS-1052/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/HDFS-1052/CHANGES.txt?rev=1076482&r1=1076481&r2=1076482&view=diff
==============================================================================
--- hadoop/hdfs/branches/HDFS-1052/CHANGES.txt (original)
+++ hadoop/hdfs/branches/HDFS-1052/CHANGES.txt Thu Mar  3 01:24:26 2011
@@ -162,6 +162,8 @@ Trunk (unreleased changes)
     HDFS-1628. Display full path in AccessControlException.  (John George
     via szetszwo)
 
+    HDFS-1707. Federation: Failure in browsing data on new namenodes. (jitendra)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hadoop/hdfs/branches/HDFS-1052/src/java/org/apache/hadoop/hdfs/server/common/JspHelper.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/HDFS-1052/src/java/org/apache/hadoop/hdfs/server/common/JspHelper.java?rev=1076482&r1=1076481&r2=1076482&view=diff
==============================================================================
--- hadoop/hdfs/branches/HDFS-1052/src/java/org/apache/hadoop/hdfs/server/common/JspHelper.java
(original)
+++ hadoop/hdfs/branches/HDFS-1052/src/java/org/apache/hadoop/hdfs/server/common/JspHelper.java
Thu Mar  3 01:24:26 2011
@@ -43,6 +43,7 @@ import org.apache.hadoop.classification.
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.hdfs.BlockReader;
+import org.apache.hadoop.hdfs.DFSUtil;
 import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
 import org.apache.hadoop.hdfs.protocol.ExtendedBlock;
 import org.apache.hadoop.hdfs.protocol.LocatedBlock;
@@ -480,7 +481,14 @@ public class JspHelper {
         Token<DelegationTokenIdentifier> token = 
           new Token<DelegationTokenIdentifier>();
         token.decodeFromUrlString(tokenString);
-        InetSocketAddress serviceAddr = NameNode.getAddress(conf);
+        String namenodeAddress = (String) request
+            .getParameter(NAMENODE_ADDRESS);
+        if (namenodeAddress == null) {
+          throw new IOException("Url parameter '" + NAMENODE_ADDRESS
+              + "' not found.");
+        }
+        InetSocketAddress serviceAddr = DFSUtil
+            .getSocketAddress(namenodeAddress);
         LOG.info("Setting service in token: "
             + new Text(serviceAddr.getAddress().getHostAddress() + ":"
                 + serviceAddr.getPort()));

Modified: hadoop/hdfs/branches/HDFS-1052/src/test/hdfs/org/apache/hadoop/hdfs/server/common/TestJspHelper.java
URL: http://svn.apache.org/viewvc/hadoop/hdfs/branches/HDFS-1052/src/test/hdfs/org/apache/hadoop/hdfs/server/common/TestJspHelper.java?rev=1076482&r1=1076481&r2=1076482&view=diff
==============================================================================
--- hadoop/hdfs/branches/HDFS-1052/src/test/hdfs/org/apache/hadoop/hdfs/server/common/TestJspHelper.java
(original)
+++ hadoop/hdfs/branches/HDFS-1052/src/test/hdfs/org/apache/hadoop/hdfs/server/common/TestJspHelper.java
Thu Mar  3 01:24:26 2011
@@ -78,17 +78,16 @@ public class TestJspHelper {
         tokenString);
     when(request.getRemoteUser()).thenReturn(user);
 
+    when(request.getParameter(JspHelper.NAMENODE_ADDRESS)).thenReturn(
+        "1.1.1.1:1111");
+
     conf.set(DFSConfigKeys.HADOOP_SECURITY_AUTHENTICATION, "kerberos");
     UserGroupInformation.setConfiguration(conf);
 
-    InetSocketAddress serviceAddr = NameNode.getAddress(conf);
-    Text tokenService = new Text(serviceAddr.getAddress().getHostAddress()
-        + ":" + serviceAddr.getPort());
-
     UserGroupInformation ugi = JspHelper.getUGI(request, conf);
     Token<? extends TokenIdentifier> tokenInUgi = ugi.getTokens().iterator()
         .next();
-    Assert.assertEquals(tokenInUgi.getService(), tokenService);
+    Assert.assertEquals(tokenInUgi.getService().toString(), "1.1.1.1:1111");
   }
   
   @Test



Mime
View raw message