hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1301285 - in /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs: CHANGES.txt src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestDelegationTokensWithHA.java
Date Fri, 16 Mar 2012 00:00:29 GMT
Author: todd
Date: Fri Mar 16 00:00:29 2012
New Revision: 1301285

URL: http://svn.apache.org/viewvc?rev=1301285&view=rev
Log:
HDFS-3062. Fix bug which prevented MR job submission from creating delegation tokens on an
HA cluster. Contributed by Mingjie Lai.

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/DistributedFileSystem.java
    hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestDelegationTokensWithHA.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=1301285&r1=1301284&r2=1301285&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Fri Mar 16 00:00:29 2012
@@ -306,6 +306,9 @@ Release 0.23.3 - UNRELEASED 
     HDFS-3099. SecondaryNameNode does not properly initialize metrics system.
     (atm)
 
+    HDFS-3062. Fix bug which prevented MR job submission from creating
+    delegation tokens on an HA cluster. (Mingjie Lai via todd)
+
   BREAKDOWN OF HDFS-1623 SUBTASKS
 
     HDFS-2179. Add fencing framework and mechanisms for NameNode HA. (todd)

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java?rev=1301285&r1=1301284&r2=1301285&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DistributedFileSystem.java
Fri Mar 16 00:00:29 2012
@@ -840,4 +840,18 @@ public class DistributedFileSystem exten
   public void setBalancerBandwidth(long bandwidth) throws IOException {
     dfs.setBalancerBandwidth(bandwidth);
   }
+
+  /**
+   * Get a canonical service name for this file system. If the URI is logical,
+   * the hostname part of the URI will be returned.
+   * @return a service string that uniquely identifies this file system.
+   */
+  @Override
+  public String getCanonicalServiceName() {
+    if (HAUtil.isLogicalUri(getConf(), getUri())) {
+      return getUri().getHost();
+    } else {
+      return super.getCanonicalServiceName();
+    }
+  }
 }

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestDelegationTokensWithHA.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestDelegationTokensWithHA.java?rev=1301285&r1=1301284&r2=1301285&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestDelegationTokensWithHA.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestDelegationTokensWithHA.java
Fri Mar 16 00:00:29 2012
@@ -204,6 +204,17 @@ public class TestDelegationTokensWithHA 
     assertArrayEquals(token.getIdentifier(), token2.getIdentifier());
     assertArrayEquals(token.getPassword(), token2.getPassword());
   }
+
+  /**
+   * HDFS-3062: DistributedFileSystem.getCanonicalServiceName() throws an
+   * exception if the URI is a logical URI. This bug fails the combination of
+   * ha + mapred + security.
+   */
+  @Test
+  public void testDFSGetCanonicalServiceName() throws Exception {
+    assertEquals(fs.getCanonicalServiceName(), 
+        HATestUtil.getLogicalUri(cluster).getHost());
+  }
   
   enum TokenTestAction {
     RENEW, CANCEL;



Mime
View raw message