hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r795489 - in /hadoop/mapreduce/trunk: ./ src/java/org/apache/hadoop/mapred/jobcontrol/ src/java/org/apache/hadoop/mapreduce/lib/jobcontrol/ src/test/mapred/org/apache/hadoop/mapreduce/lib/jobcontrol/
Date Sun, 19 Jul 2009 07:31:01 GMT
Author: cdouglas
Date: Sun Jul 19 07:31:00 2009
New Revision: 795489

URL: http://svn.apache.org/viewvc?rev=795489&view=rev
Log:
MAPREDUCE-245. Change Job and jobcontrol classes to use the List interface
rather than ArrayList in APIs. Contributed by Tom White

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/jobcontrol/Job.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/jobcontrol/JobControl.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/lib/jobcontrol/ControlledJob.java
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/lib/jobcontrol/JobControl.java
    hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControl.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=795489&r1=795488&r2=795489&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Sun Jul 19 07:31:00 2009
@@ -11,6 +11,9 @@
     and org.apache.hadoop.examples.AggregateWordHistogram to use new 
     mapreduce api. (Amareshwari Sriramadasu via sharad)
 
+    MAPREDUCE-245. Change Job and jobcontrol classes to use the List interface
+    rather than ArrayList in APIs. (Tom White via cdouglas)
+
   NEW FEATURES
 
     MAPREDUCE-546. Provide sample fair scheduler config file in conf/ and use

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/jobcontrol/Job.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/jobcontrol/Job.java?rev=795489&r1=795488&r2=795489&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/jobcontrol/Job.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/jobcontrol/Job.java Sun Jul 19
07:31:00 2009
@@ -21,6 +21,7 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -51,7 +52,7 @@
   @SuppressWarnings("unchecked")
   public Job(JobConf jobConf, ArrayList<?> dependingJobs) throws IOException {
     super(new org.apache.hadoop.mapreduce.Job(jobConf), 
-          (ArrayList<ControlledJob>) dependingJobs);
+          (List<ControlledJob>) dependingJobs);
   }
 
   public Job(JobConf conf) throws IOException {

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/jobcontrol/JobControl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/jobcontrol/JobControl.java?rev=795489&r1=795488&r2=795489&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/jobcontrol/JobControl.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/jobcontrol/JobControl.java Sun
Jul 19 07:31:00 2009
@@ -20,6 +20,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.List;
 
 import org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob;
 
@@ -39,7 +40,7 @@
     super(groupName);
   }
   
-  static ArrayList<Job> castToJobList(ArrayList<ControlledJob> cjobs) {
+  static ArrayList<Job> castToJobList(List<ControlledJob> cjobs) {
     ArrayList<Job> ret = new ArrayList<Job>();
     for (ControlledJob job : cjobs) {
       ret.add((Job)job);

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/lib/jobcontrol/ControlledJob.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/lib/jobcontrol/ControlledJob.java?rev=795489&r1=795488&r2=795489&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/lib/jobcontrol/ControlledJob.java
(original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/lib/jobcontrol/ControlledJob.java
Sun Jul 19 07:31:00 2009
@@ -21,6 +21,7 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
@@ -54,14 +55,14 @@
   // some info for human consumption, e.g. the reason why the job failed
   private String message;
   // the jobs the current job depends on
-  private ArrayList<ControlledJob> dependingJobs;
+  private List<ControlledJob> dependingJobs;
 	
   /** 
    * Construct a job.
    * @param job a mapreduce job to be executed.
    * @param dependingJobs an array of jobs the current job depends on
    */
-  public ControlledJob(Job job, ArrayList<ControlledJob> dependingJobs) 
+  public ControlledJob(Job job, List<ControlledJob> dependingJobs) 
       throws IOException {
     this.job = job;
     this.dependingJobs = dependingJobs;
@@ -188,7 +189,7 @@
   /**
    * @return the depending jobs of this job
    */
-  public ArrayList<ControlledJob> getDependentJobs() {
+  public List<ControlledJob> getDependentJobs() {
     return this.dependingJobs;
   }
   

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/lib/jobcontrol/JobControl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/lib/jobcontrol/JobControl.java?rev=795489&r1=795488&r2=795489&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/lib/jobcontrol/JobControl.java
(original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapreduce/lib/jobcontrol/JobControl.java
Sun Jul 19 07:31:00 2009
@@ -21,6 +21,7 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Hashtable;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.hadoop.mapreduce.lib.jobcontrol.ControlledJob.State;
@@ -73,7 +74,7 @@
     this.runnerState = ThreadState.READY;
   }
 	
-  private static ArrayList<ControlledJob> toArrayList(
+  private static List<ControlledJob> toList(
                    Map<String, ControlledJob> jobs) {
     ArrayList<ControlledJob> retv = new ArrayList<ControlledJob>();
     synchronized (jobs) {
@@ -87,33 +88,33 @@
   /**
    * @return the jobs in the waiting state
    */
-  public ArrayList<ControlledJob> getWaitingJobList() {
-    return toArrayList(this.waitingJobs);
+  public List<ControlledJob> getWaitingJobList() {
+    return toList(this.waitingJobs);
   }
 	
   /**
    * @return the jobs in the running state
    */
-  public ArrayList<ControlledJob> getRunningJobList() {
-    return toArrayList(this.runningJobs);
+  public List<ControlledJob> getRunningJobList() {
+    return toList(this.runningJobs);
   }
 	
   /**
    * @return the jobs in the ready state
    */
-  public ArrayList<ControlledJob> getReadyJobsList() {
-    return toArrayList(this.readyJobs);
+  public List<ControlledJob> getReadyJobsList() {
+    return toList(this.readyJobs);
   }
 	
   /**
    * @return the jobs in the success state
    */
-  public ArrayList<ControlledJob> getSuccessfulJobList() {
-    return toArrayList(this.successfulJobs);
+  public List<ControlledJob> getSuccessfulJobList() {
+    return toList(this.successfulJobs);
   }
 	
-  public ArrayList<ControlledJob> getFailedJobList() {
-    return toArrayList(this.failedJobs);
+  public List<ControlledJob> getFailedJobList() {
+    return toList(this.failedJobs);
   }
 	
   private String getNextJobID() {

Modified: hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControl.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControl.java?rev=795489&r1=795488&r2=795489&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControl.java
(original)
+++ hadoop/mapreduce/trunk/src/test/mapred/org/apache/hadoop/mapreduce/lib/jobcontrol/TestMapReduceJobControl.java
Sun Jul 19 07:31:00 2009
@@ -20,6 +20,7 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.List;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
@@ -77,7 +78,7 @@
    */
   private JobControl createDependencies(Configuration conf, Job job1) 
       throws Exception {
-    ArrayList<ControlledJob> dependingJobs = null;
+    List<ControlledJob> dependingJobs = null;
     cjob1 = new ControlledJob(job1, dependingJobs);
     Job job2 = MapReduceTestUtil.createCopyJob(conf, outdir_2, indir);
     cjob2 = new ControlledJob(job2, dependingJobs);



Mime
View raw message