Merge -c 1489219 from trunk to branch-2 to fix MAPREDUCE-5296. Fix backward incompatibility for JobControl by adding the omitted addJob. Contributed by Zhijie Shen.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1489220 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arun Murthy 2013-06-03 22:55:22 +00:00
parent 89a1e48cd7
commit 1d77b6c417
3 changed files with 21 additions and 6 deletions

View File

@ -347,6 +347,9 @@ Release 2.1.0-beta - UNRELEASED
MAPREDUCE-5220. Fix backward incompatibility for TaskCompletionEvent by
adding back setTaskID. (Zhijie Shen via acmurthy)
MAPREDUCE-5296. Fix backward incompatibility for JobControl by adding the
omitted addJob. (Zhijie Shen via acmurthy)
BREAKDOWN OF HADOOP-8562 SUBTASKS
MAPREDUCE-4739. Some MapReduce tests fail to find winutils.

View File

@ -29,6 +29,7 @@
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
import org.apache.hadoop.mapred.jobcontrol.Job;
import org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob.State;
import org.apache.hadoop.util.StringUtils;
@ -135,8 +136,8 @@ private String getNextJobID() {
}
/**
* Add a new job.
* @param aJob the new job
* Add a new controlled job.
* @param aJob the new controlled job
*/
synchronized public String addJob(ControlledJob aJob) {
String id = this.getNextJobID();
@ -145,7 +146,15 @@ synchronized public String addJob(ControlledJob aJob) {
jobsInProgress.add(aJob);
return id;
}
/**
* Add a new job.
* @param aJob the new job
*/
synchronized public String addJob(Job aJob) {
return addJob((ControlledJob) aJob);
}
/**
* Add a collection of jobs
*

View File

@ -18,7 +18,9 @@
package org.apache.hadoop.mapred.jobcontrol;
import static org.mockito.Mockito.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.util.ArrayList;
@ -29,6 +31,7 @@
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapred.JobID;
import org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob;
import org.junit.Test;
/**
@ -99,8 +102,8 @@ public static void doJobControlTest() throws Exception {
Job job_4 = new Job(jobConf_4, dependingJobs);
JobControl theControl = new JobControl("Test");
theControl.addJob(job_1);
theControl.addJob(job_2);
theControl.addJob((ControlledJob) job_1);
theControl.addJob((ControlledJob) job_2);
theControl.addJob(job_3);
theControl.addJob(job_4);