hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r697221 - in /hadoop/core/trunk: ./ src/mapred/org/apache/hadoop/mapred/ src/webapps/job/
Date Fri, 19 Sep 2008 20:20:06 GMT
Author: acmurthy
Date: Fri Sep 19 13:20:05 2008
New Revision: 697221

URL: http://svn.apache.org/viewvc?rev=697221&view=rev
Log:
HADOOP-2165. Augmented JobHistory to include the URIs to the tasks' userlogs. Contributed
by Vinod Kumar Vavilapalli.

Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/HistoryViewer.java
    hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java
    hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskLogServlet.java
    hadoop/core/trunk/src/webapps/job/jobfailures.jsp
    hadoop/core/trunk/src/webapps/job/taskdetails.jsp
    hadoop/core/trunk/src/webapps/job/taskdetailshistory.jsp

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=697221&r1=697220&r2=697221&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Fri Sep 19 13:20:05 2008
@@ -386,6 +386,9 @@
     priorities, also allow it to be manipulated via the web-ui. (Hemanth
     Yamijala via acmurthy) 
 
+    HADOOP-2165. Augmented JobHistory to include the URIs to the tasks'
+    userlogs. (Vinod Kumar Vavilapalli via acmurthy) 
+
   OPTIMIZATIONS
 
     HADOOP-3556. Removed lock contention in MD5Hash by changing the 

Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/HistoryViewer.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/HistoryViewer.java?rev=697221&r1=697220&r2=697221&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/HistoryViewer.java (original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/HistoryViewer.java Fri Sep 19 13:20:05
2008
@@ -180,7 +180,7 @@
     if (Values.REDUCE.name().equals(taskType)) {
       taskList.append("\tShuffleFinished\tSortFinished");
     }
-    taskList.append("\tFinishTime\tHostName\tError");
+    taskList.append("\tFinishTime\tHostName\tError\tTaskLogs");
     taskList.append("\n====================================================");
     System.out.println(taskList.toString());
     for (JobHistory.Task task : tasks.values()) {
@@ -206,6 +206,8 @@
           taskList.append("\t"); 
           taskList.append(attempt.get(Keys.HOSTNAME)).append("\t");
           taskList.append(attempt.get(Keys.ERROR));
+          String taskLogsUrl = JobHistory.getTaskLogsUrl(attempt);
+          taskList.append(taskLogsUrl != null ? taskLogsUrl : "n/a");
           System.out.println(taskList.toString());
         }
       }

Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java?rev=697221&r1=697220&r2=697221&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java (original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/JobHistory.java Fri Sep 19 13:20:05
2008
@@ -1526,4 +1526,25 @@
       isRunning = false; 
     }
   }
+
+  /**
+   * Return the TaskLogsUrl of a particular TaskAttempt
+   * 
+   * @param attempt
+   * @return the taskLogsUrl. null if http-port or tracker-name or
+   *         task-attempt-id are unavailable.
+   */
+  public static String getTaskLogsUrl(JobHistory.TaskAttempt attempt) {
+    if (attempt.get(Keys.HTTP_PORT).equals("")
+        || attempt.get(Keys.TRACKER_NAME).equals("")
+        || attempt.get(Keys.TASK_ATTEMPT_ID).equals("")) {
+      return null;
+    }
+
+    String taskTrackerName =
+        JobInProgress.convertTrackerNameToHostName(
+            attempt.get(Keys.TRACKER_NAME)).substring("tracker_".length());
+    return TaskLogServlet.getTaskLogUrl(taskTrackerName, attempt
+        .get(Keys.HTTP_PORT), attempt.get(Keys.TASK_ATTEMPT_ID));
+  }
 }

