Re: Flink CEP questions
Posted by
Basanth Gowda on
URL: http://deprecated-apache-flink-user-mailing-list-archive.369.s1.nabble.com/Flink-CEP-questions-tp14971p14990.html
Hi Kostas,
For 3 -> I was able to do the following and it worked perfectly fine. Is there a way we could reset? Looks like the following code behaves more like a sliding count. What I want to do is reset the count once the alert has matched, and start over the count. May be I will have to have some state and do that in filter event myself ?
Pattern.<Event>begin("rule").where(new IterativeCondition<Event>() {
@Override
public boolean filter(Event event, Context<Event> context) throws Exception {
event.getCpu() > 80.0;
}
}).times(5).within(Time.of(1, TimeUnit.MINUTES));
For 4 -> I wasn't able to do this. Assuming I don't know the frequency of Input events, I want to tell every event that came in the 1 minute, should have matched the pattern. It could be 10 events in one minute, may be 50 the next minute. If all the events in the window match the pattern, then we want an alert.
thank you,
Basanth