hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jiten...@apache.org
Subject svn commit: r1171194 - in /hadoop/common/branches/branch-0.20-security-205: ./ src/core/org/apache/hadoop/fs/ src/mapred/org/apache/hadoop/mapreduce/security/ src/test/org/apache/hadoop/fs/ src/test/org/apache/hadoop/mapreduce/security/ src/test/org/ap...
Date Thu, 15 Sep 2011 17:48:23 GMT
Author: jitendra
Date: Thu Sep 15 17:48:23 2011
New Revision: 1171194

URL: http://svn.apache.org/viewvc?rev=1171194&view=rev
Log:
Merge r1171181 from branch-0.20-security to fix HADOOP-7602.


Added:
    hadoop/common/branches/branch-0.20-security-205/src/test/org/apache/hadoop/tools/TestHadoopArchives.java
      - copied unchanged from r1171181, hadoop/common/branches/branch-0.20-security/src/test/org/apache/hadoop/tools/TestHadoopArchives.java
Modified:
    hadoop/common/branches/branch-0.20-security-205/CHANGES.txt   (contents, props changed)
    hadoop/common/branches/branch-0.20-security-205/src/core/org/apache/hadoop/fs/HarFileSystem.java
  (contents, props changed)
    hadoop/common/branches/branch-0.20-security-205/src/mapred/org/apache/hadoop/mapreduce/security/TokenCache.java
    hadoop/common/branches/branch-0.20-security-205/src/test/org/apache/hadoop/fs/TestHarFileSystem.java
  (props changed)
    hadoop/common/branches/branch-0.20-security-205/src/test/org/apache/hadoop/mapreduce/security/TestTokenCache.java
    hadoop/common/branches/branch-0.20-security-205/src/tools/org/apache/hadoop/tools/HadoopArchives.java
  (props changed)

Modified: hadoop/common/branches/branch-0.20-security-205/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-205/CHANGES.txt?rev=1171194&r1=1171193&r2=1171194&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-205/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20-security-205/CHANGES.txt Thu Sep 15 17:48:23 2011
@@ -142,6 +142,9 @@ Release 0.20.205.0 - 2011.09.12
     HDFS-2328. HFTP throws NPE if security is enabled locally, but not 
     remotely. (omalley)
 
+    HADOOP-7602. wordcount, sort etc on har files fails with NPE.
+    (John George via jitendra)
+
   IMPROVEMENTS
 
     MAPREDUCE-2187. Reporter sends progress during sort/merge. (Anupam Seth via

Propchange: hadoop/common/branches/branch-0.20-security-205/CHANGES.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 15 17:48:23 2011
@@ -1,6 +1,6 @@
 /hadoop/common/branches/branch-0.20/CHANGES.txt:826138,826568,829987,831184,833001,880632,898713,909245,909723,960946,990003,1044225
 /hadoop/common/branches/branch-0.20-append/CHANGES.txt:955380,955398,955448,956329
-/hadoop/common/branches/branch-0.20-security/CHANGES.txt:1170042
+/hadoop/common/branches/branch-0.20-security/CHANGES.txt:1170042,1171181
 /hadoop/common/branches/branch-0.20-security-203/CHANGES.txt:1096071,1097011,1097249,1097269,1097281,1097966,1098816,1098819,1098823,1098827,1098832,1098839,1098854,1098863,1099088,1099191,1099324,1099330,1099333,1102071,1128115
 /hadoop/common/branches/branch-0.20-security-204/CHANGES.txt:1128390,1147228,1148069,1149316,1154413,1159730,1161741
 /hadoop/core/branches/branch-0.18/CHANGES.txt:727226

Modified: hadoop/common/branches/branch-0.20-security-205/src/core/org/apache/hadoop/fs/HarFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-205/src/core/org/apache/hadoop/fs/HarFileSystem.java?rev=1171194&r1=1171193&r2=1171194&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-205/src/core/org/apache/hadoop/fs/HarFileSystem.java
(original)
+++ hadoop/common/branches/branch-0.20-security-205/src/core/org/apache/hadoop/fs/HarFileSystem.java
Thu Sep 15 17:48:23 2011
@@ -269,6 +269,11 @@ public class HarFileSystem extends Filte
     return this.uri;
   }
   
