From cc8a0cab59e9f7db462e5bebbe0046a62b463c3f Mon Sep 17 00:00:00 2001 From: Sanford Ryza Date: Tue, 1 Oct 2013 20:01:20 +0000 Subject: [PATCH] MAPREDUCE-5544. JobClient#getJob loads job conf twice. (Sandy Ryza) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1528196 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 2 ++ .../main/java/org/apache/hadoop/mapred/JobClient.java | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index c3ac3f10b35..6421c6d543b 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -253,6 +253,8 @@ Release 2.1.2 - UNRELEASED SequenceFileAsBinaryOutputFormat.WritableValueBytes by re-introducing missing constructors. (Zhijie Shen via acmurthy) + MAPREDUCE-5544. JobClient#getJob loads job conf twice. (Sandy Ryza) + Release 2.1.1-beta - 2013-09-23 INCOMPATIBLE CHANGES diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java index 0393130ad53..89a966eb84c 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java @@ -173,7 +173,12 @@ public class JobClient extends CLI { * job completes.) */ public NetworkedJob(JobStatus status, Cluster cluster) throws IOException { - job = Job.getInstance(cluster, status, new JobConf(status.getJobFile())); + this(status, cluster, new JobConf(status.getJobFile())); + } + + private NetworkedJob(JobStatus status, Cluster cluster, JobConf conf) + throws IOException { + this(Job.getInstance(cluster, status, conf)); } public NetworkedJob(Job job) throws IOException { @@ -592,7 +597,8 @@ public class JobClient extends CLI { if (job != null) { JobStatus status = JobStatus.downgrade(job.getStatus()); if (status != null) { - return new NetworkedJob(status, cluster); + return new NetworkedJob(status, cluster, + new JobConf(job.getConfiguration())); } } } catch (InterruptedException ie) {