© Copyright. All rights reserved. Not to be reproduced without prior written consent.
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
About me
■ Data Engineer at GetInData
■ Apache Flink Committer
■ Involved in Flink CEP library development
Dawid Wysakowicz
@dwysakowicz
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
CEP engines’ features
■ Event-pattern detection
■ Event abstraction
■ Event filtering
■ Event aggregation and transformation
■ Modeling event hierarchies
■ Detecting relationships (such as causality, membership or
timing) between events
■ Abstracting event-driven processes
David C. Luckham. 2001. The Power of Events: An Introduction to Complex Event Processing in Distributed Enterprise
Systems. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA.
Opher Etzion and Peter Niblett. 2010. Event Processing in Action (1st ed.). Manning Publications Co., Greenwich, CT, USA.
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
CEP engines’ features
■ Event-pattern detection
■ Event abstraction
■ Event filtering
■ Event aggregation and transformation
■ Modeling event hierarchies
■ Detecting relationships (such as causality, membership or
timing) between events
■ Abstracting event-driven processes
FlinkCEP
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
CEP engines’ features
■ Event-pattern detection
■ Event abstraction
■ Event filtering
■ Event aggregation and transformation
■ Modeling event hierarchies
■ Detecting relationships (such as causality, membership or
timing) between events
■ Abstracting event-driven processes
FlinkCEP
Flink ecosystem
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
Buying Home Insurance Online
Property
Info
Offer
Accept
General Terms
of Contract
PaymentScope
Change
Info
Change
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
Simple Example - Matching Payments
Notify whenever a payment for accepted offer arrives
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
Patterns
Pattern
.begin("Offer accepted")
.subtype(OfferAccepted.class)
.where(...)
.or(...)
.followedBy("Payment received")
.subtype(Payment.class)
.where(...)
.where(...)
Basic building blocks
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
Conditions
Pattern
.begin("Offer accepted")
.subtype(OfferAccepted.class)
.where(...)
.or(...)
.followedBy("Payment received")
.subtype(Payment.class)
.where(...)
.where(...)
Basic building blocks
Condition specification
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
Pattern succession
Pattern
.begin("Offer accepted")
.subtype(OfferAccepted.class)
.where(...)
.or(...)
.followedBy("Payment received")
.subtype(Payment.class)
.where(...)
.where(...)
Basic building blocks
Condition specification
Pattern succession
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
Time Restrictions
Pattern
.begin("Offer accepted")
.subtype(OfferAccepted.class)
.where(...)
.or(...)
.followedBy("Payment received")
.subtype(Payment.class)
.where(...)
.where(...)
.within(Time.seconds(3))
Basic building blocks
Condition specification
Time restrictions
Pattern succession
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
Image source: “Continuous Analytics: Stream Query Processing in Practice”, Michael J Franklin, Professor, UC Berkley, Dec 2009 and
http://www.slideshare.net/JoshBaer/shortening-the-feedback-loop-big-data-spain-external
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
■ followedBy
Consuming Strategy
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
■ followedBy
■ next
Consuming Strategy
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
■ followedBy
■ next
■ notFollowedBy
Consuming Strategy
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
■ followedBy
■ next
Consuming Strategy
■ notFollowedBy
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
■ Skip till next
■ Strict continuity
■ Skip till any
■ Not follow
■ Not next
See more:
https://ci.apache.org/projects/flink/flink-docs-release-1.3/dev/libs/cep.html#conditions-on-contiguity
https://www.slideshare.net/DawidWysakowicz/flink-complex-event-processing
Consuming Strategy
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
Looping Example
How many offer changes before accepting?
...
?
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
Quantifiers
Pattern
.begin("start")
.subtype(Event.class)
.where(...)
.or(...)
.times(3)
.followedBy("next")
.subtype(Event.class)
.where(...)
.where(...)
.oneOrMore().optional()
.within(Time.seconds(3))
Quantifier application
Basic building blocks
Condition specification
Time restrictions
Pattern succession
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
Nondeterministic Finite Automaton
■ Graph where:
● Vertices = States
● Edges = Transitions
■ IGNORE - event not consumed
■ TAKE - event consumed
■ PROCEED - event analyzed in the target state
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
Example of NFA
Pattern
.begin(“A”)
.followedByAny(“B”).optional()
.next(“C”)
.followedBy(“D”)
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
Example of NFA
A B? C D
TAKE (A) TAKE (C)
TAKE
(B)
PROCEED
(TRUE)
IGNORE (TRUE)
IGNORE
(TRUE)
IGNORE
(not D)
TAKE (D)
Pattern
.begin(“A”)
.followedByAny(“B”).optional()
.next(“C”)
.followedBy(“D”)
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
EventsStream
Example of NFA
A
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
EventsStream
Example of NFA
A B? C D
TAKE TAKE
TAKE
PROCEED
IGNORE IGNORE IGNORE
TAKE
A
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
EventsStream
Example of NFA
A
A
B?
A
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
EventsStream
A B
Example of NFA
A B? C D
TAKE TAKE
TAKE
PROCEED
IGNORE IGNORE IGNORE
TAKE
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
EventsStream
Example of NFA
A
A
B?
A
B
A
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
EventsStream
Example of NFA
A B? C D
TAKE TAKE
TAKE
PROCEED
IGNORE IGNORE IGNORE
TAKE
A B
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
EventsStream
Example of NFA
A
A
B?
A
B
A
C
B?
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
EventsStream
Example of NFA
A B? C D
TAKE TAKE
TAKE
PROCEED
IGNORE IGNORE IGNORE
TAKE
A B C
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
EventsStream
Example of NFA
A
A
B?
A
B
A
C
B?
D
B?
A
C
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
EventsStream
Example of NFA
A B? C D
TAKE TAKE
TAKE
PROCEED
IGNORE IGNORE IGNORE
TAKE
A B C
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
EventsStream
Example of NFA
A
A
B?
A
B
A
C
B?
D
B?
D
A
C
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
EventsStream
Example of NFA
A
A
B?
A
B
A
C
B?
D
B?
D
A
C D
Match: A, C, D
B?
Match: A, B, C, D
A
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
Nondeterminism
■ When?
● OneOrMore
● Times
● FollowedByAny
● Optional
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
Nondeterminism
■ When?
● OneOrMore
● Times
● FollowedByAny
● Optional
■ What to do?
● Within - restrict by time
● Until - restrict by event
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
What brings the future?
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
SQL Integration - Flink 6935
select orderId
from events
MATCH_RECOGNIZE (
PARTITION BY userId
MEASURES A.orderId
PATTERN (A B)
DEFINE
A AS (A.type = “order”),
B AS (B.type = “payment”
and B.orderId = A.orderId)
) as its
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
Dynamic Patterns - Flink 7129
DataStream
Events Source e.g.
CEP
DataStream
Pattern
DataStream
Patterns Source e.g.
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
Dynamic Patterns - Flink 7129
DataStream
Events Source e.g.
CEP
DataStream
Pattern
DataStream
Patterns Source e.g.
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
FlinkCEP
■ Pattern detection
■ CEP engine with the rest of Flink
■ What to expect:
● Dynamic patterns - FLINK-7129
● SQL’s MATCH_RECOGNIZE - FLINK-6935
© Copyright. All rights reserved. Not to be reproduced without prior written consent.
FlinkCEP
■ Pattern detection
■ CEP engine with the rest of Flink
■ What to expect:
● Dynamic patterns - FLINK-7129
● SQL’s MATCH_RECOGNIZE - FLINK-6935
● YOUR AD IDEA HERE

