hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r395001 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/InterTrackerProtocol.java src/java/org/apache/hadoop/mapred/JobTracker.java src/java/org/apache/hadoop/mapred/TaskTracker.java
Date Tue, 18 Apr 2006 19:03:54 GMT
Author: cutting
Date: Tue Apr 18 12:03:53 2006
New Revision: 395001

URL: http://svn.apache.org/viewcvs?rev=395001&view=rev
Log:
Fix HADOOP-138.  Stop multiple tasks per heartbeat.  Contributed by Stefan.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/InterTrackerProtocol.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/CHANGES.txt?rev=395001&r1=395000&r2=395001&view=diff
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Tue Apr 18 12:03:53 2006
@@ -43,6 +43,9 @@
 11. Fix HADOOP-118.  In DFS, improve clean up of abandoned file
     creations.  (omalley via cutting)
 
+12. Fix HADOOP-138.  Stop multiple tasks in a single heartbeat, rather
+    than one per heartbeat.  (Stefan via cutting)
+
 
 Release 0.1.1 - 2006-04-08
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/InterTrackerProtocol.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/InterTrackerProtocol.java?rev=395001&r1=395000&r2=395001&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/InterTrackerProtocol.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/InterTrackerProtocol.java Tue Apr
18 12:03:53 2006
@@ -43,7 +43,7 @@
    * be closed because their job is complete.  This is used to, e.g., 
    * notify a map task that its output is no longer needed and may 
    * be removed. */
-  String pollForTaskWithClosedJob(String trackerName);
+  String[] pollForTaskWithClosedJob(String trackerName);
 
   /** Called by a reduce task to find which map tasks are completed.
    *

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java?rev=395001&r1=395000&r2=395001&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java Tue Apr 18 12:03:53
2006
@@ -671,9 +671,10 @@
      * A tracker wants to know if any of its Tasks have been
      * closed (because the job completed, whether successfully or not)
      */
-    public synchronized String pollForTaskWithClosedJob(String taskTracker) {
+    public synchronized String[] pollForTaskWithClosedJob(String taskTracker) {
         TreeSet taskIds = (TreeSet) trackerToTaskMap.get(taskTracker);
         if (taskIds != null) {
+            ArrayList list = new ArrayList();
             for (Iterator it = taskIds.iterator(); it.hasNext(); ) {
                 String taskId = (String) it.next();
                 TaskInProgress tip = (TaskInProgress) taskidToTIPMap.get(taskId);
@@ -683,9 +684,10 @@
                     // It may be successfully completed, or may be killed in
                     // mid-execution.
                     //
-                    return taskId;
+                   list.add(taskId);
                 }
             }
+            return (String[]) list.toArray(new String[list.size()]);
         }
         return null;
     }

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java?rev=395001&r1=395000&r2=395001&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java Tue Apr 18 12:03:53
2006
@@ -306,11 +306,13 @@
             //
             // Check for any Tasks whose job may have ended
             //
-            String toCloseId = jobClient.pollForTaskWithClosedJob(taskTrackerName);
-            if (toCloseId != null) {
+            String[] toCloseIds = jobClient.pollForTaskWithClosedJob(taskTrackerName);
+            if (toCloseIds != null) {
               synchronized (this) {
-                TaskInProgress tip = (TaskInProgress) tasks.get(toCloseId);
-                tip.jobHasFinished();
+                for (int i = 0; i < toCloseIds.length; i++) {
+                  TaskInProgress tip = (TaskInProgress) tasks.get(toCloseIds[i]);
+                  tip.jobHasFinished();                        
+                }
               }
             }
             lastHeartbeat = now;



Mime
View raw message