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 Double
max(Double a, Double b)
static Float
max(Float a, Float b)
static Integer
max(Integer a, Integer b)
static Long
max(Long a, Long b)
static Double
min(Double a, Double b)
static Float
min(Float a, Float b)
static Integer
min(Integer a, Integer b)
static Long
min(Long a, Long b)
static Double
sum(Double a, Double b)
static Float
sum(Float a, Float b)
static Integer
sum(Integer a, Integer b)
static Long
sum(Long a, Long b)
-