소스 검색

svn merge -c 1371325 FIXES: MAPREDUCE-3782. teragen terasort jobs fail when using webhdfs:// (Jason Lowe via bobby)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.1.0-alpha@1371333 13f79535-47bb-0310-9956-ffa450edef68
Robert Joseph Evans 12 년 전
부모
커밋
9d4ab5ec61

+ 3 - 0
hadoop-mapreduce-project/CHANGES.txt

@@ -581,6 +581,9 @@ Release 0.23.3 - UNRELEASED
     MAPREDUCE-4299. Terasort hangs with MR2 FifoScheduler (Tom White via
     bobby)
 
+    MAPREDUCE-3782. teragen terasort jobs fail when using webhdfs:// (Jason
+    Lowe via bobby)
+
 Release 0.23.2 - UNRELEASED
 
   INCOMPATIBLE CHANGES

+ 5 - 0
hadoop-mapreduce-project/hadoop-mapreduce-examples/src/main/java/org/apache/hadoop/examples/terasort/TeraOutputFormat.java

@@ -31,6 +31,7 @@ import org.apache.hadoop.mapreduce.RecordWriter;
 import org.apache.hadoop.mapreduce.TaskAttemptContext;
 import org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter;
 import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
+import org.apache.hadoop.mapreduce.security.TokenCache;
 
 /**
  * An output format that writes the key and value appended together.
@@ -85,6 +86,10 @@ public class TeraOutputFormat extends FileOutputFormat<Text,Text> {
     if (outDir == null) {
       throw new InvalidJobConfException("Output directory not set in JobConf.");
     }
+
+    // get delegation token for outDir's file system
+    TokenCache.obtainTokensForNamenodes(job.getCredentials(),
+        new Path[] { outDir }, job.getConfiguration());
   }
 
   public RecordWriter<Text,Text> getRecordWriter(TaskAttemptContext job