Package com.gengoai.stream.spark
Class AccumulatorV2Wrapper<IN,OUT>
- java.lang.Object
-
- org.apache.spark.util.AccumulatorV2<IN,OUT>
-
- com.gengoai.stream.spark.AccumulatorV2Wrapper<IN,OUT>
-
- Type Parameters:
IN
- the type parameter for what is being accumulatedOUT
- the type parameter for the result of the accumulation
- All Implemented Interfaces:
Serializable
,scala.Serializable
public class AccumulatorV2Wrapper<IN,OUT> extends org.apache.spark.util.AccumulatorV2<IN,OUT> implements Serializable
Wraps aLocalMAccumulator
making it usable by Spark- Author:
- David B. Bracewell
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description LocalMAccumulator<IN,OUT>
accumulator
The Accumulator.
-
Constructor Summary
Constructors Constructor Description AccumulatorV2Wrapper(LocalMAccumulator<IN,OUT> accumulator)
Instantiates a new AccumulatorV2Wrapper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(IN v)
org.apache.spark.util.AccumulatorV2<IN,OUT>
copy()
org.apache.spark.util.AccumulatorV2<IN,OUT>
copyAndReset()
Optional<String>
getWrappedName()
Gets the name of the wrapped accumulatorboolean
isZero()
void
merge(org.apache.spark.util.AccumulatorV2<IN,OUT> other)
void
reset()
OUT
value()
-
-
-
Field Detail
-
accumulator
public final LocalMAccumulator<IN,OUT> accumulator
The Accumulator.
-
-
Constructor Detail
-
AccumulatorV2Wrapper
public AccumulatorV2Wrapper(LocalMAccumulator<IN,OUT> accumulator)
Instantiates a new AccumulatorV2Wrapper.- Parameters:
accumulator
- the accumulator to wrap
-
-
Method Detail
-
isZero
public boolean isZero()
-
getWrappedName
public Optional<String> getWrappedName()
Gets the name of the wrapped accumulator- Returns:
- the name of the wrapped accumulator as an optional
-
-