Modified: hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskLogServlet.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskLogServlet.java?rev=697221&r1=697220&r2=697221&view=diff
==============================================================================
--- hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskLogServlet.java (original)
+++ hadoop/core/trunk/src/mapred/org/apache/hadoop/mapred/TaskLogServlet.java Fri Sep 19 13:20:05
2008
@@ -41,6 +41,19 @@
   }
 
   /**
+   * Construct the taskLogUrl
+   * @param taskTrackerHostName
+   * @param httpPort
+   * @param taskAttemptID
+   * @return the taskLogUrl
+   */
+  public static String getTaskLogUrl(String taskTrackerHostName,
+      String httpPort, String taskAttemptID) {
+    return ("http://" + taskTrackerHostName + ":" + httpPort
+        + "/tasklog?taskid=" + taskAttemptID);
+  }
+
+  /**
    * Find the next quotable character in the given array.
    * @param data the bytes to look in
    * @param offset the first index to look in

Modified: hadoop/core/trunk/src/webapps/job/jobfailures.jsp
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/webapps/job/jobfailures.jsp?rev=697221&r1=697220&r2=697221&view=diff
==============================================================================
--- hadoop/core/trunk/src/webapps/job/jobfailures.jsp (original)
+++ hadoop/core/trunk/src/webapps/job/jobfailures.jsp Fri Sep 19 13:20:05 2008
@@ -55,10 +55,13 @@
         out.print("</pre></td>");
         
         out.print("<td>");
+        String taskLogUrl = null;
         if (taskTracker != null) {
-          String taskLogUrl = "http://" + taskTracker.getHost() + ":" +
-          	taskTracker.getHttpPort() + "/tasklog?taskid=" + 
-          	statuses[i].getTaskID();
+          taskLogUrl = TaskLogServlet.getTaskLogUrl(taskTracker.getHost(),
+                                String.valueOf(taskTracker.getHttpPort()),
+                                statuses[i].getTaskID().toString());
+        }
+        if (taskLogUrl != null) {
           String tailFourKBUrl = taskLogUrl + "&start=-4097";
           String tailEightKBUrl = taskLogUrl + "&start=-8193";
           String entireLogUrl = taskLogUrl;

Modified: hadoop/core/trunk/src/webapps/job/taskdetails.jsp
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/webapps/job/taskdetails.jsp?rev=697221&r1=697220&r2=697221&view=diff
==============================================================================
--- hadoop/core/trunk/src/webapps/job/taskdetails.jsp (original)
+++ hadoop/core/trunk/src/webapps/job/taskdetails.jsp Fri Sep 19 13:20:05 2008
@@ -153,11 +153,15 @@
         }
         out.print("</pre></td>");
         out.print("<td>");
-        if (taskAttemptTracker == null) {
+        String taskLogUrl = null;
+        if (taskTracker != null ) {
+        	taskLogUrl = TaskLogServlet.getTaskLogUrl(taskTracker.getHost(),
+        						String.valueOf(taskTracker.getHttpPort()),
+        						status.getTaskID().toString());
+      	}
+        if (taskLogUrl == null) {
           out.print("n/a");
         } else {
-          String taskLogUrl = taskAttemptTracker + "/tasklog?taskid="
-            + status.getTaskID();
           String tailFourKBUrl = taskLogUrl + "&start=-4097";
           String tailEightKBUrl = taskLogUrl + "&start=-8193";
           String entireLogUrl = taskLogUrl + "&all=true";

Modified: hadoop/core/trunk/src/webapps/job/taskdetailshistory.jsp
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/webapps/job/taskdetailshistory.jsp?rev=697221&r1=697220&r2=697221&view=diff
==============================================================================
--- hadoop/core/trunk/src/webapps/job/taskdetailshistory.jsp (original)
+++ hadoop/core/trunk/src/webapps/job/taskdetailshistory.jsp Fri Sep 19 13:20:05 2008
@@ -37,7 +37,7 @@
 <%
   }
 %>
-<td>Finish Time</td><td>Host</td><td>Error</td></tr>
+<td>Finish Time</td><td>Host</td><td>Error</td><td>Task
Logs</td></tr>
 <%
   for (JobHistory.TaskAttempt attempt : task.getTaskAttempts().values()) {
     printTaskAttempt(attempt, type, out);
@@ -84,6 +84,21 @@
               taskAttempt.getLong(Keys.START_TIME) ) + "</td>"); 
     out.print("<td>" + taskAttempt.get(Keys.HOSTNAME) + "</td>");
     out.print("<td>" + taskAttempt.get(Keys.ERROR) + "</td>");
+
+    // Print task log urls
+    out.print("<td>");	
+    String taskLogsUrl = JobHistory.getTaskLogsUrl(taskAttempt);
+    if (taskLogsUrl != null) {
+	    String tailFourKBUrl = taskLogsUrl + "&start=-4097";
+	    String tailEightKBUrl = taskLogsUrl + "&start=-8193";
+	    String entireLogUrl = taskLogsUrl + "&all=true";
+	    out.print("<a href=\"" + tailFourKBUrl + "\">Last 4KB</a><br/>");
+	    out.print("<a href=\"" + tailEightKBUrl + "\">Last 8KB</a><br/>");
+	    out.print("<a href=\"" + entireLogUrl + "\">All</a><br/>");
+    } else {
+        out.print("n/a");
+    }
+    out.print("</td>");
     out.print("</tr>"); 
   }
 %>



Mime
View raw message