public class SensorsAggregates extends java.lang.Object
The two sensors are read as independent streams but combined
into a single stream and then aggregated across the last 50 readings
using windows. The window is partitioned by the sensor name
so that each sensor will have its own independent window.
This partitioning is automatic so that the same code would
work if readings from one hundred different sensors were
on the same stream, is it just driven by a key function.
The windows are then aggregated using Apache Common Math provided statistics and the final stream filtered so that it will only contain values when each sensor is (independently) out of range.
|Constructor and Description|
|Modifier and Type||Method and Description|
Run a topology with two bursty sensors printing them to standard out.
Create a stream containing two aggregates from two bursty sensors A and B that only produces output when the sensors (independently) are having a burst period out of their normal range.
public static void main(java.lang.String args) throws java.lang.Exception
args- command arguments
java.lang.Exception- on failure
topology- Topology to add the sub-graph to.
Copyright © 2017 The Apache Software Foundation. All Rights Reserved - 4744f56-20170226-1707