You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apex.apache.org by hs...@apache.org on 2017/01/06 06:01:13 UTC

[2/2] apex-malhar git commit: APEXMALHAR-2343 #resolve #comment Count Accumulation should only increase one for each tuple

APEXMALHAR-2343 #resolve #comment Count Accumulation should only increase one for each tuple


Project: http://git-wip-us.apache.org/repos/asf/apex-malhar/repo
Commit: http://git-wip-us.apache.org/repos/asf/apex-malhar/commit/e4763344
Tree: http://git-wip-us.apache.org/repos/asf/apex-malhar/tree/e4763344
Diff: http://git-wip-us.apache.org/repos/asf/apex-malhar/diff/e4763344

Branch: refs/heads/master
Commit: e4763344b1c0f54e2501fbb97c12100360e4a58d
Parents: 70caa89
Author: brightchen <br...@datatorrent.com>
Authored: Wed Nov 16 11:29:46 2016 -0800
Committer: Siyuan Hua <hs...@apache.org>
Committed: Wed Jan 4 22:59:05 2017 -0800

----------------------------------------------------------------------
 .../org/apache/apex/malhar/lib/window/accumulation/Count.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/apex-malhar/blob/e4763344/library/src/main/java/org/apache/apex/malhar/lib/window/accumulation/Count.java
----------------------------------------------------------------------
diff --git a/library/src/main/java/org/apache/apex/malhar/lib/window/accumulation/Count.java b/library/src/main/java/org/apache/apex/malhar/lib/window/accumulation/Count.java
index 62c5678..7a46e22 100644
--- a/library/src/main/java/org/apache/apex/malhar/lib/window/accumulation/Count.java
+++ b/library/src/main/java/org/apache/apex/malhar/lib/window/accumulation/Count.java
@@ -26,7 +26,7 @@ import org.apache.commons.lang3.mutable.MutableLong;
  *
  * @since 3.5.0
  */
-public class Count implements Accumulation<Long, MutableLong, Long>
+public class Count<T> implements Accumulation<T, MutableLong, Long>
 {
 
   @Override
@@ -36,9 +36,9 @@ public class Count implements Accumulation<Long, MutableLong, Long>
   }
 
   @Override
-  public MutableLong accumulate(MutableLong accumulatedValue, Long input)
+  public MutableLong accumulate(MutableLong accumulatedValue, T input)
   {
-    accumulatedValue.add(input);
+    accumulatedValue.increment();
     return accumulatedValue;
   }