hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r448339 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/JobTracker.java src/java/org/apache/hadoop/mapred/TaskInProgress.java src/webapps/job/jobfailures.jsp src/webapps/job/taskdetails.jsp
Date Wed, 20 Sep 2006 21:06:27 GMT
Author: cutting
Date: Wed Sep 20 14:06:27 2006
New Revision: 448339

URL: http://svn.apache.org/viewvc?view=rev&rev=448339
Log:
HADOOP-293.  Report the full list of task error messages in the web ui, not just the most
recent.  Contributed by Owen.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java
    lucene/hadoop/trunk/src/webapps/job/jobfailures.jsp
    lucene/hadoop/trunk/src/webapps/job/taskdetails.jsp

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=448339&r1=448338&r2=448339
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Wed Sep 20 14:06:27 2006
@@ -36,6 +36,9 @@
 10. HADOOP-261.  Record an error message when map output is lost.
     (omalley via cutting)
 
+11. HADOOP-293.  Report the full list of task error messages in the
+    web ui, not just the most recent.  (omalley via cutting)
+
 
 Release 0.6.2 (unreleased)
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java?view=diff&rev=448339&r1=448338&r2=448339
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobTracker.java Wed Sep 20 14:06:27
2006
@@ -403,7 +403,7 @@
     Vector jobsByArrival = new Vector();
 
     // All the known TaskInProgress items, mapped to by taskids (taskid->TIP)
-    TreeMap taskidToTIPMap = new TreeMap();
+    Map<String, TaskInProgress> taskidToTIPMap = new TreeMap();
 
     // (taskid --> trackerID) 
     TreeMap taskidToTrackerMap = new TreeMap();
@@ -1081,6 +1081,27 @@
         }
     }
 
+    /**
+     * Get the diagnostics for a given task
+     * @param jobId the id of the job
+     * @param tipId the id of the tip 
+     * @param taskId the id of the task
+     * @return a list of the diagnostic messages
+     */
+    public synchronized List<String> getTaskDiagnostics(String jobId,
+                                                        String tipId,
+                                                        String taskId) {
+      JobInProgress job = (JobInProgress) jobs.get(jobId);
+      if (job == null) {
+        throw new IllegalArgumentException("Job " + jobId + " not found.");
+      }
+      TaskInProgress tip = job.getTaskInProgress(tipId);
+      if (tip == null) {
+        throw new IllegalArgumentException("TIP " + tipId + " not found.");
+      }
+      return tip.getDiagnosticInfo(taskId);
+    }
+    
     /** Get all the TaskStatuses from the tipid. */
     TaskStatus[] getTaskStatuses(String jobid, String tipid){
 	JobInProgress job = (JobInProgress) jobs.get(jobid);

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java?view=diff&rev=448339&r1=448338&r2=448339
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskInProgress.java Wed Sep 20 14:06:27
2006
@@ -71,7 +71,7 @@
     private TreeSet recentTasks = new TreeSet();
     private JobConf conf;
     private boolean runSpeculative;
-    private TreeMap taskDiagnosticData = new TreeMap();
+    private Map<String,List<String>> taskDiagnosticData = new TreeMap();
     /**
      * Map from taskId -> TaskStatus
      */
@@ -242,6 +242,15 @@
          (String[])diagnostics.toArray(new String[diagnostics.size()]));
     }
 
+    /**
+     * Get the diagnostic messages for a given task within this tip.
+     * @param taskId the id of the required task
+     * @return the list of diagnostics for that task
+     */
+    synchronized List<String> getDiagnosticInfo(String taskId) {
+      return taskDiagnosticData.get(taskId);
+    }
+    
     ////////////////////////////////////////////////
     // Update methods, usually invoked by the owning
     // job.

Modified: lucene/hadoop/trunk/src/webapps/job/jobfailures.jsp
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/webapps/job/jobfailures.jsp?view=diff&rev=448339&r1=448338&r2=448339
==============================================================================
--- lucene/hadoop/trunk/src/webapps/job/jobfailures.jsp (original)
+++ lucene/hadoop/trunk/src/webapps/job/jobfailures.jsp Wed Sep 20 14:06:27 2006
@@ -33,8 +33,22 @@
                     taskTracker.getHttpPort() + "\">" +  taskTracker.getHost() + 
                     "</a></td>");
         }
-        out.print("<td>" + statuses[i].getDiagnosticInfo() + "</td></tr>\n");
-      }
+        out.print("<td><pre>");
+        List<String> failures = 
+                     tracker.getTaskDiagnostics(jobId, tipId, 
+                                                statuses[i].getTaskId());
+        if (failures == null) {
+          out.print("&nbsp;");
+        } else {
+          for(Iterator<String> itr = failures.iterator(); itr.hasNext(); ) {
+            out.print(itr.next());
+            if (itr.hasNext()) {
+              out.print("\n-------\n");
+            }
+           }
+         }
+         out.print("</pre></td></tr>\n");
+       }
     }
   }
              

Modified: lucene/hadoop/trunk/src/webapps/job/taskdetails.jsp
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/webapps/job/taskdetails.jsp?view=diff&rev=448339&r1=448338&r2=448339
==============================================================================
--- lucene/hadoop/trunk/src/webapps/job/taskdetails.jsp (original)
+++ lucene/hadoop/trunk/src/webapps/job/taskdetails.jsp Wed Sep 20 14:06:27 2006
@@ -12,8 +12,8 @@
   String jobid = request.getParameter("jobid");
   JobTracker tracker = JobTracker.getTracker();
   JobInProgress job = (JobInProgress) tracker.getJob(jobid);
-  String taskid = request.getParameter("taskid");
-  TaskStatus[] ts = (job != null) ? tracker.getTaskStatuses(jobid, taskid): null;
+  String tipid = request.getParameter("taskid");
+  TaskStatus[] ts = (job != null) ? tracker.getTaskStatuses(jobid, tipid): null;
 %>
 
 <%! 
@@ -68,7 +68,20 @@
       out.print("</td>");
       out.print("<td>"+ StringUtils.formatPercent(status.getProgress()) + 
                 "</td>");
-      out.print("<td><pre>" + status.getDiagnosticInfo() + "</pre></td>");
+      out.print("<td><pre>");
+      List<String> failures = tracker.getTaskDiagnostics(jobid, tipid,
+                                                         status.getTaskId());
+      if (failures == null) {
+        out.print("&nbsp;");
+      } else {
+        for(Iterator<String> itr = failures.iterator(); itr.hasNext(); ) {
+          out.print(itr.next());
+          if (itr.hasNext()) {
+            out.print("\n-------\n");
+          }
+        }
+      }
+      out.print("</pre></td>");
       out.print("</tr>\n");
     }
   %>



Mime
View raw message