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 <[email protected]> Authored: Wed Nov 16 11:29:46 2016 -0800 Committer: Siyuan Hua <[email protected]> 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; }
