November 2017
Beginner to intermediate
290 pages
7h 34m
English
Examples for an augmented word count that show the use of windowing for both, the low-level DAG API and the high-level stream API, can be found at https://github.com/tweise/apex-samples/tree/master/windowing.
The following code block shows the DAG construction for a keyed sum aggregation over a fixed time window of one minute that emits the intermediate sum every second and the final result at the watermark:
public void populateDAG(DAG dag, Configuration configuration) { WordGenerator inputOperator = new WordGenerator(); KeyedWindowedOperatorImpl<String, Long, MutableLong, Long> windowedOperator = new KeyedWindowedOperatorImpl<>(); Accumulation<Long, MutableLong, Long> sum = new SumAccumulation(); windowedOperator.setAccumulation(sum); ...Read now
Unlock full access