Package com.gengoai.stream.spark
Class SparkMCounterAccumulator<E>
- java.lang.Object
-
- com.gengoai.stream.spark.SparkMAccumulator<E,Counter<E>>
-
- com.gengoai.stream.spark.SparkMCounterAccumulator<E>
-
- Type Parameters:
E
- the component type parameter of the cunter
- All Implemented Interfaces:
MAccumulator<E,Counter<E>>
,MCounterAccumulator<E>
,Serializable
public class SparkMCounterAccumulator<E> extends SparkMAccumulator<E,Counter<E>> implements MCounterAccumulator<E>
Counter accumulator implementation for Spark streams
- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.gengoai.stream.spark.SparkMAccumulator
accumulatorV2
-
-
Constructor Summary
Constructors Constructor Description SparkMCounterAccumulator(String name)
Instantiates a new Spark m counter accumulator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
increment(E item, double amount)
Increments the given item by the given amount.void
merge(Counter<? extends E> counter)
Merges the given counter with this accumulator-
Methods inherited from class com.gengoai.stream.spark.SparkMAccumulator
add, isZero, merge, name, register, reset, value
-
-
-
-
Constructor Detail
-
SparkMCounterAccumulator
public SparkMCounterAccumulator(String name)
Instantiates a new Spark m counter accumulator.- Parameters:
name
- the name of the accumulator
-
-
Method Detail
-
increment
public void increment(E item, double amount)
Description copied from interface:MCounterAccumulator
Increments the given item by the given amount.- Specified by:
increment
in interfaceMCounterAccumulator<E>
- Parameters:
item
- the item to incrementamount
- the amount to increment the item by
-
merge
public void merge(Counter<? extends E> counter)
Description copied from interface:MCounterAccumulator
Merges the given counter with this accumulator- Specified by:
merge
in interfaceMCounterAccumulator<E>
- Parameters:
counter
- the counter to merge
-
-