hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r524910 - in /lucene/hadoop/branches/branch-0.12: CHANGES.txt src/webapps/task/tasklog.jsp
Date Mon, 02 Apr 2007 20:02:47 GMT
Author: cutting
Date: Mon Apr  2 13:02:46 2007
New Revision: 524910

URL: http://svn.apache.org/viewvc?view=rev&rev=524910
Log:
HADOOP-1175.  Merge -r 524900:524901 from trunk to 0.12 branch.

Modified:
    lucene/hadoop/branches/branch-0.12/CHANGES.txt
    lucene/hadoop/branches/branch-0.12/src/webapps/task/tasklog.jsp

Modified: lucene/hadoop/branches/branch-0.12/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/branches/branch-0.12/CHANGES.txt?view=diff&rev=524910&r1=524909&r2=524910
==============================================================================
--- lucene/hadoop/branches/branch-0.12/CHANGES.txt (original)
+++ lucene/hadoop/branches/branch-0.12/CHANGES.txt Mon Apr  2 13:02:46 2007
@@ -13,6 +13,9 @@
 17. HADOOP-1177.  Fix bug where IOException in MapOutputLocation.getFile
     was not being logged.  (Devaraj Das via tomwhite)
 
+ 4. HADOOP-1175.  Fix bugs in JSP for displaying a task's log messages.
+    (Arun C Murthy via cutting)
+
 
 Release 0.12.2 - 2007-23-17
 

Modified: lucene/hadoop/branches/branch-0.12/src/webapps/task/tasklog.jsp
URL: http://svn.apache.org/viewvc/lucene/hadoop/branches/branch-0.12/src/webapps/task/tasklog.jsp?view=diff&rev=524910&r1=524909&r2=524910
==============================================================================
--- lucene/hadoop/branches/branch-0.12/src/webapps/task/tasklog.jsp (original)
+++ lucene/hadoop/branches/branch-0.12/src/webapps/task/tasklog.jsp Mon Apr  2 13:02:46 2007
@@ -5,16 +5,10 @@
   import="java.io.*"
 %>
 <%!
-  String taskId = null;
-  long logOffset = -1, logLength = -1;
-  boolean tailLog = false;
-  long tailSize = 1024;
-  int tailWindow = 1;
-  boolean entireLog = false;
-  boolean plainText = false;
-  TaskLog.LogFilter filter = null;
-
-  private void printTaskLog(JspWriter out, TaskLog.LogFilter filter) 
+  private void printTaskLog(JspWriter out, String taskId, 
+      long logOffset, long logLength, 
+      boolean tailLog, long tailSize, int tailWindow,
+      boolean entireLog, boolean plainText, TaskLog.LogFilter filter) 
   throws IOException {
     if (!plainText) {
       out.println("<br><b><u>" + filter + " logs</u></b><br>");
@@ -99,6 +93,15 @@
 %>
 
 <%  
+  String taskId = null;
+  long logOffset = -1, logLength = -1;
+  boolean tailLog = false;
+  long tailSize = 1024;
+  int tailWindow = 1;
+  boolean entireLog = false;
+  boolean plainText = false;
+  TaskLog.LogFilter filter = null;
+
   taskId = request.getParameter("taskid");
   if (taskId == null) {
   	out.println("<h2>Missing 'taskid' for fetching logs!</h2>");
@@ -106,16 +109,14 @@
   }
   
   String logFilter = request.getParameter("filter");
-  if (logFilter == null) {
-  	logFilter = "stderr";
-  }
-  
-  try {
-    filter = TaskLog.LogFilter.valueOf(TaskLog.LogFilter.class, 
+  if (logFilter != null) {
+    try {
+      filter = TaskLog.LogFilter.valueOf(TaskLog.LogFilter.class, 
                                       logFilter.toUpperCase());
-  } catch (IllegalArgumentException iae) {
-    out.println("<h2>Illegal 'filter': " + logFilter + "</h2>");
-    return;
+    } catch (IllegalArgumentException iae) {
+      out.println("<h2>Illegal 'filter': " + logFilter + "</h2>");
+      return;
+    }
   }
   
   String sLogOff = request.getParameter("off");
@@ -167,15 +168,28 @@
     out.println("<title>Task Logs: '" + taskId + "'</title>"); 
     out.println("<body>");
     out.println("<h1>Task Logs: '" +  taskId +  "'</h1><br>"); 
-    
-    printTaskLog(out, TaskLog.LogFilter.STDOUT);
-    printTaskLog(out, TaskLog.LogFilter.STDERR);
-    printTaskLog(out, TaskLog.LogFilter.SYSLOG);
+
+    if (filter == null) {
+      printTaskLog(out, taskId, logOffset, logLength, 
+          tailLog, tailSize, tailWindow, 
+          entireLog, plainText, TaskLog.LogFilter.STDOUT);
+      printTaskLog(out, taskId, logOffset, logLength, 
+          tailLog, tailSize, tailWindow, 
+          entireLog, plainText, TaskLog.LogFilter.STDERR);
+      printTaskLog(out, taskId, logOffset, logLength, 
+          tailLog, tailSize, tailWindow, 
+          entireLog, plainText, TaskLog.LogFilter.SYSLOG);
+    } else {
+      printTaskLog(out, taskId, logOffset, logLength, 
+          tailLog, tailSize, tailWindow, 
+          entireLog, plainText, filter);
+    }
     
     out.println("<a href='http://lucene.apache.org/hadoop'>Hadoop</a>, 2006.<br>");
     out.println("</body>");
     out.println("</html>");
   } else {
-    printTaskLog(out, filter);
+    printTaskLog(out, taskId, logOffset, logLength, tailLog, tailSize, tailWindow, 
+        entireLog, plainText, filter);
   } 
 %>



Mime
View raw message