Am I understanding you correctly in that, if one sensor of on factory
raises an alert, then you want all sensors in that same factory to raise
an alert?
How big is this dataset that maps sensors to factories?
Maybe you can just load them into a Map<Sensor, Factory> in say a
FlatMap, enrich the sensor data stream, keyBy the factory id and then do
your windowing logic (I assume you have some time window)?
Although this would only work if you want alerts only for sensors in a
given window.
If you want to have an alert for literally all sensors in a factory then
you could instead add the FlatMap after the window, and map the sensor
-> factory -> all_sensors and duplicate the alerts.
On 15/05/2020 08:21, Aissa Elaffani wrote:
Hello Guys,
I am a beginner in this field of real-time streaming and i am working
with apache flink, and i ignore a lot of features of it, and actually
I am building an application, in which i receive some sensors data in
this format {"status": "Alerte", "classe": " ", "value":
{"temperature": 15.7}, "mode": "ON", "equipementID": 1, "date":
"2019-03-20 22:00", "sensorID": 9157}, each sensor is installed on an
equipment in a workshop in a factory somewhere. My goal is :
If one sensor of a factory get down (status="alerte"), I want that the
status of all the factory to be Alerte. But as the Stream does not
contain the factory ID, other Static data set source that contain the
data of factories and the sensors that belongs to each one.
So Please guys i want to know the optimized way to do so, and the
aggregation that i need to do!
Sorry for disturbing you, i wish you all the best! And i hope you
share with me the of your experiences!
Best regards,
Aissa