Class Histogram
- java.lang.Object
-
- org.apache.flink.api.common.accumulators.Histogram
-
- All Implemented Interfaces:
Serializable,Cloneable,Accumulator<Integer,TreeMap<Integer,Integer>>
@Public public class Histogram extends Object implements Accumulator<Integer,TreeMap<Integer,Integer>>
Histogram accumulator, which builds a histogram in a distributed manner. Implemented as a Integer->Integer TreeMap, so that the entries are sorted according to the values.This class does not extend to continuous values later, because it makes no attempt to put the data in bins.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Histogram()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Integer value)Accumulator<Integer,TreeMap<Integer,Integer>>clone()Duplicates the accumulator.TreeMap<Integer,Integer>getLocalValue()voidmerge(Accumulator<Integer,TreeMap<Integer,Integer>> other)Used by system internally to merge the collected parts of an accumulator at the end of the job.voidresetLocal()Reset the local value.StringtoString()
-
-
-
Method Detail
-
add
public void add(Integer value)
-
getLocalValue
public TreeMap<Integer,Integer> getLocalValue()
- Specified by:
getLocalValuein interfaceAccumulator<Integer,TreeMap<Integer,Integer>>- Returns:
- local The local value from the current UDF context
-
merge
public void merge(Accumulator<Integer,TreeMap<Integer,Integer>> other)
Description copied from interface:AccumulatorUsed by system internally to merge the collected parts of an accumulator at the end of the job.
-
resetLocal
public void resetLocal()
Description copied from interface:AccumulatorReset the local value. This only affects the current UDF context.- Specified by:
resetLocalin interfaceAccumulator<Integer,TreeMap<Integer,Integer>>
-
clone
public Accumulator<Integer,TreeMap<Integer,Integer>> clone()
Description copied from interface:AccumulatorDuplicates the accumulator. All subclasses need to properly implement cloning and cannot throw aCloneNotSupportedException
-
-