hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r527711 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/mapred/TaskTracker.java
Date Wed, 11 Apr 2007 22:28:51 GMT
Author: cutting
Date: Wed Apr 11 15:28:49 2007
New Revision: 527711

URL: http://svn.apache.org/viewvc?view=rev&rev=527711
Log:
HADOOP-1238.  Fix metrics reporting by TaskTracker to correctly track maps_running and reduces_running.
 Contributed by Michael Bieniosek.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=527711&r1=527710&r2=527711
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Wed Apr 11 15:28:49 2007
@@ -176,6 +176,10 @@
 53. HADOOP-1213.  Improve logging of errors by IPC server, to
     consistently include the service name and the call.  (cutting)
 
+54. HADOOP-1238.  Fix metrics reporting by TaskTracker to correctly
+    track maps_running and reduces_running.
+    (Michael Bieniosek via cutting)
+
 
 Release 0.12.3 - 2007-04-06
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java?view=diff&rev=527711&r1=527710&r2=527711
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/TaskTracker.java Wed Apr 11 15:28:49
2007
@@ -155,11 +155,16 @@
       synchronized void completeTask() {
         if (metricsRecord != null) {
           metricsRecord.incrMetric("tasks_completed", 1);
-          metricsRecord.setMetric("maps_running", mapTotal);
-          metricsRecord.setMetric("reduces_running", reduceTotal);
-          metricsRecord.update();
         }
       }
+      
+      synchronized void update() {
+          if (metricsRecord != null) {
+            metricsRecord.setMetric("maps_running", mapTotal);
+            metricsRecord.setMetric("reduces_running", reduceTotal);
+            metricsRecord.update();
+          }
+      }
     }
     
     private TaskTrackerMetrics myMetrics = null;
@@ -638,6 +643,7 @@
             }
             try {
               myMetrics.completeTask();
+              myMetrics.update();
             } catch (MetricsException me) {
               LOG.warn("Caught: " + StringUtils.stringifyException(me));
             }
@@ -866,6 +872,7 @@
         } else {
           reduceTotal++;
         }
+        myMetrics.update();
       }
       try {
     	  localizeJob(tip);
@@ -1245,6 +1252,7 @@
                                    failure);
               runningTasks.put(task.getTaskId(), this);
               mapTotal++;
+              myMetrics.update();
             } else {
               LOG.warn("Output already reported lost:"+task.getTaskId());
             }



Mime
View raw message