hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077390 - in /hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred: JobTracker.java JobTrackerInstrumentation.java JobTrackerMetricsInst.java
Date Fri, 04 Mar 2011 04:10:12 GMT
Author: omalley
Date: Fri Mar  4 04:10:12 2011
New Revision: 1077390

URL: http://svn.apache.org/viewvc?rev=1077390&view=rev
Log:
commit 0a3c904ef6ac5391e0d8c711b142ab1dc22e4e01
Author: Arun C Murthy <acmurthy@apache.org>
Date:   Tue Apr 13 10:39:44 2010 -0700

    MAPREDUCE-1680. Add a metric to track number of heartbeats processed by the JobTracker.
Contributed by Richard King.
    
    From https://issues.apache.org/jira/secure/attachment/12441621/mapreduce-1680--2010-04-08.patch.
    
    +++ b/YAHOO-CHANGES.txt
    +    MAPREDUCE-1680. Add a metric to track number of heartbeats processed by the
    +    JobTracker. (Richard King via acmurthy)
    +

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTracker.java
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerInstrumentation.java
    hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerMetricsInst.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTracker.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTracker.java?rev=1077390&r1=1077389&r2=1077390&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTracker.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTracker.java
Fri Mar  4 04:10:12 2011
@@ -3376,6 +3376,9 @@ public class JobTracker implements MRCon
   private synchronized boolean processHeartbeat(
                                  TaskTrackerStatus trackerStatus, 
                                  boolean initialContact) {
+    
+    getInstrumentation().heartbeat();
+
     String trackerName = trackerStatus.getTrackerName();
 
     synchronized (taskTrackers) {

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerInstrumentation.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerInstrumentation.java?rev=1077390&r1=1077389&r2=1077390&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerInstrumentation.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerInstrumentation.java
Fri Mar  4 04:10:12 2011
@@ -158,6 +158,8 @@ class JobTrackerInstrumentation {
   { }
 
   public void setDecommissionedTrackers(int trackers)
-  { }  
+  { }   
 
+  public void heartbeat() {
+  }
 }

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerMetricsInst.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerMetricsInst.java?rev=1077390&r1=1077389&r2=1077390&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerMetricsInst.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/JobTrackerMetricsInst.java
Fri Mar  4 04:10:12 2011
@@ -63,6 +63,10 @@ class JobTrackerMetricsInst extends JobT
   private int numTrackers = 0;
   private int numTrackersBlackListed = 0;
   private int numTrackersDecommissioned = 0;
+
+  // long, because 2^31 could well be only about a month's worth of
+  // heartbeats, with reasonable assumptions and JobTracker improvements.
+  private long numHeartbeats = 0L;
   
   public JobTrackerMetricsInst(JobTracker tracker, JobConf conf) {
     super(tracker, conf);
@@ -120,6 +124,8 @@ class JobTrackerMetricsInst extends JobT
       metricsRecord.setMetric("trackers_decommissioned", 
           numTrackersDecommissioned);
 
+      metricsRecord.incrMetric("heartbeats", numHeartbeats);
+
       numMapTasksLaunched = 0;
       numMapTasksCompleted = 0;
       numMapTasksFailed = 0;
@@ -152,6 +158,8 @@ class JobTrackerMetricsInst extends JobT
 
       numTrackers = 0;
       numTrackersBlackListed = 0;
+
+      numHeartbeats = 0L;
     }
     metricsRecord.update();
   }
@@ -399,4 +407,9 @@ class JobTrackerMetricsInst extends JobT
   {
     numTrackersDecommissioned = trackers;
   }  
+
+  @Override
+  public synchronized void heartbeat() {
+    ++numHeartbeats;
+  }
 }



Mime
View raw message