Browse Source

HADOOP-1467. Remove redundant counters from WordCount example. Contributed by Owen O'Malley.

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk@547393 13f79535-47bb-0310-9956-ffa450edef68
Thomas White 18 năm trước cách đây
mục cha
commit
5b2e9fe6a7
2 tập tin đã thay đổi với 3 bổ sung5 xóa
  1. 3 0
      CHANGES.txt
  2. 0 5
      src/examples/org/apache/hadoop/examples/WordCount.java

+ 3 - 0
CHANGES.txt

@@ -114,6 +114,9 @@ Trunk (unreleased changes)
  36. HADOOP-1396.  Fix FileNotFoundException on DFS block.
      (Dhruba Borthakur via tomwhite)
 
+ 37. HADOOP-1467.  Remove redundant counters from WordCount example.
+     (Owen O'Malley via tomwhite)
+
 
 Release 0.13.0 - 2007-06-08
 

+ 0 - 5
src/examples/org/apache/hadoop/examples/WordCount.java

@@ -47,9 +47,6 @@ import org.apache.hadoop.mapred.MapReduceBase;
  */
 public class WordCount {
   
-  // These are just for testing counters
-  private enum Counter { WORDS, VALUES }
-  
   /**
    * Counts the words in each line.
    * For each line of input, break the line into words and emit them as
@@ -68,7 +65,6 @@ public class WordCount {
       while (itr.hasMoreTokens()) {
         word.set(itr.nextToken());
         output.collect(word, one);
-        reporter.incrCounter(Counter.WORDS, 1);
       }
     }
   }
@@ -84,7 +80,6 @@ public class WordCount {
       int sum = 0;
       while (values.hasNext()) {
         sum += ((IntWritable) values.next()).get();
-        reporter.incrCounter(Counter.VALUES, 1);
       }
       output.collect(key, new IntWritable(sum));
     }