Detect absence of a certain event

萝らか妹 提交于 2021-01-28 17:50:06

问题


In the documentation of FlinkCEP, I found that I can enforce that a particular event doesn't occur between two other events using notFollowedBy or notNext.

However, I was wondering If I could detect the absence of a certain event after a time X. For example, if an event A is not followed by another event A within 10 seconds, fire an alert or do something.

Could be possible to define a FlinkCEP pattern to capture that situation?

Thanks in advance, Humberto


回答1:


Although Flink CEP does not support notFollowedBy at the end of a Pattern, there is a way to implement this by exploiting the timeout feature.

The Flink training includes an exercise where the objective is to identify taxi rides with a START event that is not followed by an END event within two hours. You'll find a solution to this exercise that uses CEP here.

The main idea would be to define a Pattern of A followed by A within 10 seconds, and then capture the case where this times out.



来源:https://stackoverflow.com/questions/60730969/detect-absence-of-a-certain-event

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!