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/trunk@1489219 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arun Murthy 2013-06-03 22:54:48 +00:00
parent 0add6b4edc
commit 1caf3e363f
3 changed files with 21 additions and 6 deletions

View File

@ -484,6 +484,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

@ -31,6 +31,7 @@ import org.apache.commons.logging.Log;
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;
@ -137,8 +138,8 @@ public class JobControl implements Runnable {
}
/**
* 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();
@ -147,7 +148,15 @@ public class JobControl implements Runnable {
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.FileSystem;
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 class TestJobControl extends junit.framework.TestCase {
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);