Best way to create 1000 patterns programmatically

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Best way to create 1000 patterns programmatically

dhanuka ranasinghe
Hi All,

I tried to do $Subject and end up with with below and it's highly inefficient. Could you please suggest better solution.


Cheers,
Dhanuka
--
Nothing Impossible,Creativity is more important than knowledge.
Reply | Threaded
Open this post in threaded view
|

Re: Best way to create 1000 patterns programmatically

dhanuka ranasinghe
Source code

On Fri, Jan 25, 2019 at 5:59 PM dhanuka ranasinghe <[hidden email]> wrote:
Hi All,

I tried to do $Subject and end up with with below and it's highly inefficient. Could you please suggest better solution.
CEP-loop-multiple-patterns.png

Cheers,
Dhanuka
--
Nothing Impossible,Creativity is more important than knowledge.


--
Nothing Impossible,Creativity is more important than knowledge.

FlinkCEP.java (14K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Best way to create 1000 patterns programmatically

dwysakowicz

Hi,

Right now Flink's cep library does not support deploying multiple patterns into a single operator.

I had a look at your code and as long as you don't want to look for sequence of 2 or more events, I don't think CEP library is the right approach. You could achieve the same with a simple filter function on DataStream.

If you construct all those conditions statically you could construct such complex condition inside e.g. FlatMapFunction. If you need to output events to separate output streams you could have a look at ProcessFunction[1] with side-outputs[2].

Best,

Dawid

[1] https://ci.apache.org/projects/flink/flink-docs-release-1.7/dev/stream/operators/process_function.html#process-function-low-level-operations

[2] https://ci.apache.org/projects/flink/flink-docs-release-1.7/dev/stream/side_output.html#side-outputs

On 25/01/2019 11:03, dhanuka ranasinghe wrote:
Source code

On Fri, Jan 25, 2019 at 5:59 PM dhanuka ranasinghe <[hidden email]> wrote:
Hi All,

I tried to do $Subject and end up with with below and it's highly inefficient. Could you please suggest better solution.
CEP-loop-multiple-patterns.png

Cheers,
Dhanuka
--
Nothing Impossible,Creativity is more important than knowledge.


--
Nothing Impossible,Creativity is more important than knowledge.

signature.asc (849 bytes) Download Attachment