Package com.gengoai.stream.spark
Class SparkMMapAccumulator<K,V>
- java.lang.Object
-
- com.gengoai.stream.spark.SparkMAccumulator<Tuple2<K,V>,Map<K,V>>
-
- com.gengoai.stream.spark.SparkMMapAccumulator<K,V>
-
- Type Parameters:
K
- the key type parameter of the mapV
- the value type parameter of the map
- All Implemented Interfaces:
MAccumulator<Tuple2<K,V>,Map<K,V>>
,MMapAccumulator<K,V>
,Serializable
public class SparkMMapAccumulator<K,V> extends SparkMAccumulator<Tuple2<K,V>,Map<K,V>> implements MMapAccumulator<K,V>
An implementation of a
MMapAccumulator
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 SparkMMapAccumulator(String name)
Instantiates a new SparkMMapAccumulator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
put(K key, V value)
Adds the given key-value pair ot the mapvoid
putAll(Map<? extends K,? extends V> other)
Adds all entries of the given map overriding any current entries.-
Methods inherited from class com.gengoai.stream.spark.SparkMAccumulator
add, isZero, merge, name, register, reset, value
-
-
-
-
Constructor Detail
-
SparkMMapAccumulator
public SparkMMapAccumulator(String name)
Instantiates a new SparkMMapAccumulator.- Parameters:
name
- the name of the accumulator
-
-
Method Detail
-
put
public void put(K key, V value)
Description copied from interface:MMapAccumulator
Adds the given key-value pair ot the map- Specified by:
put
in interfaceMMapAccumulator<K,V>
- Parameters:
key
- the key to addvalue
- the value to associate with the key
-
putAll
public void putAll(Map<? extends K,? extends V> other)
Description copied from interface:MMapAccumulator
Adds all entries of the given map overriding any current entries.- Specified by:
putAll
in interfaceMMapAccumulator<K,V>
- Parameters:
other
- the map whose key-value pairs are to be added
-
-