楼主: ReneeBK
856 0

Apply These Techniques to Learn Complex Event Processing with Apache Flink. [推广有奖]

  • 1关注
  • 62粉丝

VIP

学术权威

14%

还不是VIP/贵宾

-

TA的文库  其他...

R资源总汇

Panel Data Analysis

Experimental Design

威望
1
论坛币
49407 个
通用积分
51.8704
学术水平
370 点
热心指数
273 点
信用等级
335 点
经验
57815 点
帖子
4006
精华
21
在线时间
582 小时
注册时间
2005-5-8
最后登录
2023-11-26

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
  1. 1. Objective

  2. This tutorial on Complex Event Processing with Apache Flink will help you in understanding Flink CEP library, how CEP programs are written using Pattern API, various CEP pattern operations with syntax, Pattern detection in CEP and advantages of CEP operations in Flink. You will also learn Flink Complex event processing use cases and examples to get in depth knowledge of complex event processing for Flink.

  3. 2. Introduction to Complex Event Processing with Apache Flink

  4. With the increasing size of data and smart devices continuously collecting more and more data, there is a challenge to analyze this growing stream of data in near real-time for reacting quickly to changing trends or for delivering up to date business intelligence which can decide company’s success or failure. Detection of event patterns in data streams is a key problem in real time processing.

  5. Flink handles this problem through Complex event processing (CEP) library that addresses this problem of matching the incoming events against a pattern to produce complex events which are derived from the input events. CEP executes relevant data on a stored query unlike traditional RDBMSs and discards irrelevant data. This enables CEP queries to be applied on a potentially infinite stream of data and also enables inputs to be processed immediately. This aspect effectively leads to CEP’s real time analytics capability. This gives the opportunity to quickly get hold of what’s really important in data. In this manner, Flink CEP is 1 of the key component of Apache Flink ecosystem.

  6. Apache Flink is a natural fit for CEP workloads due to its true streaming nature and its capabilities for low latency as well as high throughput stream processing. Consequently, CEP has found application in a wide variety of use cases as described below and has provided several features of Apache Flink that has created huge difference between Apache Flink, hadoop and Apache Spark.

  7. 3. Pattern API

  8. Flink CEP program can be written using the pattern API that allows defining complex event patterns. Each pattern consists of multiple stages or states. The pattern needs to start with initial state and then to go from one state to the next, the user can specify conditions. Each state must have a unique name to identify the matched events later on. We can append states to detect complex patterns.

  9. Do you know different pattern operations? Let us see some of the most commonly used CEP pattern operations:

  10. a. Begin

  11. It defines pattern starting state and is written as below:

  12. Pattern<Event, ?> start = Pattern.<Event>begin("start");
  13. b. Next

  14. It appends a new pattern state and matching event need to succeed the previous matching pattern as below:

  15. Pattern<Event, ?> next = start.next("next");
  16. c. FollowedBy

  17. It appends a new pattern state but here other events can occur between 2 matching events as below:

  18. Pattern<Event, ?> followedBy = start.followedBy("next");
  19. d. Where

  20. It defines a filter condition for current pattern state and if the event passes the filter, it can match the state as below:

  21. patternState.where(new FilterFunction <Event>() {
  22. @Override
  23. public boolean filter(Event value) throws Exception {
  24. return ... // some condition
  25. }
  26. });
  27. e. Or

  28. It adds a new filter condition which is ORed with an existing filter condition. Only if an event passes the filter condition, it can match the state.

  29. f. Within

  30. It defines the maximum time interval for an event sequence to match the pattern post which it is discarded. It’s written as below:

  31. patternState.within(Time.seconds(10));
  32. 4. Pattern Detection

  33. We need to create pattern stream to run stream of events as below using input stream and a pattern:

  34. DataStream <Event> input = ...
  35. Pattern <Event, ?> pattern = ...
  36. PatternStream <Event> patternStream = CEP.pattern(input, pattern);
  37. 5. Use cases for Flink CEP

  38. Apache Flink CEP is used for large number of applications like for financial applications such as stock market trend, credit card fraud detection and RFID-based tracking and monitoring. It also find its usage in detecting network intrusion by specifying patterns of suspicious user behaviour.

  39. Refer Flink use case tutorial to get real time use cases of Apache Flink and how industries are using Flink for their various purposes.

  40. 6. Conclusion

  41. Flink CEP includes various challenges like:

  42. Ability to achieve high throughput and low latency processing
  43. Ability to produce the results as soon as the input event stream is available
  44. Ability to provide aggregation over time, timeout between two events of interest and other computations
  45. Ability to provide real time alerts & notifications on detection of complex event patterns
  46. Follow DataFlair on LinkedIn for More Updates on #ApacheFlink #BigData
复制代码


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:Techniques Processing Technique processI Complex Complex

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注jltj
拉您入交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-28 14:52