haoch / flink-siddhi

A CEP library to run Siddhi within Apache Flink™ Streaming Application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[DISCUSS] How to enable dynamic pattern ?

JasonChoi27 opened this issue · comments

hi, haoch

I don't want to reload flink driver when add a new pattern or change one.

Here is my way:
extend AbstractSiddhiOperator with implementing TwoInputStreamOperator, while one input accepts pattern stream and the other processes event. When receiving new pattern, reload SiddhiAppRuntime with new executionPlan.

Does it work for my case? Or is there a better way to enable dynamic pattern?

MetadataControlEvent?

ok, i have found the way.

 DataStream<Row> output = SiddhiCEP
            .define(...)
            .cql(DataStream<ControlEvent> controlStream)
            .return(...);

Yes, you could useControlEvent to broadcast to all operator as the interface for managing runtime dynamically.