More Related Content

PDF
FlinkCEP Library - Dawid Wysakowicz, GetInData (WHUG)
PDF
Flink Complex Event Processing
PPTX
Unifying Stream, SWL and CEP for Declarative Stream Processing with Apache Flink
PDF
Fast Data at ING – the why, what and how of the streaming analytics platform ...
PPTX
Cloud Operations with Streaming Analytics using Apache NiFi and Apache Flink
PDF
Streaming analytics better than batch – when and why by Dawid Wysakowicz and ...
PDF
Beyond CRUD: patterns that never forget
PPT
Dev Basics: The ASP.NET Page Life Cycle
FlinkCEP Library - Dawid Wysakowicz, GetInData (WHUG)
Flink Complex Event Processing
Unifying Stream, SWL and CEP for Declarative Stream Processing with Apache Flink
Fast Data at ING – the why, what and how of the streaming analytics platform ...
Cloud Operations with Streaming Analytics using Apache NiFi and Apache Flink
Streaming analytics better than batch – when and why by Dawid Wysakowicz and ...
Beyond CRUD: patterns that never forget
Dev Basics: The ASP.NET Page Life Cycle

Similar to Flink Forward Berlin 2017: Dawid Wysakowicz - Looking for patterns with Flink CEP library (20)

PDF
Seaside - Why should you care? (OSDC.fr 2010)
PDF
Designing Events-First Microservices For A Cloud Native World
PDF
Streaming analytics better than batch when and why - (Big Data Tech 2017)
PDF
elasticsearch X react
PDF
Concurrecny inf sharp
PDF
Agile + DevOps Keynote - The Evolution of a Continuous Integration Pipeline
PDF
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
PDF
Genn.ai introduction for Buzzwords
PDF
OSDC 2019 | The Benefits of Orchestration in Distributed Systems by Niall Deehan
PDF
Tyler Wright - Undo History with Flight
PDF
Building time machine with .net core
PDF
Bill Scott Presentation
PPTX
Page life cycle IN ASP.NET
PDF
Drinking from the firehose, with virtual streams and virtual actors
PPTX
Using Event Streams in Serverless Applications
PPTX
Andrii Dembitskyi "Events in our applications Event bus and distributed systems"
PPTX
Adobe analytics implementation secret hacks
PDF
Adtech scala-performance-tuning-150323223738-conversion-gate01
PDF
Adtech x Scala x Performance tuning
PDF
Rhf2019 how totackle barriersofapplicationmodernization_ap16_en
Seaside - Why should you care? (OSDC.fr 2010)
Designing Events-First Microservices For A Cloud Native World
Streaming analytics better than batch when and why - (Big Data Tech 2017)
elasticsearch X react
Concurrecny inf sharp
Agile + DevOps Keynote - The Evolution of a Continuous Integration Pipeline
Kostiantyn Yelisavenko "Mastering Macro Benchmarking in .NET"
Genn.ai introduction for Buzzwords
OSDC 2019 | The Benefits of Orchestration in Distributed Systems by Niall Deehan
Tyler Wright - Undo History with Flight
Building time machine with .net core
Bill Scott Presentation
Page life cycle IN ASP.NET
Drinking from the firehose, with virtual streams and virtual actors
Using Event Streams in Serverless Applications
Andrii Dembitskyi "Events in our applications Event bus and distributed systems"
Adobe analytics implementation secret hacks
Adtech scala-performance-tuning-150323223738-conversion-gate01
Adtech x Scala x Performance tuning
Rhf2019 how totackle barriersofapplicationmodernization_ap16_en
Ad

