hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject svn commit: r1346239 - in /hadoop/common/branches/branch-0.22/hdfs: CHANGES.txt src/java/org/apache/hadoop/hdfs/HftpFileSystem.java
Date Tue, 05 Jun 2012 04:58:07 GMT
Author: shv
Date: Tue Jun  5 04:58:06 2012
New Revision: 1346239

URL: http://svn.apache.org/viewvc?rev=1346239&view=rev
Log:
HDFS-1584. Check TGT and renew if needed when fetching delegation tokens using HFTP. Contributed
by Kan Zhang and Benoy Antony.

Modified:
    hadoop/common/branches/branch-0.22/hdfs/CHANGES.txt
    hadoop/common/branches/branch-0.22/hdfs/src/java/org/apache/hadoop/hdfs/HftpFileSystem.java

Modified: hadoop/common/branches/branch-0.22/hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.22/hdfs/CHANGES.txt?rev=1346239&r1=1346238&r2=1346239&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.22/hdfs/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.22/hdfs/CHANGES.txt Tue Jun  5 04:58:06 2012
@@ -46,6 +46,9 @@ Release 0.22.1 - Unreleased
     pass exception information back to the caller.
     (Boris Shkolnik and Benoy Antony via shv)
 
+    HDFS-1584. Check TGT and renew if needed when fetching delegation tokens
+    using HFTP. (Kan Zhang and Benoy Antony via shv)
+
 Release 0.22.0 - 2011-11-29
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-0.22/hdfs/src/java/org/apache/hadoop/hdfs/HftpFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.22/hdfs/src/java/org/apache/hadoop/hdfs/HftpFileSystem.java?rev=1346239&r1=1346238&r2=1346239&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.22/hdfs/src/java/org/apache/hadoop/hdfs/HftpFileSystem.java
(original)
+++ hadoop/common/branches/branch-0.22/hdfs/src/java/org/apache/hadoop/hdfs/HftpFileSystem.java
Tue Jun  5 04:58:06 2012
@@ -188,9 +188,6 @@ public class HftpFileSystem extends File
         }
       }
       
-      //Renew TGT if needed
-      ugi.reloginFromKeytab();
-      
       //since we don't already have a token, go get one over https
       if (delegationToken == null) {
         delegationToken = 
@@ -202,8 +199,10 @@ public class HftpFileSystem extends File
   
 
   @Override
-  public Token<?> getDelegationToken(final String renewer) throws IOException {
+  public synchronized Token<?> getDelegationToken(final String renewer) throws IOException
{
     try {
+      //Renew TGT if needed
+      ugi.reloginFromKeytab();
       return ugi.doAs(new PrivilegedExceptionAction<Token<?>>() {
         public Token<?> run() throws IOException {
           Credentials c;



Mime
View raw message