1,Flink CEP 中 SimpleCondition/IterativeCondition的区别
应该是针对 个体模式 与 组合模式的用法区别,我在这里使用的感觉就效果是一样的。
2,flatselect 和 select的区别
我在这里使用的感觉就效果是一样的,有个可以输出多个结果,输出list,一个是只能输出单个实体。
3,consecutive 和 allowCombinations关键字
consecutive()显式指定它, 如果你想要非确定性的松弛连续性,你可以使用allowCombinations()方法
4,循环模式 times(x)不是严格紧邻
对于循环模式(例如oneOrMore()和times()),默认是宽松的连续性。 如果你想要严格的连续性,你必须使用consecutive()显式指定它, 如果你想要非确定性的松弛连续性,你可以使用allowCombinations()方法。
1.正常的单例模式
Pattern<LoginEvent, LoginEvent> pattern = Pattern.<LoginEvent>begin("start").where(new SimpleCondition<LoginEvent>() {
@Override
public boolean filter(LoginEvent value) throws Exception {
return "fail".equals(value.getEventType());
}
}).next("next").where(new SimpleCondition<LoginEvent>() {
@Override
public boolean filter(LoginEvent value) throws Exception {
return "fail".equals(value.getEventType());
} //正常的单例模式
}).within(Time.seconds(2));
2.如果换成循环模式:
运行结果与我想的不一样,不应该有下图红框,