Flink CEP Streaming:批处理模式,连续批处理还是微批处理?

时间:2016-05-27 10:43:32

标签: batch-file apache-flink flink-streaming flink-cep

我想了解这个Flink CEP示例

https://github.com/tillrohrmann/cep-monitoring ..我在分布式模式(1个主机和3个核心)上执行了Flink CEP的这个例子。现在我正在将输出写入文件,因此我的输出被写入3个文件,因为3个核心..在其中一个文件中,我看到的记录如下:

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 

现在,如果我们从第5行开始查看。我们可以检查从第5行打印的所有 TemperatureAlerts (即温度:113.65291115679136),我们可以确定以下温度(温度) :113.65291115679136出现在温度警告的第15行,这意味着我们可以识别哪些温度,警报已打印....但是从1号到4号线生成的警报呢?您甚至可以在行号中找到相同的记录。 11 ..我的意思是我们如何确定哪些温度警告已生成警报?它是以批处理模式,连续模式还是微批处理模式执行流式传输 ??

1 个答案:

答案 0 :(得分:1)

  1. 当10个窗口中有两个连续的TemperatureEvents来自同一个机架ID时,会产生TemperatureWarning。

  2. 当同一个机架ID在20秒窗口内有两个连续的TemperatureWarnings时,会生成TemperatureAlert 温度警告温度似乎在增加。 TemperatureAlert具有第一个温度警告

  3. 的数据
  4. 这是连续流源