hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From omal...@apache.org
Subject svn commit: r1077779 - /hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/MapTask.java
Date Fri, 04 Mar 2011 04:54:33 GMT
Author: omalley
Date: Fri Mar  4 04:54:32 2011
New Revision: 1077779

URL: http://svn.apache.org/viewvc?rev=1077779&view=rev
Log:
commit c6e8d39fbe89447416c1cc9943b22d3c99e058df
Author: Siddharth Seth <sseth@yahoo-inc.com>
Date:   Thu Jan 27 17:55:33 2011 -0800

     included a cuople more methods in NewTrackingRecordReader
    for computing the counters.

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

Modified: hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/MapTask.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/MapTask.java?rev=1077779&r1=1077778&r2=1077779&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/MapTask.java
(original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/mapred/org/apache/hadoop/mapred/MapTask.java
Fri Mar  4 04:54:32 2011
@@ -469,7 +469,6 @@ class MapTask extends Task {
         TaskReporter reporter, JobConf job,
         org.apache.hadoop.mapreduce.TaskAttemptContext taskContext)
         throws IOException, InterruptedException {
-      this.real = inputFormat.createRecordReader(split, taskContext);
       this.reporter = reporter;
       this.inputSplit = split;
       this.job = job;
@@ -483,11 +482,19 @@ class MapTask extends Task {
             .getPath());
       } 
       fsStats = matchedStats;
+	  
+      long bytesInPrev = getInputBytes(fsStats);
+      this.real = inputFormat.createRecordReader(split, taskContext);
+      long bytesInCurr = getInputBytes(fsStats);
+      fileInputByteCounter.increment(bytesInCurr - bytesInPrev);
     }
 
     @Override
     public void close() throws IOException {
+      long bytesInPrev = getInputBytes(fsStats);
       real.close();
+      long bytesInCurr = getInputBytes(fsStats);
+      fileInputByteCounter.increment(bytesInCurr - bytesInPrev);
     }
 
     @Override



Mime
View raw message