More from Flink Forward (20)

PDF
Building a fully managed stream processing platform on Flink at scale for Lin...
PPTX
Evening out the uneven: dealing with skew in Flink
PPTX
“Alexa, be quiet!”: End-to-end near-real time model building and evaluation i...
PDF
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
PDF
Introducing the Apache Flink Kubernetes Operator
PPTX
Autoscaling Flink with Reactive Mode
PDF
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...
PPTX
One sink to rule them all: Introducing the new Async Sink
PPTX
Tuning Apache Kafka Connectors for Flink.pptx
PDF
Flink powered stream processing platform at Pinterest
PPTX
Apache Flink in the Cloud-Native Era
PPTX
Where is my bottleneck? Performance troubleshooting in Flink
PPTX
Using the New Apache Flink Kubernetes Operator in a Production Deployment
PPTX
The Current State of Table API in 2022
PDF
Flink SQL on Pulsar made easy
PPTX
Dynamic Rule-based Real-time Market Data Alerts
PPTX
Exactly-Once Financial Data Processing at Scale with Flink and Pinot
PPTX
Processing Semantically-Ordered Streams in Financial Services
PDF
Tame the small files problem and optimize data layout for streaming ingestion...
PDF
Batch Processing at Scale with Flink & Iceberg
Building a fully managed stream processing platform on Flink at scale for Lin...
Evening out the uneven: dealing with skew in Flink
“Alexa, be quiet!”: End-to-end near-real time model building and evaluation i...
Introducing BinarySortedMultiMap - A new Flink state primitive to boost your ...
Introducing the Apache Flink Kubernetes Operator
Autoscaling Flink with Reactive Mode
Dynamically Scaling Data Streams across Multiple Kafka Clusters with Zero Fli...
One sink to rule them all: Introducing the new Async Sink
Tuning Apache Kafka Connectors for Flink.pptx
Flink powered stream processing platform at Pinterest
Apache Flink in the Cloud-Native Era
Where is my bottleneck? Performance troubleshooting in Flink
Using the New Apache Flink Kubernetes Operator in a Production Deployment
The Current State of Table API in 2022
Flink SQL on Pulsar made easy
Dynamic Rule-based Real-time Market Data Alerts
Exactly-Once Financial Data Processing at Scale with Flink and Pinot
Processing Semantically-Ordered Streams in Financial Services
Tame the small files problem and optimize data layout for streaming ingestion...
Batch Processing at Scale with Flink & Iceberg
Ad

