Package org.apache.heron.streamlet
Class StreamletReducers
- java.lang.Object
-
- org.apache.heron.streamlet.StreamletReducers
-
public final class StreamletReducers extends Object
This class contains a few standard reduces that can be used with Streamlet reduce functions such as reduceByKeyAndWindow. Example, assuming s is a Stringletobject and each tuple has these functions: - Integer getKey() and - Double getValue() To get streams of sum, min and max of all values upto the current one: s.reduceByKey(T::getKey, T::getValue, StreamletReducers::sum); s.reduceByKey(T::getKey, T::getValue, StreamletReducers::min); s.reduceByKey(T::getKey, T::getValue, StreamletReducers::max);
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Doublemax(Double a, Double b)static Floatmax(Float a, Float b)static Integermax(Integer a, Integer b)static Longmax(Long a, Long b)static Doublemin(Double a, Double b)static Floatmin(Float a, Float b)static Integermin(Integer a, Integer b)static Longmin(Long a, Long b)static Doublesum(Double a, Double b)static Floatsum(Float a, Float b)static Integersum(Integer a, Integer b)static Longsum(Long a, Long b)
-