hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szets...@apache.org
Subject svn commit: r1075422 - in /hadoop/mapreduce/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/JSPUtil.java
Date Mon, 28 Feb 2011 17:05:45 GMT
Author: szetszwo
Date: Mon Feb 28 17:05:45 2011
New Revision: 1075422

URL: http://svn.apache.org/viewvc?rev=1075422&view=rev
Log:
MAPREDUCE-1159.  Limit Job name in web UI to be 80 char long.  Contributed by Harsh J Chouraria

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JSPUtil.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=1075422&r1=1075421&r2=1075422&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Mon Feb 28 17:05:45 2011
@@ -271,6 +271,9 @@ Release 0.22.0 - Unreleased
     MAPREDUCE-2314. configure files that are generated as part of the released
     tarball need to have executable bit set (rvs via cos)
 
+    MAPREDUCE-1159.  Limit Job name in web UI to be 80 char long.  (Harsh J
+    Chouraria via szetszwo)
+
   OPTIMIZATIONS
 
     MAPREDUCE-1354. Enhancements to JobTracker for better performance and

Modified: hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JSPUtil.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JSPUtil.java?rev=1075422&r1=1075421&r2=1075422&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JSPUtil.java (original)
+++ hadoop/mapreduce/trunk/src/java/org/apache/hadoop/mapred/JSPUtil.java Mon Feb 28 17:05:45
2011
@@ -330,6 +330,7 @@ class JSPUtil {
         int completedMaps = job.finishedMaps();
         int completedReduces = job.finishedReduces();
         String name = HtmlQuoting.quoteHtmlChars(profile.getJobName());
+        String abbreviatedName = getAbbreviatedJobName(name);
         String jobpri = job.getPriority().toString();
         String schedulingInfo =
           HtmlQuoting.quoteHtmlChars(job.getStatus().getSchedulingInfo());
@@ -348,8 +349,8 @@ class JSPUtil {
             + refresh + "\">" + jobid + "</a></td>" + "<td id=\"priority_"
             + rowId + "\">" + jobpri + "</td>" + "<td id=\"user_" + rowId
             + "\">" + HtmlQuoting.quoteHtmlChars(profile.getUser()) +
-              "</td>" + "<td id=\"name_" + rowId
-            + "\">" + ("".equals(name) ? "&nbsp;" : name) + "</td>" + "<td>"
+              "</td>" + "<td title=\"" + name + "\" id=\"name_" + rowId
+            + "\">" + ("".equals(abbreviatedName) ? "&nbsp;" : abbreviatedName) +
"</td>" + "<td>"
             + StringUtils.formatPercent(status.mapProgress(), 2)
             + ServletUtil.percentageGraph(status.mapProgress() * 100, 80)
             + "</td><td>" + desiredMaps + "</td><td>" + completedMaps
@@ -372,6 +373,10 @@ class JSPUtil {
     return sb.toString();
   }
 
+  static String getAbbreviatedJobName(String name) {
+    return (name.length() > 80 ? name.substring(0,76) + "..." : name);
+  }
+
   @SuppressWarnings("unchecked")
   public static String generateRetiredJobTable(JobTracker tracker, int rowId) 
     throws IOException {
@@ -411,7 +416,7 @@ class JSPUtil {
             "<td id=\"priority_" + rowId + "\">" + 
               status.getJobPriority().toString() + "</td>" +
             "<td id=\"user_" + rowId + "\">" + HtmlQuoting.quoteHtmlChars(status.getUsername())
+ "</td>" +
-            "<td id=\"name_" + rowId + "\">" + HtmlQuoting.quoteHtmlChars(status.getJobName())
+ "</td>" +
+            "<td title=\"" + HtmlQuoting.quoteHtmlChars(status.getJobName()) + "\" id=\"name_"
+ rowId + "\">" + HtmlQuoting.quoteHtmlChars(getAbbreviatedJobName(status.getJobName()))
+ "</td>" +
             "<td>" + JobStatus.getJobRunState(status.getRunState()) + "</td>"
+
             "<td>" + new Date(status.getStartTime()) + "</td>" +
             "<td>" + new Date(status.getFinishTime()) + "</td>" +



Mime
View raw message