首页 文章

在Apache Flink中动态添加模式而无需重新启动作业

提问于
浏览
0

我的用例是我想将不同的CEP模式应用于同一个数据流 . CEP模式是动态的,我希望它们可以添加到flink而无需重新启动作业 . 虽然可以通过实现IterativeCondition的自定义类来处理所有条件,但我的主要问题是时间条件只接受TimeWindow;这是无法处理的 . 是否有某种方法可以根据输入元素设置传递给.within()的值?

这里有类似的问题:Flink and Dynamic templates recognition

Best Answer: "What one could add is a co-flat map operator which receives on one input channel the events and on the other input channel patterns. For each newly received pattern one either updates the existing NFA (this functionality is missing) or compiles a new one. In the latter case, one would apply incoming events to all stored NFAs."

我正在努力实现这一点,但我面临一些困难 . 具体而言,在“在后一种情况下,可以将传入事件应用于所有存储的NFA”

原因是我将流应用于模式使用:PatternStream matchStream = CEP.pattern(tmatchStream,pattern);

但是流“tmatchStream”不会在co-flatMap中定义 . 我在这里遗漏了什么吗???任何帮助将不胜感激 .

1 回答

  • 0

    不幸的是,相关问题的答案仍然有效 . Flink CEP当时不支持动态模式 . 虽然已经有一张JIRA票:FLINK-7129

    该功能的最早合理目标版本为1.6.0

相关问题