A Flink streaming application for processing temperature data from a Pravega Stream
.
Complements the Turbine Heat Sensor app
(turbineheatsensor
).
The application computes a daily summary of the temperature range observed on that day by each sensor.
Automatically creates a scope (default: examples
) and stream (default: turbineHeatTest
) as necessary.
- Pravega running (see here for instructions)
- Build pravega-samples repository
- Apache Flink running
Run the sample from the command-line:
$ bin/run-example [--controller <URI>] [--input <scope>/<stream>] [--startTime <long>] [--output <path>]
Alternately, run the sample from the Flink UI.
- JAR:
pravega-flink-examples-<VERSION>-all.jar
- Main class:
io.pravega.turbineheatprocessor.TurbineHeatProcessor
orio.pravega.turbineheatprocessor.TurbineHeatProcessorScala
The application outputs the daily summary as a comma-separated values (CSV) file, one line per sensor per day. The data is also emitted to stdout (which may be viewed in the Flink UI). For example:
...
SensorAggregate(1065600000,12,Illinois,(60.0,100.0))
SensorAggregate(1065600000,3,Arkansas,(60.0,100.0))
SensorAggregate(1065600000,7,Delaware,(60.0,100.0))
SensorAggregate(1065600000,15,Kansas,(40.0,80.0))
SensorAggregate(1152000000,3,Arkansas,(60.0,100.0))
SensorAggregate(1152000000,12,Illinois,(60.0,100.0))
SensorAggregate(1152000000,15,Kansas,(40.0,80.0))
SensorAggregate(1152000000,7,Delaware,(60.0,100.0))
...