flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kostas Kloudas <k.klou...@data-artisans.com>
Subject Re: Questions about the FlinkCEP
Date Thu, 01 Mar 2018 09:35:23 GMT
Hi Esa,

The answers to the questions are inlined.

> On Feb 28, 2018, at 8:32 PM, Esa Heikkinen <heikkin2@student.tut.fi> wrote:
> Hi
> I have tried to learn FlinkCEP [1], but i have yet not found the clear answers for questions:
> 1) Whether the pattern of CEP is meant only for one data stream at the same time ?
> 2) If i have many different parallel data streams (or sources), should i combine them
into one data stream (and is this possible ?), if i want to use same CEP pattern for all parallel
streams at the same time ?

Yes you should somehow combine them. This can be done with .union if this is ok for you logic
how to do it depends on your job. Or you can just apply the same pattern to all your streams
and then
union the result into a single output stream.

> 3) What is the format of data stream of events for CEP ?

The input can be an arbitrary data stream.

https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/libs/cep.html <https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/libs/cep.html>
https://flink.apache.org/news/2016/04/06/cep-monitoring.html <https://flink.apache.org/news/2016/04/06/cep-monitoring.html>
https://data-artisans.com/blog/complex-event-processing-flink-cep-update <https://data-artisans.com/blog/complex-event-processing-flink-cep-update>
> 4) Can i directly supply a data stream from env.socketTextStream() to CEP ? 

Yes. Why don’t you try it out ;)

> 5) Can one event in stream include many "attributes" and values ? Or is it only key-value-pair
? Timestamp of event ?

An event can have arbitrary format. It is up to you to interpret your data.

> 6) Can CEP save the found values of events for use in later "steps" ? For example in
> val pattern = Pattern.begin("start").where(_.getId == 42)
> .next("middle").subtype(classOf[SubEvent]).where(_.getVolume >= 10.0)
> .followedBy("end").where(_.getName == "end")
> Whether value of Id in"start"-step can be saved and check whether it (Id) is same in
"end"-step ?

If I get the question right, you can do it with Iterative conditions, as described in the

> [1] https://ci.apache.org/projects/flink/flink-docs-release-1.4/dev/libs/cep.html
> Best, Esa


View raw message