From c09246b2e80fbdc17e3d67fe9b119b5352bdeb4a Mon Sep 17 00:00:00 2001 From: Arun Murthy Date: Sat, 17 Sep 2011 07:16:47 +0000 Subject: [PATCH] Fixed broken merge for MAPREDUCE-2987 git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1171924 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop/mapreduce/task/JobContextImpl.java | 7 +------ .../java/org/apache/hadoop/mapred/YARNRunner.java | 13 +++++++++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/JobContextImpl.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/JobContextImpl.java index 1cf2f4ea5ae..85cdaf07be4 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/JobContextImpl.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/task/JobContextImpl.java @@ -27,7 +27,6 @@ import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration.IntegerRanges; import org.apache.hadoop.fs.Path; import org.apache.hadoop.io.RawComparator; -import org.apache.hadoop.mapred.JobConf; import org.apache.hadoop.mapreduce.InputFormat; import org.apache.hadoop.mapreduce.Job; import org.apache.hadoop.mapreduce.JobContext; @@ -61,11 +60,7 @@ public class JobContextImpl implements JobContext { protected final Credentials credentials; public JobContextImpl(Configuration conf, JobID jobId) { - if (conf instanceof JobConf) { - this.conf = (JobConf)conf; - } else { - this.conf = new org.apache.hadoop.mapred.JobConf(conf); - } + this.conf = new org.apache.hadoop.mapred.JobConf(conf); this.jobId = jobId; this.credentials = this.conf.getCredentials(); try { diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java index ff59b0bb448..37516460103 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/main/java/org/apache/hadoop/mapred/YARNRunner.java @@ -223,10 +223,23 @@ public class YARNRunner implements ClientProtocol { throw new YarnException(e); } + // XXX Remove + Path submitJobDir = new Path(jobSubmitDir); + FileContext defaultFS = FileContext.getFileContext(conf); + Path submitJobFile = + defaultFS.makeQualified(JobSubmissionFiles.getJobConfPath(submitJobDir)); + FSDataInputStream in = defaultFS.open(submitJobFile); + conf.addResource(in); + // --- + // Construct necessary information to start the MR AM ApplicationSubmissionContext appContext = createApplicationSubmissionContext(conf, jobSubmitDir, ts); + // XXX Remove + in.close(); + // --- + // Submit to ResourceManager ApplicationId applicationId = resMgrDelegate.submitApplication(appContext);