简体   繁体   中英

providing context for next condition

I want to detect all sequences of the same integer that is followed by the count of these integers. is there any way to create this pattern with the Flink CEP library? suppose this:

val input List(1,2,2,2,3,3,2,1,1,1,3,0,1)

these sequences should be detected:

List(2,2,2,3)
List(3,3,2)
List(1,1,1)

I know there are many ways to do it by the Flink itself but I want to do it with CEP and I think it needs support passing context to the next condition am I right? if so, is it possible with Flink CEP to pass context or modify the events on stream and put some extra data to pass information to the next condition?

is it possible with Flink CEP to pass context or modify the events on stream and put some extra data to pass information to the next condition?

Flink CEP supports iterative conditions , which are conditions that can examine the events that matched earlier components of a compound pattern. I think that's powerful enough to handle this use case.

There's an example showing how to use iterative conditions in one of the recipes in the Immerok Cookbook: Alerting when Problems Persist .

(Disclaimer: I work for Immerok.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM