MAPREDUCE-3782. teragen terasort jobs fail when using webhdfs:// (Jason Lowe via bobby)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1371325 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Joseph Evans 2012-08-09 17:29:36 +00:00
parent fb970f3df7
commit 201d0ecb78
2 changed files with 8 additions and 0 deletions

View File

@ -806,6 +806,9 @@ Release 0.23.3 - UNRELEASED
MAPREDUCE-4503. Should throw InvalidJobConfException if duplicates found in MAPREDUCE-4503. Should throw InvalidJobConfException if duplicates found in
cacheArchives or cacheFiles (Robert Evans via jeagles) cacheArchives or cacheFiles (Robert Evans via jeagles)
MAPREDUCE-3782. teragen terasort jobs fail when using webhdfs:// (Jason
Lowe via bobby)
Release 0.23.2 - UNRELEASED Release 0.23.2 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -31,6 +31,7 @@
import org.apache.hadoop.mapreduce.TaskAttemptContext; import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter; import org.apache.hadoop.mapreduce.lib.output.FileOutputCommitter;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat; 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. * An output format that writes the key and value appended together.
@ -85,6 +86,10 @@ public void checkOutputSpecs(JobContext job
if (outDir == null) { if (outDir == null) {
throw new InvalidJobConfException("Output directory not set in JobConf."); 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 public RecordWriter<Text,Text> getRecordWriter(TaskAttemptContext job