hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r658035 - in /hadoop/core/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/TaskTracker.java src/webapps/task/tasktracker.jsp
Date Mon, 19 May 2008 23:09:41 GMT
Author: acmurthy
Date: Mon May 19 16:09:41 2008
New Revision: 658035

URL: http://svn.apache.org/viewvc?rev=658035&view=rev
Log:
Ensure that the TaskTracker.runningJobs data-structure is correctly cleaned-up on task completion.
Contributed by Zheng Shao.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java
    hadoop/core/trunk/src/webapps/task/tasktracker.jsp

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=658035&r1=658034&r2=658035&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Mon May 19 16:09:41 2008
@@ -291,6 +291,9 @@
     hierarchy. This also adds a new counter to track cache hits at levels
     greater than two. (Amar Kamat via cdouglas)
 
+    HADOOP-3370. Ensure that the TaskTracker.runningJobs data-structure is
+    correctly cleaned-up on task completion. (Zheng Shao via acmurthy) 
+
 Release 0.17.0 - 2008-05-18
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java?rev=658035&r1=658034&r2=658035&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java Mon May 19 16:09:41
2008
@@ -352,9 +352,6 @@
       } else {
         synchronized (rjob) {
           rjob.tasks.remove(tip);
-          if (rjob.tasks.isEmpty()) {
-            runningJobs.remove(jobId);
-          }
         }
       }
     }
@@ -1725,6 +1722,7 @@
       //
       if (needCleanup) {
         try {
+          removeTaskFromJob(task.getJobID(), this);
           cleanup();
         } catch (IOException ie) {
         }
@@ -2206,6 +2204,24 @@
     return result;
   }
 
+
+  /**
+   * Get the list of tasks from running jobs on this task tracker.
+   * @return a copy of the list of TaskStatus objects
+   */
+  synchronized List<TaskStatus> getTasksFromRunningJobs() {
+    List<TaskStatus> result = new ArrayList<TaskStatus>(tasks.size());
+    for (Map.Entry <JobID, RunningJob> item : runningJobs.entrySet()) {
+      RunningJob rjob = item.getValue();
+      synchronized (rjob) {
+        for (TaskInProgress tip : rjob.tasks) {
+          result.add(tip.getStatus());
+        }
+      }
+    }
+    return result;
+  }
+  
   /**
    * Get the default job conf for this tracker.
    */

Modified: hadoop/core/trunk/src/webapps/task/tasktracker.jsp
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/webapps/task/tasktracker.jsp?rev=658035&r1=658034&r2=658035&view=diff
==============================================================================
--- hadoop/core/trunk/src/webapps/task/tasktracker.jsp (original)
+++ hadoop/core/trunk/src/webapps/task/tasktracker.jsp Mon May 19 16:09:41 2008
@@ -57,6 +57,29 @@
   %>
 </table>
 
+
+<h2>Tasks from Running Jobs</h2>
+<center>
+<table border=2 cellpadding="5" cellspacing="2">
+<tr><td align="center">Task Attempts</td><td>Status</td>
+    <td>Progress</td><td>Errors</td></tr>
+
+  <%
+     itr = tracker.getTasksFromRunningJobs().iterator();
+     while (itr.hasNext()) {
+       TaskStatus status = (TaskStatus) itr.next();
+       out.print("<tr><td>" + status.getTaskID());
+       out.print("</td><td>" + status.getRunState()); 
+       out.print("</td><td>" + 
+                 StringUtils.formatPercent(status.getProgress(), 2));
+       out.print("</td><td><pre>" + status.getDiagnosticInfo() + "</pre></td>");
+       out.print("</tr>\n");
+     }
+  %>
+</table>
+</center>
+
+
 <h2>Local Logs</h2>
 <a href="/logs/">Log</a> directory
 



Mime
View raw message