hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r679591 - in /hadoop/core/branches/branch-0.17: CHANGES.txt src/java/org/apache/hadoop/mapred/TaskTracker.java src/webapps/task/tasktracker.jsp
Date Thu, 24 Jul 2008 22:34:24 GMT
Author: acmurthy
Date: Thu Jul 24 15:34:24 2008
New Revision: 679591

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

Modified:
    hadoop/core/branches/branch-0.17/CHANGES.txt
    hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/mapred/TaskTracker.java
    hadoop/core/branches/branch-0.17/src/webapps/task/tasktracker.jsp

Modified: hadoop/core/branches/branch-0.17/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.17/CHANGES.txt?rev=679591&r1=679590&r2=679591&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.17/CHANGES.txt (original)
+++ hadoop/core/branches/branch-0.17/CHANGES.txt Thu Jul 24 15:34:24 2008
@@ -28,6 +28,9 @@
     HADOOP-3633. Correct exception handling in DataXceiveServer, and throttle
     the number of xceiver threads in a data-node. (shv)
 
+    HADOOP-3370. Ensure that the TaskTracker.runningJobs data-structure is
+    correctly cleaned-up on task completion. (Zheng Shao via acmurthy) 
+
 Release 0.17.1 - 2008-06-23
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/mapred/TaskTracker.java?rev=679591&r1=679590&r2=679591&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/mapred/TaskTracker.java (original)
+++ hadoop/core/branches/branch-0.17/src/java/org/apache/hadoop/mapred/TaskTracker.java Thu
Jul 24 15:34:24 2008
@@ -353,9 +353,6 @@
       } else {
         synchronized (rjob) {
           rjob.tasks.remove(tip);
-          if (rjob.tasks.isEmpty()) {
-            runningJobs.remove(jobId);
-          }
         }
       }
     }
@@ -1714,6 +1711,7 @@
       //
       if (needCleanup) {
         try {
+          removeTaskFromJob(task.getJobId(), this);
           cleanup();
         } catch (IOException ie) {
         }
@@ -2194,6 +2192,23 @@
   }
 
   /**
+   * 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 <String, 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.
    */
   JobConf getJobConf() {

Modified: hadoop/core/branches/branch-0.17/src/webapps/task/tasktracker.jsp
URL: http://svn.apache.org/viewvc/hadoop/core/branches/branch-0.17/src/webapps/task/tasktracker.jsp?rev=679591&r1=679590&r2=679591&view=diff
==============================================================================
--- hadoop/core/branches/branch-0.17/src/webapps/task/tasktracker.jsp (original)
+++ hadoop/core/branches/branch-0.17/src/webapps/task/tasktracker.jsp Thu Jul 24 15:34:24
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