V
- Type of values that are added to the accumulatorR
- Type of the accumulator result as it will be reported to the client@Public public interface Accumulator<V,R extends Serializable> extends Serializable, Cloneable
The accumulators are inspired by the Hadoop/MapReduce counters.
The type added to the accumulator might differ from the type returned. This is the case e.g. for a set-accumulator: We add single objects, but the result is a set of objects.
Modifier and Type | Method and Description |
---|---|
void |
add(V value) |
Accumulator<V,R> |
clone()
Duplicates the accumulator.
|
R |
getLocalValue() |
void |
merge(Accumulator<V,R> other)
Used by system internally to merge the collected parts of an accumulator at the end of the
job.
|
void |
resetLocal()
Reset the local value.
|
void add(V value)
value
- The value to add to the accumulator objectR getLocalValue()
void resetLocal()
void merge(Accumulator<V,R> other)
other
- Reference to accumulator to merge in.Accumulator<V,R> clone()
CloneNotSupportedException
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.