+  @Override
+  public String getCanonicalServiceName() {
+    return null;
+  }
+  
   /**
    * this method returns the path 
    * inside the har filesystem.

Propchange: hadoop/common/branches/branch-0.20-security-205/src/core/org/apache/hadoop/fs/HarFileSystem.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 15 17:48:23 2011
@@ -1,6 +1,6 @@
 /hadoop/common/branches/branch-0.20/src/core/org/apache/hadoop/fs/HarFileSystem.java:990003
 /hadoop/common/branches/branch-0.20-append/src/core/org/apache/hadoop/fs/HarFileSystem.java:955380,955398,955448,956329
-/hadoop/common/branches/branch-0.20-security/src/core/org/apache/hadoop/fs/HarFileSystem.java:1170042
+/hadoop/common/branches/branch-0.20-security/src/core/org/apache/hadoop/fs/HarFileSystem.java:1170042,1171181
 /hadoop/common/branches/branch-0.20-security-203/src/core/org/apache/hadoop/fs/HarFileSystem.java:1097249,1097269,1097281,1097966,1098816,1098819,1098823,1098827,1098832,1098839,1098854,1098863,1099088,1099191,1099324,1099330,1099333,1128115
 /hadoop/common/branches/branch-0.20-security-204/src/core/org/apache/hadoop/fs/HarFileSystem.java:1128390
 /hadoop/common/trunk/src/core/org/apache/hadoop/fs/HarFileSystem.java:910709

Modified: hadoop/common/branches/branch-0.20-security-205/src/mapred/org/apache/hadoop/mapreduce/security/TokenCache.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-205/src/mapred/org/apache/hadoop/mapreduce/security/TokenCache.java?rev=1171194&r1=1171193&r2=1171194&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-205/src/mapred/org/apache/hadoop/mapreduce/security/TokenCache.java
(original)
+++ hadoop/common/branches/branch-0.20-security-205/src/mapred/org/apache/hadoop/mapreduce/security/TokenCache.java
Thu Sep 15 17:48:23 2011
@@ -90,6 +90,9 @@ public class TokenCache {
     for(Path p: ps) {
       FileSystem fs = FileSystem.get(p.toUri(), conf);
       String fsName = fs.getCanonicalServiceName();
+      if (fsName == null) {
+        continue;
+      }
       if (TokenCache.getDelegationToken(credentials, fsName) == null) {
         //TODO: Need to come up with a better place to put
         //this block of code to do with reading the file

Propchange: hadoop/common/branches/branch-0.20-security-205/src/test/org/apache/hadoop/fs/TestHarFileSystem.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 15 17:48:23 2011
@@ -1,6 +1,6 @@
 /hadoop/common/branches/branch-0.20/src/test/org/apache/hadoop/fs/TestHarFileSystem.java:990003
 /hadoop/common/branches/branch-0.20-append/src/test/org/apache/hadoop/fs/TestHarFileSystem.java:955380,955398,955448,956329
-/hadoop/common/branches/branch-0.20-security/src/test/org/apache/hadoop/fs/TestHarFileSystem.java:1170042
+/hadoop/common/branches/branch-0.20-security/src/test/org/apache/hadoop/fs/TestHarFileSystem.java:1170042,1171181
 /hadoop/common/branches/branch-0.20-security-203/src/test/org/apache/hadoop/fs/TestHarFileSystem.java:1097249,1097269,1097281,1097966,1098816,1098819,1098823,1098827,1098832,1098839,1098854,1098863,1099088,1099191,1099324,1099330,1099333,1128115
 /hadoop/common/branches/branch-0.20-security-204/src/test/org/apache/hadoop/fs/TestHarFileSystem.java:1128390
 /hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestHarFileSystem.java:979485

Modified: hadoop/common/branches/branch-0.20-security-205/src/test/org/apache/hadoop/mapreduce/security/TestTokenCache.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-205/src/test/org/apache/hadoop/mapreduce/security/TestTokenCache.java?rev=1171194&r1=1171193&r2=1171194&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-205/src/test/org/apache/hadoop/mapreduce/security/TestTokenCache.java
(original)
+++ hadoop/common/branches/branch-0.20-security-205/src/test/org/apache/hadoop/mapreduce/security/TestTokenCache.java
Thu Sep 15 17:48:23 2011
@@ -56,6 +56,7 @@ import org.apache.hadoop.security.Creden
 import org.apache.hadoop.security.SecurityUtil;
 import org.apache.hadoop.security.token.Token;
 import org.apache.hadoop.security.token.TokenIdentifier;
+import org.apache.hadoop.tools.HadoopArchives;
 import org.apache.hadoop.util.ToolRunner;
 import org.codehaus.jackson.map.ObjectMapper;
 import org.junit.AfterClass;
@@ -287,4 +288,29 @@ public class TestTokenCache {
       assertTrue("didn't find token for " + p1 ,found);
     }
   }
+
+  @Test
+  public void testGetTokensForUriWithoutAuth() throws IOException {
+    FileSystem fs = dfsCluster.getFileSystem();
+    HadoopArchives har = new HadoopArchives(jConf);
+    Path archivePath = new Path(fs.getHomeDirectory(), "tmp");
+    String[] args = new String[6];
+    args[0] = "-archiveName";
+    args[1] = "foo1.har";
+    args[2] = "-p";
+    args[3] = fs.getHomeDirectory().toString();
+    args[4] = "test";
+    args[5] = archivePath.toString();
+    try {
+      int ret = ToolRunner.run(har, args);
+    } catch (Exception e) {
+      fail("Could not create har file");
+    }
+    Path finalPath = new Path(archivePath, "foo1.har");
+    Path filePath = new Path(finalPath, "test");
+    
+    Credentials credentials = new Credentials();
+    TokenCache.obtainTokensForNamenodesInternal(
+      credentials, new Path [] {finalPath}, jConf);
+  }
 }

Propchange: hadoop/common/branches/branch-0.20-security-205/src/tools/org/apache/hadoop/tools/HadoopArchives.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 15 17:48:23 2011
@@ -1,6 +1,6 @@
 /hadoop/common/branches/branch-0.20/src/tools/org/apache/hadoop/tools/HadoopArchives.java:990003
 /hadoop/common/branches/branch-0.20-append/src/tools/org/apache/hadoop/tools/HadoopArchives.java:955380,955398,955448,956329
-/hadoop/common/branches/branch-0.20-security/src/tools/org/apache/hadoop/tools/HadoopArchives.java:1170042
+/hadoop/common/branches/branch-0.20-security/src/tools/org/apache/hadoop/tools/HadoopArchives.java:1170042,1171181
 /hadoop/common/branches/branch-0.20-security-203/src/tools/org/apache/hadoop/tools/HadoopArchives.java:1097249,1097269,1097281,1097966,1098816,1098819,1098823,1098827,1098832,1098839,1098854,1098863,1099088,1099191,1099324,1099330,1099333,1128115
 /hadoop/common/branches/branch-0.20-security-204/src/tools/org/apache/hadoop/tools/HadoopArchives.java:1128390
 /hadoop/common/trunk/src/tools/org/apache/hadoop/tools/HadoopArchives.java:910709



Mime
View raw message