hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acmur...@apache.org
Subject svn commit: r588168 - in /lucene/hadoop/trunk: CHANGES.txt src/webapps/job/jobdetails.jsp src/webapps/job/jobtasks.jsp
Date Thu, 25 Oct 2007 08:57:25 GMT
Author: acmurthy
Date: Thu Oct 25 01:57:25 2007
New Revision: 588168

URL: http://svn.apache.org/viewvc?rev=588168&view=rev
Log:
HADOOP-1839.  Link-ify the Pending/Running/Complete/Killed grid in jobdetails.jsp to help
quickly narrow down and see categorized TIPs' details via jobtasks.jsp. (Amar Kamat via acmurthy)

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/webapps/job/jobdetails.jsp
    lucene/hadoop/trunk/src/webapps/job/jobtasks.jsp

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?rev=588168&r1=588167&r2=588168&view=diff
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Thu Oct 25 01:57:25 2007
@@ -24,6 +24,10 @@
     HADOOP-1604.  An system administrator can finalize namenode upgrades 
     without running the cluster. (Konstantin Shvachko via dhruba)
 
+    HADOOP-1839.  Link-ify the Pending/Running/Complete/Killed grid in
+    jobdetails.jsp to help quickly narrow down and see categorized TIPs' 
+    details via jobtasks.jsp. (Amar Kamat via acmurthy)
+
   OPTIMIZATIONS
 
     HADOOP-1898.  Release the lock protecting the last time of the last stack

Modified: lucene/hadoop/trunk/src/webapps/job/jobdetails.jsp
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/webapps/job/jobdetails.jsp?rev=588168&r1=588167&r2=588168&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/webapps/job/jobdetails.jsp (original)
+++ lucene/hadoop/trunk/src/webapps/job/jobdetails.jsp Thu Oct 25 01:57:25 2007
@@ -44,6 +44,7 @@
       failedTaskAttempts += task.numTaskFailures();
       killedTaskAttempts += task.numKilledTasks();
     }
+    int pendingTasks = totalTasks - runningTasks - killedTasks - finishedTasks; 
     out.print("<tr><th><a href=\"jobtasks.jsp?jobid=" + jobId + 
               "&type="+ kind + "&pagenum=1\">" + kind + 
               "</a></th><td align=\"right\">" + 
@@ -52,13 +53,25 @@
               "</td><td align=\"right\">" + 
               totalTasks + 
               "</td><td align=\"right\">" + 
-              (totalTasks - runningTasks - finishedTasks - killedTasks) + 
-              "</td><td align=\"right\">" +
-              runningTasks + 
-              "</td><td align=\"right\">" +
-              finishedTasks + 
-              "</td><td align=\"right\">" +
-              killedTasks +
+              ((pendingTasks > 0) 
+               ? "<a href=\"jobtasks.jsp?jobid=" + jobId + "&type="+ kind + 
+                 "&pagenum=1" + "&state=pending\">" + pendingTasks + "</a>"
+               : "0") + 
+              "</td><td align=\"right\">" + 
+              ((runningTasks > 0) 
+               ? "<a href=\"jobtasks.jsp?jobid=" + jobId + "&type="+ kind + 
+                 "&pagenum=1" + "&state=running\">" + runningTasks + "</a>"

+               : "0") + 
+              "</td><td align=\"right\">" + 
+              ((finishedTasks > 0) 
+               ?"<a href=\"jobtasks.jsp?jobid=" + jobId + "&type="+ kind + 
+                "&pagenum=1" + "&state=completed\">" + finishedTasks + "</a>"

+               : "0") + 
+              "</td><td align=\"right\">" + 
+              ((killedTasks > 0) 
+               ?"<a href=\"jobtasks.jsp?jobid=" + jobId + "&type="+ kind +
+                "&pagenum=1" + "&state=killed\">" + killedTasks + "</a>"
+               : "0") + 
               "</td><td align=\"right\">" + 
               ((failedTaskAttempts > 0) ? 
                   ("<a href=\"jobfailures.jsp?jobid=" + jobId + 

Modified: lucene/hadoop/trunk/src/webapps/job/jobtasks.jsp
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/webapps/job/jobtasks.jsp?rev=588168&r1=588167&r2=588168&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/webapps/job/jobtasks.jsp (original)
+++ lucene/hadoop/trunk/src/webapps/job/jobtasks.jsp Thu Oct 25 01:57:25 2007
@@ -17,6 +17,9 @@
   String jobid = request.getParameter("jobid");
   String type = request.getParameter("type");
   String pagenum = request.getParameter("pagenum");
+  TaskInProgress[] tasks;
+  String state = request.getParameter("state");
+  state = (state!=null) ? state : "all";
   int pnum = Integer.parseInt(pagenum);
   int next_page = pnum+1;
   int numperpage = 2000;
@@ -29,9 +32,11 @@
   int report_len = 0;
   if ("map".equals(type)){
      reports = (job != null) ? tracker.getMapTaskReports(jobid) : null;
+     tasks = (job != null) ? job.getMapTasks() : null;
     }
   else{
     reports = (job != null) ? tracker.getReduceTaskReports(jobid) : null;
+    tasks = (job != null) ? job.getReduceTasks() : null;
   }
 %>
 
@@ -50,13 +55,34 @@
     out.print("<b>Job " + jobid + " not found.</b><br>\n");
     return;
   }
+  // Filtering the reports if some filter is specified
+  if (!"all".equals(state)) {
+    List<TaskReport> filteredReports = new ArrayList<TaskReport>();
+    for (int i = 0; i < reports.length; ++i) {
+      if ("completed".equals(state) && tasks[i].isComplete()) {
+        filteredReports.add(reports[i]);
+      } else if ("running".equals(state) && tasks[i].isRunning()) {
+        filteredReports.add(reports[i]);
+      } else if ("killed".equals(state) && tasks[i].wasKilled()) {
+        filteredReports.add(reports[i]);
+      } else if ("pending".equals(state) 
+                 && !(tasks[i].isComplete() || tasks[i].isRunning() 
+                      || tasks[i].wasKilled())) {
+        filteredReports.add(reports[i]);
+      }
+    }
+    tasks = null; // free the task memory
+    // using filtered reports instead of all the reports
+    reports = filteredReports.toArray(new TaskReport[0]);
+  }
   report_len = reports.length;
   
   if (report_len <= start_index) {
     out.print("<b>No such tasks</b>");
   } else {
     out.print("<hr>");
-    out.print("<h2>Tasks</h2>");
+    out.print("<h2>" + Character.toUpperCase(state.charAt(0)) 
+              + state.substring(1).toLowerCase() + " Tasks</h2>");
     out.print("<center>");
     out.print("<table border=2 cellpadding=\"5\" cellspacing=\"2\">");
     out.print("<tr><td align=\"center\">Task</td><td>Complete</td><td>Status</td>"
+
@@ -93,13 +119,13 @@
   if (end_index < report_len) {
     out.print("<div style=\"text-align:right\">" + 
               "<a href=\"jobtasks.jsp?jobid="+ jobid + "&type=" + type +
-              "&pagenum=" + next_page +
+              "&pagenum=" + next_page + "&state=" + state +
               "\">" + "Next" + "</a></div>");
   }
   if (start_index != 0) {
       out.print("<div style=\"text-align:right\">" + 
                 "<a href=\"jobtasks.jsp?jobid="+ jobid + "&type=" + type +
-                "&pagenum=" + (pnum -1) + "\">" + "Prev" + "</a></div>");
+                "&pagenum=" + (pnum -1) + "&state=" + state + "\">" + "Prev" +
"</a></div>");
   }
 %>
 



Mime
View raw message