Reputation: 503
I am trying to understand this Flink CEP example
https://github.com/tillrohrmann/cep-monitoring ..I executed this example of Flink CEP on distributed mode (1 master & 3 cores)..Now I am writing the output to files,hence my output is getting written to 3 files becasuse of 3 cores..In one of the file,I see the records as follows :
TemperatureAlert(4), For Temperature:110.60808293330018,At Timestamp : 1464259424016
TemperatureAlert(4), For Temperature:102.75469017603604,At Timestamp : 1464259486205
TemperatureAlert(4), For Temperature:110.98650912782037,At Timestamp : 1464259492214
TemperatureAlert(4), For Temperature:115.47245702561352,At Timestamp : 1464259554901
TemperatureAlert(1), For Temperature:113.65291115679136,At Timestamp : 1464259735252
TemperatureAlert(1), For Temperature:110.88374917920495,At Timestamp : 1464259795436
TemperatureAlert(1), For Temperature:116.23995588293668,At Timestamp : 1464259810056
TemperatureAlert(4), For Temperature:103.27459440260448,At Timestamp : 1464259929121
TemperatureAlert(1), For Temperature:114.53029859331343,At Timestamp : 1464259942139
TemperatureAlert(4), For Temperature:109.13921010205338,At Timestamp : 1464260060204
(4,117.14184470661019) ,1464259692594
TemperatureWarning(4,115.08289903597866) ,1464259701806
TemperatureWarning(4,113.9136297471108) ,1464259723436
TemperatureWarning(1,112.15684481878216) ,1464259733249
TemperatureWarning(1,113.65291115679136) ,1464259735252
TemperatureWarning(1,125.07387226846537) ,1464259770401
TemperatureWarning(1,100.829623781131) ,1464259776409
TemperatureWarning(4,105.76155716070109) ,1464259789027
TemperatureWarning(1,110.88374917920495) ,1464259795436
TemperatureWarning(1,110.03271176117211) ,1464259803447
TemperatureWarning(1,108.99904165096143) ,1464259809255
TemperatureWarning(1,116.23995588293668) ,1464259810056
TemperatureWarning(1,113.74475027506949) ,1464259815664
TemperatureWarning(4,118.65623814713382) ,1464259826078
TemperatureWarning(1,125.24779125130385) ,1464259877349
TemperatureWarning(4,110.38935504983476) ,1464259890467
TemperatureWarning(4,101.92222208289115) ,1464259927319
TemperatureWarning(4,103.27459440260448) ,1464259929121
TemperatureWarning(1,113.15048106140453) ,1464259937533
TemperatureWarning(1,114.53029859331343) ,1464259942139
TemperatureWarning(4,112.4172409140119) ,1464259953755
TemperatureWarning(1,107.21833971444117) ,1464259981194
TemperatureWarning(1,105.08408728033956) ,1464259981594
TemperatureWarning(4,108.83063471822507) ,1464259990608
TemperatureWarning(4,127.9723904319025) ,1464260054997
TemperatureWarning(4,106.06561268720989) ,1464260059804
TemperatureWarning(4,109.13921010205338) ,1464260060204
Now if we start looking from line number 5. We can check that all TemperatureAlerts that have been printed from line number 5 (i.e. for temperature : 113.65291115679136),we can identify the temperatures below (Temperature : 113.65291115679136 is present at line 15) in TemperatureWarning meaning which we can identify for which temperatures,the alerts have been printed....but what about the alerts generated from line number 1 to 4 ?? You can even find the same for record in line no. 11.. I mean how we can identify that for which TemperatureWarnings that alerts have been generated ?? Is it performing streaming in batch-mode , continuous or micro-batch mode ??
Upvotes: 1
Views: 312
Reputation: 9633
TemperatureWarning is generated when there are two consecutive TemperatureEvents coming with in 10sec window from the same rack id.
TemperatureAlert is generated when there are two consecutive TemperatureWarnings comming with in 20 sec window from the same rack id and TemperatureWarnings temp seems to be increasing. TemperatureAlert has the data of first TemperatureWarning
It is continuous stream source
Upvotes: 1