Recently uploaded (20)

PDF
Votre score augmente si vous choisissez une catégorie et que vous rédigez une...
PPTX
DS-40-Pre-Engagement and Kickoff deck - v8.0.pptx
PDF
A biomechanical Functional analysis of the masitary muscles in man
PDF
Global Data and Analytics Market Outlook Report
PDF
Microsoft Core Cloud Services powerpoint
PPTX
CHAPTER-2-THE-ACCOUNTING-PROCESS-2-4.pptx
PPTX
IMPACT OF LANDSLIDE.....................
PPTX
eGramSWARAJ-PPT Training Module for beginners
PDF
Best Data Science Professional Certificates in the USA | IABAC
PPTX
chuitkarjhanbijunsdivndsijvndiucbhsaxnmzsicvjsd
PPTX
Copy of 16 Timeline & Flowchart Templates – HubSpot.pptx
PPTX
CYBER SECURITY the Next Warefare Tactics
PPT
statistic analysis for study - data collection
PPTX
1 hour to get there before the game is done so you don’t need a car seat for ...
PPT
DU, AIS, Big Data and Data Analytics.ppt
PPTX
Machine Learning and working of machine Learning
PPTX
Phase1_final PPTuwhefoegfohwfoiehfoegg.pptx
PPTX
MBA JAPAN: 2025 the University of Waseda
PPTX
Business_Capability_Map_Collection__pptx
PDF
Microsoft 365 products and services descrption
Votre score augmente si vous choisissez une catégorie et que vous rédigez une...
DS-40-Pre-Engagement and Kickoff deck - v8.0.pptx
A biomechanical Functional analysis of the masitary muscles in man
Global Data and Analytics Market Outlook Report
Microsoft Core Cloud Services powerpoint
CHAPTER-2-THE-ACCOUNTING-PROCESS-2-4.pptx
IMPACT OF LANDSLIDE.....................
eGramSWARAJ-PPT Training Module for beginners
Best Data Science Professional Certificates in the USA | IABAC
chuitkarjhanbijunsdivndsijvndiucbhsaxnmzsicvjsd
Copy of 16 Timeline & Flowchart Templates – HubSpot.pptx
CYBER SECURITY the Next Warefare Tactics
statistic analysis for study - data collection
1 hour to get there before the game is done so you don’t need a car seat for ...
DU, AIS, Big Data and Data Analytics.ppt
Machine Learning and working of machine Learning
Phase1_final PPTuwhefoegfohwfoiehfoegg.pptx
MBA JAPAN: 2025 the University of Waseda
Business_Capability_Map_Collection__pptx
Microsoft 365 products and services descrption

