1

I'm trying to understand if Flink can perform the way I need it to.

Using the CEP library for pattern matching, is it possible to set up multiple streams based off initial pattern match?

For instance, a message comes in and matches pattern x1, and then the next message matches pattern y1, the following is y2, and the next is x2. Is there a way for Flink to distinguish between the multiple sets of patterns, and keep looking for each pattern match over a specified length of time?

Or does Flink just ignore messages that don't match the next part of the pattern? If the order is x1 > y1 > y2 > x2, will it just ignore y1 and y2 because they don't match the pattern of x1?

ko1984
  • 41
  • 2
  • Could you explain a little more what do you mean? Possibly with some code examples for the `Patterns`? – Dawid Wysakowicz Mar 16 '17 at 19:30
  • Well, I basically need multiple files with different stream patterns. I'm using Scala right now, but I will probably use Java. I'm still trying to figure out how this works, but I wanted to see if anyone knew offhand before I get too deep into this. – ko1984 Mar 16 '17 at 20:12
  • @DawidWysakowicz For example: `val start : Pattern[Event, _] = Pattern.begin("start") start.where(event => ... /* some condition */) patternState.within(Time.seconds(10))` Where pattern starts, if an event comes in that doesn't match/continue the first pattern, is it possible to use a different pattern? – ko1984 Mar 16 '17 at 20:18
  • You can apply as many patterns as you like to a stream, they will be independent then. I mean then a single event could match to multiple patterns. I hope for 1.3.0 we will be able to introduce `optional` quantifier, so you could then specify that the first part is optional and will try to match on the second part of Pattern. – Dawid Wysakowicz Mar 17 '17 at 07:37
  • You mean matching over sections of a single pattern? or matching over two different patterns? Sorry I'm so confusing, I'm still brand new to this. – ko1984 Mar 17 '17 at 13:26

0 Answers0