hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077315 - /hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java
Date Fri, 04 Mar 2011 04:02:42 GMT
Author: omalley
Date: Fri Mar  4 04:02:42 2011
New Revision: 1077315

URL: http://svn.apache.org/viewvc?rev=1077315&view=rev
Log:
commit 5e3d72791242c2c58a7c14d24e90e56d4e597d6f
Author: Boris Shkolnik <borya@yahoo-inc.com>
Date:   Thu Mar 11 17:28:05 2010 -0800

    HDFS:1036 from https://issues.apache.org/jira/secure/attachment/12438549/HDFS-1036-BP20.patch
    
    +++ b/YAHOO-CHANGES.txt
    +    HDFS-1036. in DelegationTokenFetch dfs.getURI returns no port (boryas)
    +

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java?rev=1077315&r1=1077314&r2=1077315&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/tools/DelegationTokenFetcher.java
Fri Mar  4 04:02:42 2011
@@ -23,6 +23,7 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.InetAddress;
+import java.net.URI;
 import java.net.URL;
 import java.net.URLConnection;
 import java.security.PrivilegedExceptionAction;
@@ -30,11 +31,11 @@ import java.security.PrivilegedException
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.hdfs.DistributedFileSystem;
-import org.apache.hadoop.security.SecurityUtil;
 import org.apache.hadoop.hdfs.security.token.delegation.DelegationTokenIdentifier;
 import org.apache.hadoop.hdfs.server.namenode.DelegationTokenServlet;
 import org.apache.hadoop.io.Text;
 import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.SecurityUtil;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.security.token.Token;
 import org.apache.hadoop.util.StringUtils;
@@ -119,9 +120,9 @@ public class DelegationTokenFetcher {
       dfs.getDelegationToken(new Text(fullName));
     
     // Reconstruct the ip:port of the Namenode
+    URI uri = dfs.getDefaultUri(dfs.getConf());
     String nnAddress = 
-      InetAddress.getByName(dfs.getUri().getHost()).getHostAddress() 
-      + ":" + dfs.getUri().getPort();
+      InetAddress.getByName(uri.getHost()).getHostAddress() + ":" + uri.getPort();
     token.setService(new Text(nnAddress));
     
     Credentials ts = new Credentials();



Mime
View raw message