A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004
description
Transcript of A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004
![Page 1: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/1.jpg)
1
A Framework for Event Composition in Distributed Systems
Christian Hälg,15.6.2004
By Peter R. Pietzuch, Brian Shand, and Jean Bacon
![Page 2: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/2.jpg)
2
Overview
Introduction Events and Pub/Sub systems Example Motivation
Composite Event Detection Model and composition language Mobile Composite Event Detectors Policies
Conclusion
![Page 3: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/3.jpg)
3
Introduction
Events Something has happend Modelled as an object
Publish/Subscribe Systems „Proxy“ for events Decoupling space, time and synchronization JMS, JORAM Gryphon (IBM)
used at Sydney Olympics, US Tennis Open,…
![Page 4: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/4.jpg)
4
Introduction (2)
Interface of a Pub/Sub System:
![Page 5: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/5.jpg)
5
Example – Pub/Sub System
Sources: produce events of type e,f and g.
Client A: subscribed for events of type e,f,g and is interested to know, whether they occured in a sequence c1 = (e ; f ; g)
Client B: subscribed for events of type e and g and is interested to know, whether they occured within a 5 minute time interval. c2 = (e,g)T=5min
![Page 6: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/6.jpg)
6
Example – Pub/Sub System (2)
![Page 7: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/7.jpg)
7
Example – Pub/Sub System (3)
A lot of events are sent to the clients over low bandwidth connections.
Detection of patterns left to the client applications
![Page 8: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/8.jpg)
8
Example - Pub/Sub Systemand CE detector (4)
Pub/Sub system is extended with a Composite Event (CE) Detector
Client A: subscribes for CE c1 = (e ; f ; g) (Sequence)
Client B: subscribes for CE c2 = (e, g)T=5min
![Page 9: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/9.jpg)
9
Example - Pub/Sub Systemand CE detector (5)
![Page 10: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/10.jpg)
10
Example - Pub/Sub Systemand CE detector (6)
Less traffic between Pub/Sub System and the clients.
Client doesn‘t have to care about detection of (probably) complex event-patterns.
![Page 11: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/11.jpg)
11
Motivation
Abstraction of Events Composition of atomic events CE represented as a new atomic event Composition of CE
Reduction of bandwidth usage
![Page 12: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/12.jpg)
12
Composite Event (CE) Detection
Result: CE Detection Framework Regular language for CE specification Compiler translates the „core CE language“
into detectors Realised as finite automata
Assumptions on infrastructure1. An underlying Pub/Sub System
2. Events carry a timestamp, denoted by an time interval
![Page 13: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/13.jpg)
13
Composite Event (CE) Detection (2)
„strong“ order:
„weak“ order: 321 ttt
Time Model:
Blow
Ahigh tt
Blow
Alow
Bhigh
Ahigh
Bhigh
Ahigh tttttt
)31()21( tttt
![Page 14: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/14.jpg)
14
Composite Event (CE) Detection (3)
0
S0
Inital State
1
Ordinary State
2
A;B
Generative State
Generative Time State
T1
3
(1 min)
strong order
transition
weak order
transition
)()(
![Page 15: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/15.jpg)
15
Composite Event (CE) Detection (4)
Continue example:
Client A: c1 = (e;f;g) (sequence of 3 events)
Transformation into automaton:
![Page 16: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/16.jpg)
16
Composite Event (CE) Detection (5)
Client B: c2 = (e, g)T=5min
Transformation into automaton:
![Page 17: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/17.jpg)
17
Distributed Detection
In the example: monolithic system for event detection
Distribute detectors over the network
![Page 18: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/18.jpg)
18
Mobile Composite Event Detectors
Detectors move to „optimal“ site Tradeoff between bandwidth usage and
latency
A Mobile Detector can…factorize CE expressions
instantiate new detectors to reduce own load
migrate to another node to reduce bandwidth usage at bottlenecks
destroy itself if no longer needed
![Page 19: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/19.jpg)
19
Distribution Policy
1. Determine location of a detector.
2. Decide on the degree of decomposition and distribution.
3. Decide on duplication of certain (often used) detectors.
Optimization in terms of bandwidth usage and latency.
![Page 20: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/20.jpg)
20
Detection Policy
When can an input stream of events safely be processed?
Best Effort Detection: events in input stream are consumed without delay.
Guaranteed Detection: consumption of an event in the input stream, if event is stable. stable: An event is stable, if an event of the
same source arrived with a later timestamp.
![Page 21: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/21.jpg)
21
Detection Policy (2) – Problems
What if a source is rarely publishing events? Publish dummy heartbeat events. Load on bandwidth.
What if a source is disconnected?
Research is done on a probabilistic stability measure.
![Page 22: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/22.jpg)
22
Conclusion
System tested on artifical office example Bandwidth usage can be brought down
significantly But no „real world“ test yet
Paper is sloppy concerning the formal definitions
Composite event detection with FSMs isn‘t really new (already done for database trigger events)
![Page 23: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/23.jpg)
23
Conclusion (2)
Contributions Idea of detection of composite events applied
to distributed systems Notion of mobile, decomposable and clonable
detectors
![Page 24: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/24.jpg)
24
Thank You
Questions?
![Page 25: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/25.jpg)
25
Appendix A – Time Model
Events have a timestamp denoted by a time interval t = [tlow,thigh]
Partial Order: Time intervals of event A and B do not overlap A < B iff strong order denoted by a solid arrow in the FSM
Blow
Ahigh tt
![Page 26: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/26.jpg)
26
Appendix A – Time Model (2)
Total Order Time intervals do overlap iff weak order denoted by a dashed arrow in the FSM
BA Blow
Alow
Bhigh
Ahigh
Bhigh
Ahigh tttttt
![Page 27: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/27.jpg)
27
Appendix B – Core CE Language
Atoms: Events {A,B,C,…} in input stream
Negation:
Concatenation: C1C2 (C1 weakly followd by C2)
Sequence: C1;C2 (C1 strongly followed by C2)
Iteration: C1*
Alternation: C1|C2
Timing: (C1,C2)T = timespec.
Parallelisation: C1||C2
]\[][ EE
![Page 28: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/28.jpg)
28
Appendix B – Core CE Language (2)
Brian enters the room followed by Peter
]][][[ BABB
Brian enters the room before Peter
Brian enters and Peter follows within an hour
Someone else enters the room when Brian is away
hTTPPB 11}])1,{[],([
}],{[ PBB
][];[ PB
![Page 29: A Framework for Event Composition in Distributed Systems Christian Hälg, 15.6.2004](https://reader035.fdocuments.in/reader035/viewer/2022062315/56814fb6550346895dbd6dd0/html5/thumbnails/29.jpg)
29
Appendix C - Implementation
Framework built on top of JORAM (Java Open Reliable Asynchronous Messaging), which is a open-source implementation of JMS (Java Message Service).
Download at: http://joram.objectweb.org/ Source of the framework not yet available for
download (but probably soon)