检测某个事件的缺失 [英] Detect absence of a certain event

查看:18
本文介绍了检测某个事件的缺失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 FlinkCEP 的文档中,我发现我可以使用 notFollowedBynotNext 来强制特定事件不会发生在其他两个事件之间.

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.

但是,我想知道是否可以在时间 X 之后检测到某个事件的缺失.例如,如果一个事件 A 在 10 秒内没有跟随另一个事件 A,则发出警报或执行某些操作.

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.

是否可以定义一个 FlinkCEP 模式来捕捉这种情况?

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

提前致谢,温贝托

推荐答案

虽然 Flink CEP 不支持 Pattern 末尾的 notFollowedBy,但有一种方法可以通过利用超时功能来实现.

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.

Flink 培训包括一个练习,其中目标是识别具有 START 事件且在两小时内没有跟随 END 事件的出租车行程.您将找到使用 CEP 的本练习的解决方案此处.

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.

主要思想是在 10 秒内定义 A 后跟 A 的模式,然后捕获超时的情况.

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.

这篇关于检测某个事件的缺失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