Flink Forward Berlin 2017: Dawid Wysakowicz - Looking for patterns with Flink CEP library

  • 1. © Copyright. All rights reserved. Not to be reproduced without prior written consent.
  • 2. © Copyright. All rights reserved. Not to be reproduced without prior written consent. About me ■ Data Engineer at GetInData ■ Apache Flink Committer ■ Involved in Flink CEP library development Dawid Wysakowicz @dwysakowicz
  • 3. © Copyright. All rights reserved. Not to be reproduced without prior written consent. CEP engines’ features ■ Event-pattern detection ■ Event abstraction ■ Event filtering ■ Event aggregation and transformation ■ Modeling event hierarchies ■ Detecting relationships (such as causality, membership or timing) between events ■ Abstracting event-driven processes David C. Luckham. 2001. The Power of Events: An Introduction to Complex Event Processing in Distributed Enterprise Systems. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA. Opher Etzion and Peter Niblett. 2010. Event Processing in Action (1st ed.). Manning Publications Co., Greenwich, CT, USA.
  • 4. © Copyright. All rights reserved. Not to be reproduced without prior written consent. CEP engines’ features ■ Event-pattern detection ■ Event abstraction ■ Event filtering ■ Event aggregation and transformation ■ Modeling event hierarchies ■ Detecting relationships (such as causality, membership or timing) between events ■ Abstracting event-driven processes FlinkCEP
  • 5. © Copyright. All rights reserved. Not to be reproduced without prior written consent. CEP engines’ features ■ Event-pattern detection ■ Event abstraction ■ Event filtering ■ Event aggregation and transformation ■ Modeling event hierarchies ■ Detecting relationships (such as causality, membership or timing) between events ■ Abstracting event-driven processes FlinkCEP Flink ecosystem
  • 6. © Copyright. All rights reserved. Not to be reproduced without prior written consent.
  • 7. © Copyright. All rights reserved. Not to be reproduced without prior written consent. Buying Home Insurance Online Property Info Offer Accept General Terms of Contract PaymentScope Change Info Change
  • 8. © Copyright. All rights reserved. Not to be reproduced without prior written consent. Simple Example - Matching Payments Notify whenever a payment for accepted offer arrives
  • 9. © Copyright. All rights reserved. Not to be reproduced without prior written consent. Patterns Pattern .begin("Offer accepted") .subtype(OfferAccepted.class) .where(...) .or(...) .followedBy("Payment received") .subtype(Payment.class) .where(...) .where(...) Basic building blocks
  • 10. © Copyright. All rights reserved. Not to be reproduced without prior written consent. Conditions Pattern .begin("Offer accepted") .subtype(OfferAccepted.class) .where(...) .or(...) .followedBy("Payment received") .subtype(Payment.class) .where(...) .where(...) Basic building blocks Condition specification
  • 11. © Copyright. All rights reserved. Not to be reproduced without prior written consent. Pattern succession Pattern .begin("Offer accepted") .subtype(OfferAccepted.class) .where(...) .or(...) .followedBy("Payment received") .subtype(Payment.class) .where(...) .where(...) Basic building blocks Condition specification Pattern succession
  • 12. © Copyright. All rights reserved. Not to be reproduced without prior written consent. Time Restrictions Pattern .begin("Offer accepted") .subtype(OfferAccepted.class) .where(...) .or(...) .followedBy("Payment received") .subtype(Payment.class) .where(...) .where(...) .within(Time.seconds(3)) Basic building blocks Condition specification Time restrictions Pattern succession
  • 13. © Copyright. All rights reserved. Not to be reproduced without prior written consent. Image source: “Continuous Analytics: Stream Query Processing in Practice”, Michael J Franklin, Professor, UC Berkley, Dec 2009 and http://www.slideshare.net/JoshBaer/shortening-the-feedback-loop-big-data-spain-external
  • 14. © Copyright. All rights reserved. Not to be reproduced without prior written consent. ■ followedBy Consuming Strategy
  • 15. © Copyright. All rights reserved. Not to be reproduced without prior written consent. ■ followedBy ■ next Consuming Strategy
  • 16. © Copyright. All rights reserved. Not to be reproduced without prior written consent. ■ followedBy ■ next ■ notFollowedBy Consuming Strategy
  • 17. © Copyright. All rights reserved. Not to be reproduced without prior written consent. ■ followedBy ■ next Consuming Strategy ■ notFollowedBy
  • 18. © Copyright. All rights reserved. Not to be reproduced without prior written consent. ■ Skip till next ■ Strict continuity ■ Skip till any ■ Not follow ■ Not next See more: https://ci.apache.org/projects/flink/flink-docs-release-1.3/dev/libs/cep.html#conditions-on-contiguity https://www.slideshare.net/DawidWysakowicz/flink-complex-event-processing Consuming Strategy
  • 19. © Copyright. All rights reserved. Not to be reproduced without prior written consent. Looping Example How many offer changes before accepting? ... ?
  • 20. © Copyright. All rights reserved. Not to be reproduced without prior written consent. Quantifiers Pattern .begin("start") .subtype(Event.class) .where(...) .or(...) .times(3) .followedBy("next") .subtype(Event.class) .where(...) .where(...) .oneOrMore().optional() .within(Time.seconds(3)) Quantifier application Basic building blocks Condition specification Time restrictions Pattern succession
  • 21. © Copyright. All rights reserved. Not to be reproduced without prior written consent.
  • 22. © Copyright. All rights reserved. Not to be reproduced without prior written consent. Nondeterministic Finite Automaton ■ Graph where: ● Vertices = States ● Edges = Transitions ■ IGNORE - event not consumed ■ TAKE - event consumed ■ PROCEED - event analyzed in the target state
  • 23. © Copyright. All rights reserved. Not to be reproduced without prior written consent. Example of NFA Pattern .begin(“A”) .followedByAny(“B”).optional() .next(“C”) .followedBy(“D”)
  • 24. © Copyright. All rights reserved. Not to be reproduced without prior written consent. Example of NFA A B? C D TAKE (A) TAKE (C) TAKE (B) PROCEED (TRUE) IGNORE (TRUE) IGNORE (TRUE) IGNORE (not D) TAKE (D) Pattern .begin(“A”) .followedByAny(“B”).optional() .next(“C”) .followedBy(“D”)
  • 25. © Copyright. All rights reserved. Not to be reproduced without prior written consent. EventsStream Example of NFA A
  • 26. © Copyright. All rights reserved. Not to be reproduced without prior written consent. EventsStream Example of NFA A B? C D TAKE TAKE TAKE PROCEED IGNORE IGNORE IGNORE TAKE A
  • 27. © Copyright. All rights reserved. Not to be reproduced without prior written consent. EventsStream Example of NFA A A B? A
  • 28. © Copyright. All rights reserved. Not to be reproduced without prior written consent. EventsStream A B Example of NFA A B? C D TAKE TAKE TAKE PROCEED IGNORE IGNORE IGNORE TAKE
  • 29. © Copyright. All rights reserved. Not to be reproduced without prior written consent. EventsStream Example of NFA A A B? A B A
  • 30. © Copyright. All rights reserved. Not to be reproduced without prior written consent. EventsStream Example of NFA A B? C D TAKE TAKE TAKE PROCEED IGNORE IGNORE IGNORE TAKE A B
  • 31. © Copyright. All rights reserved. Not to be reproduced without prior written consent. EventsStream Example of NFA A A B? A B A C B?
  • 32. © Copyright. All rights reserved. Not to be reproduced without prior written consent. EventsStream Example of NFA A B? C D TAKE TAKE TAKE PROCEED IGNORE IGNORE IGNORE TAKE A B C
  • 33. © Copyright. All rights reserved. Not to be reproduced without prior written consent. EventsStream Example of NFA A A B? A B A C B? D B? A C
  • 34. © Copyright. All rights reserved. Not to be reproduced without prior written consent. EventsStream Example of NFA A B? C D TAKE TAKE TAKE PROCEED IGNORE IGNORE IGNORE TAKE A B C
  • 35. © Copyright. All rights reserved. Not to be reproduced without prior written consent. EventsStream Example of NFA A A B? A B A C B? D B? D A C
  • 36. © Copyright. All rights reserved. Not to be reproduced without prior written consent. EventsStream Example of NFA A A B? A B A C B? D B? D A C D Match: A, C, D B? Match: A, B, C, D A
  • 37. © Copyright. All rights reserved. Not to be reproduced without prior written consent. Nondeterminism ■ When? ● OneOrMore ● Times ● FollowedByAny ● Optional
  • 38. © Copyright. All rights reserved. Not to be reproduced without prior written consent. Nondeterminism ■ When? ● OneOrMore ● Times ● FollowedByAny ● Optional ■ What to do? ● Within - restrict by time ● Until - restrict by event
  • 39. © Copyright. All rights reserved. Not to be reproduced without prior written consent. What brings the future?
  • 40. © Copyright. All rights reserved. Not to be reproduced without prior written consent. SQL Integration - Flink 6935 select orderId from events MATCH_RECOGNIZE ( PARTITION BY userId MEASURES A.orderId PATTERN (A B) DEFINE A AS (A.type = “order”), B AS (B.type = “payment” and B.orderId = A.orderId) ) as its
  • 41. © Copyright. All rights reserved. Not to be reproduced without prior written consent. Dynamic Patterns - Flink 7129 DataStream Events Source e.g. CEP DataStream Pattern DataStream Patterns Source e.g.
  • 42. © Copyright. All rights reserved. Not to be reproduced without prior written consent. Dynamic Patterns - Flink 7129 DataStream Events Source e.g. CEP DataStream Pattern DataStream Patterns Source e.g.
  • 43. © Copyright. All rights reserved. Not to be reproduced without prior written consent. FlinkCEP ■ Pattern detection ■ CEP engine with the rest of Flink ■ What to expect: ● Dynamic patterns - FLINK-7129 ● SQL’s MATCH_RECOGNIZE - FLINK-6935
  • 44. © Copyright. All rights reserved. Not to be reproduced without prior written consent. FlinkCEP ■ Pattern detection ■ CEP engine with the rest of Flink ■ What to expect: ● Dynamic patterns - FLINK-7129 ● SQL’s MATCH_RECOGNIZE - FLINK-6935 ● YOUR AD IDEA HERE