hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r1355382 - in /hadoop/common/trunk/hadoop-mapreduce-project: ./ hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/jobcontrol/ hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/jav...
Date Fri, 29 Jun 2012 13:41:47 GMT
Author: bobby
Date: Fri Jun 29 13:41:46 2012
New Revision: 1355382

URL: http://svn.apache.org/viewvc?rev=1355382&view=rev
Log:
Reverting MAPREDUCE-4371 to address test failures.

Removed:
    hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/test/java/org/apache/hadoop/mapreduce/lib/jobcontrol/TestJobControl.java
Modified:
    hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
    hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/jobcontrol/JobControl.java

Modified: hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt?rev=1355382&r1=1355381&r2=1355382&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/CHANGES.txt Fri Jun 29 13:41:46 2012
@@ -123,9 +123,6 @@ Trunk (unreleased changes)
 
     MAPREDUCE-3868. Make Raid Compile. (Weiyan Wang via schen)
 
-    MAPREDUCE-4371. Check for cyclic dependencies in Jobcontrol job DAG
-    (madhukara phatak via bobby)
-
 Branch-2 ( Unreleased changes )
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/jobcontrol/JobControl.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/jobcontrol/JobControl.java?rev=1355382&r1=1355381&r2=1355382&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/jobcontrol/JobControl.java
(original)
+++ hadoop/common/trunk/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapreduce/lib/jobcontrol/JobControl.java
Fri Jun 29 13:41:46 2012
@@ -24,8 +24,6 @@ import java.util.Collection;
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.HashMap;
-import java.util.HashSet;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -217,10 +215,6 @@ public class JobControl implements Runna
         }
         
         synchronized(this) {
-          if (isCircular(jobsInProgress)) {
-	    throw new IllegalArgumentException(
-		"job control has circular dependency");
-	  }
           Iterator<ControlledJob> it = jobsInProgress.iterator();
           while(it.hasNext()) {
             ControlledJob j = it.next();
@@ -287,64 +281,4 @@ public class JobControl implements Runna
       }
     }
   }
-
- /**
-   * Uses topological sorting algorithm for finding circular dependency
-   */
-  private boolean isCircular(final List<ControlledJob> jobList) {
-    boolean cyclePresent = false;
-    HashSet<ControlledJob> SourceSet = new HashSet<ControlledJob>();
-    HashMap<ControlledJob, List<ControlledJob>> processedMap =
-	new HashMap<ControlledJob, List<ControlledJob>>();
-    for (ControlledJob n : jobList) {
-      processedMap.put(n, new ArrayList<ControlledJob>());
-    }
-    for (ControlledJob n : jobList) {
-      if (!hasInComingEdge(n, jobList, processedMap)) {
-	SourceSet.add(n);
-      }
-    }
-    while (!SourceSet.isEmpty()) {
-      ControlledJob controlledJob = SourceSet.iterator().next();
-      SourceSet.remove(controlledJob);
-      if (controlledJob.getDependentJobs() != null) {
-	for (int i = 0; i < controlledJob.getDependentJobs().size(); i++) {
-	  ControlledJob depenControlledJob =
-	      controlledJob.getDependentJobs().get(i);
-	  processedMap.get(controlledJob).add(depenControlledJob);
-	  if (!hasInComingEdge(controlledJob, jobList, processedMap)) {
-	    SourceSet.add(depenControlledJob);
-	  }
-	}
-      }
-    }
-
-    for (ControlledJob controlledJob : jobList) {
-      if (controlledJob.getDependentJobs() != null
-	  && controlledJob.getDependentJobs().size() != processedMap.get(
-	      controlledJob).size()) {
-	cyclePresent = true;
-	LOG.error("Job control has circular dependency for the  job "
-	    + controlledJob.getJobName());
-	break;
-      }
-    }
-    return cyclePresent;
-  }
-
-  private boolean hasInComingEdge(ControlledJob controlledJob,
-      List<ControlledJob> controlledJobList,
-      HashMap<ControlledJob, List<ControlledJob>> processedMap) {
-    boolean hasIncomingEdge = false;
-    for (ControlledJob k : controlledJobList) {
-      if (k != controlledJob && k.getDependentJobs() != null
-	  && !processedMap.get(k).contains(controlledJob)
-	  && k.getDependentJobs().contains(controlledJob)) {
-	hasIncomingEdge = true;
-	break;
-      }
-    }
-    return hasIncomingEdge;
-
-  }
 }



Mime
View raw message