Return-Path: Delivered-To: apmail-hadoop-hdfs-commits-archive@minotaur.apache.org Received: (qmail 69977 invoked from network); 23 Jul 2010 22:50:23 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 23 Jul 2010 22:50:23 -0000 Received: (qmail 21408 invoked by uid 500); 23 Jul 2010 22:50:23 -0000 Delivered-To: apmail-hadoop-hdfs-commits-archive@hadoop.apache.org Received: (qmail 21355 invoked by uid 500); 23 Jul 2010 22:50:22 -0000 Mailing-List: contact hdfs-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-dev@hadoop.apache.org Delivered-To: mailing list hdfs-commits@hadoop.apache.org Received: (qmail 21347 invoked by uid 99); 23 Jul 2010 22:50:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Jul 2010 22:50:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Jul 2010 22:50:19 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 590A12388999; Fri, 23 Jul 2010 22:49:26 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r967292 - in /hadoop/hdfs/trunk: CHANGES.txt src/java/org/apache/hadoop/hdfs/HftpFileSystem.java Date: Fri, 23 Jul 2010 22:49:26 -0000 To: hdfs-commits@hadoop.apache.org From: boryas@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100723224926.590A12388999@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: boryas Date: Fri Jul 23 22:49:25 2010 New Revision: 967292 URL: http://svn.apache.org/viewvc?rev=967292&view=rev Log: HDFS-1308. job conf key for the services name of DelegationToken for HFTP url is constructed incorrectly in HFTPFileSystem Modified: hadoop/hdfs/trunk/CHANGES.txt hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/HftpFileSystem.java Modified: hadoop/hdfs/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=967292&r1=967291&r2=967292&view=diff ============================================================================== --- hadoop/hdfs/trunk/CHANGES.txt (original) +++ hadoop/hdfs/trunk/CHANGES.txt Fri Jul 23 22:49:25 2010 @@ -160,6 +160,9 @@ Trunk (unreleased changes) HDFS-1085. HFTP read may fail silently on the client side if there is an exception on the server side. (szetszwo) + HDFS-1308. job conf key for the services name of DelegationToken for HFTP + url is constructed incorrectly in HFTPFileSystem (boryas) + Release 0.21.0 - Unreleased INCOMPATIBLE CHANGES Modified: hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/HftpFileSystem.java URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/HftpFileSystem.java?rev=967292&r1=967291&r2=967292&view=diff ============================================================================== --- hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/HftpFileSystem.java (original) +++ hadoop/hdfs/trunk/src/java/org/apache/hadoop/hdfs/HftpFileSystem.java Fri Jul 23 22:49:25 2010 @@ -47,11 +47,13 @@ import org.apache.hadoop.fs.MD5MD5CRC32F import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.hdfs.server.common.JspHelper; +import org.apache.hadoop.hdfs.server.namenode.NameNode; import org.apache.hadoop.hdfs.tools.DelegationTokenFetcher; import org.apache.hadoop.io.Text; import org.apache.hadoop.ipc.RemoteException; import org.apache.hadoop.net.NetUtils; 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.security.token.TokenIdentifier; @@ -110,17 +112,16 @@ public class HftpFileSystem extends File nnAddr = NetUtils.createSocketAddr(name.toString()); if (UserGroupInformation.isSecurityEnabled()) { - StringBuffer sb = new StringBuffer(HFTP_SERVICE_NAME_KEY); // configuration has the actual service name for this url. Build the key // and get it. - final String key = sb.append(NetUtils.normalizeHostName(name.getHost())). - append(".").append(name.getPort()).toString(); + final String key = HftpFileSystem.HFTP_SERVICE_NAME_KEY + + SecurityUtil.buildDTServiceName(name, NameNode.DEFAULT_PORT); - LOG.debug("Trying to find DT for " + name + " using key=" + key + "; conf=" + conf.get(key, "")); + LOG.debug("Trying to find DT for " + name + " using key=" + key + + "; conf=" + conf.get(key, "")); Text nnServiceNameText = new Text(conf.get(key, "")); - Collection> tokens = - ugi.getTokens(); + Collection> tokens = ugi.getTokens(); //try finding a token for this namenode (esp applicable for tasks //using hftp). If there exists one, just set the delegationField for (Token t : tokens) {