apex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hsy...@apache.org
Subject [2/2] apex-malhar git commit: APEXMALHAR-2343 #resolve #comment Count Accumulation should only increase one for each tuple
Date Fri, 06 Jan 2017 06:01:13 GMT
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 <bright@datatorrent.com>
Authored: Wed Nov 16 11:29:46 2016 -0800
Committer: Siyuan Hua <hsy541@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;
   }
 


Mime
View raw message