hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077391 - /hadoop/common/branches/branch-0.20-security-patches/src/webapps/job/analysejobhistory.jsp
Date Fri, 04 Mar 2011 04:10:19 GMT
Author: omalley
Date: Fri Mar  4 04:10:19 2011
New Revision: 1077391

URL: http://svn.apache.org/viewvc?rev=1077391&view=rev
Log:
commit 347199bda6a63ddad815e59c6f34fcb738ef4790
Author: Vinod Kumar <vinodkv@yahoo-inc.com>
Date:   Wed Apr 14 13:20:06 2010 +0530

    . Fix for java.lang.ArrayIndexOutOfBoundsException in analysejobhistory.jsp of jobs with
0 maps

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/webapps/job/analysejobhistory.jsp

Modified: hadoop/common/branches/branch-0.20-security-patches/src/webapps/job/analysejobhistory.jsp
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/webapps/job/analysejobhistory.jsp?rev=1077391&r1=1077390&r2=1077391&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/webapps/job/analysejobhistory.jsp
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/webapps/job/analysejobhistory.jsp
Fri Mar  4 04:10:19 2011
@@ -105,9 +105,19 @@
                 t2.getLong(Keys.START_TIME); 
       return (l2<l1 ? -1 : (l2==l1 ? 0 : 1));
     }
-  }; 
-  Arrays.sort(mapTasks, cMap);
-  JobHistory.Task minMap = mapTasks[mapTasks.length-1] ;
+  };
+  Comparator<JobHistory.Task> cFinishMapRed = 
+    new Comparator<JobHistory.Task>() {
+    public int compare(JobHistory.Task t1, JobHistory.Task t2){
+      long l1 = t1.getLong(Keys.FINISH_TIME); 
+      long l2 = t2.getLong(Keys.FINISH_TIME);
+      return (l2<l1 ? -1 : (l2==l1 ? 0 : 1));
+    }
+  };
+
+  if (mapTasks.length > 0) {
+    Arrays.sort(mapTasks, cMap);
+    JobHistory.Task minMap = mapTasks[mapTasks.length-1] ;
 %>
 
 <h3>Time taken by best performing Map task 
@@ -131,16 +141,9 @@
 %>
 </table>
 <%  
-  Comparator<JobHistory.Task> cFinishMapRed = 
-    new Comparator<JobHistory.Task>() {
-    public int compare(JobHistory.Task t1, JobHistory.Task t2){
-      long l1 = t1.getLong(Keys.FINISH_TIME); 
-      long l2 = t2.getLong(Keys.FINISH_TIME);
-      return (l2<l1 ? -1 : (l2==l1 ? 0 : 1));
-    }
-  };
-  Arrays.sort(mapTasks, cFinishMapRed);
-  JobHistory.Task lastMap = mapTasks[0] ;
+
+    Arrays.sort(mapTasks, cFinishMapRed);
+    JobHistory.Task lastMap = mapTasks[0] ;
 %>
 
 <h3>The last Map task 
@@ -153,6 +156,8 @@ finished at (relative to the Job launch 
 <hr/>
 
 <%
+  }//end if(mapTasks.length > 0)
+
   if (reduceTasks.length <= 0) return;
   Arrays.sort(reduceTasks, cShuffle); 
   JobHistory.Task minShuffle = reduceTasks[reduceTasks.length-1] ;



Mime
View raw message