Browse Source

HADOOP-881. Fix JobTracker web interface to display the correct number of task failures. Contributed by Sanjay.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@502019 13f79535-47bb-0310-9956-ffa450edef68
Doug Cutting 18 năm trước cách đây
mục cha
commit
d9c1e486c5
2 tập tin đã thay đổi với 16 bổ sung6 xóa
  1. 3 0
      CHANGES.txt
  2. 13 6
      src/webapps/job/jobdetailshistory.jsp

+ 3 - 0
CHANGES.txt

@@ -111,6 +111,9 @@ Trunk (unreleased changes)
 34. HADOOP-934.  Fix TaskTracker to catch metrics exceptions that were
     causing heartbeats to fail.  (Arun Murthy via cutting)
 
+35. HADOOP-881.  Fix JobTracker web interface to display the correct
+    number of task failures.  (Sanjay Dahiya via cutting)
+
 
 Release 0.10.1 - 2007-01-10
 

+ 13 - 6
src/webapps/job/jobdetailshistory.jsp

@@ -50,26 +50,33 @@
 	  long finishTime = task.getLong(Keys.FINISH_TIME) ; 
 	  
 	  if( Values.MAP.name().equals(task.get(Keys.TASK_TYPE)) ){
-	    totalMaps++; 
 	    if( mapStarted==0 || mapStarted > startTime ){
 	      mapStarted = startTime; 
 	    }
 	    if(  mapFinished < finishTime ){
 	      mapFinished = finishTime ; 
 	    }
-	    if(Values.FAILED.name().equals(task.get(Keys.TASK_STATUS) ))  {
-	      failedMaps++; 
+	    
+	    Map<String, TaskAttempt> attempts = task.getTaskAttempts();
+	    for( TaskAttempt attempt : attempts.values() ) {
+	        totalMaps++; 
+	        if( Values.FAILED.name().equals(attempt.get(Keys.TASK_STATUS)) ) {
+	            failedMaps++; 
+	        }
 	    }
 	  }else{
-	    totalReduces++; 
 	    if( reduceStarted==0||reduceStarted > startTime ){
 	      reduceStarted = startTime ; 
 	    }
 	    if(  reduceFinished < finishTime ){
 	      reduceFinished = finishTime; 
 	    }
-	    if( Values.FAILED.name().equals(task.get(Keys.TASK_STATUS) ))  {
-	      failedReduces++; 
+	    Map<String, TaskAttempt> attempts = task.getTaskAttempts();
+	    for( TaskAttempt attempt : attempts.values() ) {
+	        totalReduces++; 
+	        if( Values.FAILED.name().equals(attempt.get(Keys.TASK_STATUS)) ) {
+	            failedReduces++; 
+	        }
 	    }
 	  }
 	}