Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu...
-
Upload
mariah-hawkins -
Category
Documents
-
view
216 -
download
0
Transcript of Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu...
Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath,
{jung,hatcliff,rvprasad}@cis.ksu.eduDepartment of Computing and Information
SciencesKansas State University
A Correlation Framework for the CORBA Component
Model
Current Component Frameworks
EJB (Enterprise Java Beans) Bonobo (Gnome Desktop Framework, e.g.
debian-Linux) KOM, KParts (KDE Desktop Framework) Boldstroke, Prism (Boeing Company) AADL (Avionics Architecture Description
Language, Honeywell et al.) SCA, JTRS (Software Communications
Architecture, Joint Tactical Radio System) CCM (CORBA Component Model)
Component ArchitectureJava
C++ C
C++Java
C
Middleware Layer
Loosely coupled entities:components
Loosely coupled entities:components
Infrastructure layerlocated between
applications and OS:Middleware
Infrastructure layerlocated between
applications and OS:Middleware
Middleware LayerEvent Service Transaction Service
Naming Service Synchronization Service
Heavily relying onevents as major mean
of communication
Heavily relying onevents as major mean
of communication
Component-based Design
CCMComponent
Input event port
Outputevent port
EventPorts
Require aninterface
Provide an interface
Interface Ports
A software component is a unit of compositionwith contractually specified interfaces andexplicit context dependencies only. ASoftware component can be deployedindependently and is subject to compositionby third parties. --Szyperski. Component Software. 2nd ed. p. 195
A software component is a unit of compositionwith contractually specified interfaces andexplicit context dependencies only. ASoftware component can be deployedindependently and is subject to compositionby third parties. --Szyperski. Component Software. 2nd ed. p. 195
Component-based Design
Component IntegrationComponent Integration…up to 1000+ components
Middleware-based Implementation
Event channel
Middleware-based Implementation
Event channelAbstractly…Abstractly…
produceproduce
consumeconsume
Middleware-based Implementation
Event channel
produceproduce
In reality…In reality…
ProxyConsumer …
consumerreferences
consumerreferences
proxyproxy
timer/thread pool
ProxySupplier
filteringnetwork
filteringnetwork
… … … …
threadingthreading
proxyproxy
queuingqueuing
dispatchdispatch
multiplexingmultiplexing
consumeconsume
b
Challenges of Event Communication
Component C is receiving from two components A and B
A and B send at different rates
C needs both inputs to become active
Consider the following situation:
a
C
A
B
ab
b
Challenges of Event Communication
We can: Reduce network
traffic Simplify computation
inside the component
Clarify the design Define the
components in a more general way
Consider the following situation:
a
ab C
A
B
a + b
If we addcorrelations to
the infrastructure
If we addcorrelations to
the infrastructure
What is a Correlation
“Event correlation is a process where a stream of primitive events is processed in order to detect composite events that correspond to event patterns in the event stream.”
-- Unix-Manpage of SEC 2.2.0http://kodu.neti.ee/~risto/sec/
But there is more!
What is a Correlation
A stream of primitive events (e.g. a, b) The detection of composite events (ab) Done according to event patterns (a+b)
According to this definition we have:
The performing of an action upon detection of a desired pattern in the input stream.
Previous Correlation Frameworks
GEM (Mansouri-Samani, Sloman, Generalized Event Monitoring language)
Event Correlation (Sankaranarayanan, Simpa, Zhang, Dill, Manna)
Reflex (Louvau, Chen, Jackson, Devanbu, Gertz, http://reflex.cs.ucdavis.edu/)
SEC (Risto Vaarandi, Simple Event Correlator, http://kodu.neti.ee/~risto/sec/)
Previous Correlation Frameworks
In GEM, Event Correlation, and Reflex events are tuples of attributes:
{number=3, source=“GPSModule”, color=green, …}
Single events are matched against boolean expressions over the attributes
(color == red)|(color == mauve)SEC uses regular expressions to match
single events in the input stream (Unix file-stream)
Events are combined by operators or policies or rules into compound events.
Events in CCM
In Previous Frameworks Event attributes serve
as characteristics rather than data containers
These characteristics identify the event
In a CCM environment
Event attributes carry runtime data
An event is identified by the port it comes from
In CCM events are more complex!
Events in CCM are Asynchronous Messages
In a component architecture we need toenhance the idea of correlations to handle
Content Data.
In a component architecture we need toenhance the idea of correlations to handle
Content Data.
Summary
Component systems are used in many different areas
We can improve design and efficiency of component systems by adding correlations
Previous frameworks are tailored at monitoring, they do not take into account payload
Information about: which events arrived what data is present
The Two-Phase Model
Conceptually, the correlator divides into two distinct phases:
1. The Filter2. The Transformere1 e3 e1 e2 e2
Stream of incoming events
Filter
Transformereout eout
Information about: which events arrived what data is present
Generates new output events
Detection ofevent patterns
Reacting to adetected pattern
And performs internal actions
Transformer
Filter
General Outline of the Correlator
type correlation name (type name, type name, …) filter-expression { transformer- specification }
type correlation name (type name, type name, …) filter-expression { transformer- specification }
We specify a correlator as follows:
A correlation has an outputtype, and an identifier naming
the correlation.
A correlation has an outputtype, and an identifier naming
the correlation.A list of typed names specifies
the types of all input portsconnected to this correlation
A list of typed names specifiesthe types of all input portsconnected to this correlation
The filter is specified byan expression
denoting what patternsare to be detected
The filter is specified byan expression
denoting what patternsare to be detected
A set of rules specifiesthe actions to be taken
whenever a pattern occurs
A set of rules specifiesthe actions to be taken
whenever a pattern occurs
FilterFilter
TransformerTransformer
The Filter
Listens to named, typed ports.(τ1 n1, τ2 n2, τ3 n3, …)
The names are used in an expression. This expression is constructed over a set of combinators.
(n1 + n2) | n3 ; n2
Labels can be used to identify subexpressions.
l1:(n1 + n2) | l2:n3 ; n2
The Filter: Semantics
The Basic Match:A stream of incoming events
s = e1...en
of events e1, …, en matches a singleton
expression a, iff an event a is in s, i.e.there is an i, 1 ≤ i ≤ n, such that
ei = a.
d a c c b a a d a b c
The Filter: Combinators
Accumulation: b + c
d a c c b a a d a b c
match!match!
The Filter: Combinators
Accumulation: b + c Sequence: b ; c
d a c c b a a d a b c
match!match!
match!match!
The Filter: Combinators
Accumulation: b + c Sequence: b ; c Collection: b | c
d a c c b a a d a b c
match!match!
match!match!
match!match!
The Filter: Combinators
Accumulation: b + c Sequence: b ; c Collection: b | c A more complex expression:
(a ; b | d) + (d ; c + b)
d a c c b a a d a b c
match!match!
match!match!
match!match!
match!match!
The Filter: Semantics
When we inspect the stream of incoming events, we want to react at the first instant where a pattern is complete
We define the shortest match to specify a complete pattern
The shortest match then serves to identify the instant then the correlator triggers.
The Filter: Semantics
The Shortest Match A stream s matches an expression x, but no proper prefix of s matches x.
d c d a b c a b c
Example: (a + b) | (a + c)
Shortest Match
The Filter: Semantics
The Trigger A shortest match is a trigger if it
does not overlap with a previous trigger
Example: a ; b ; ab a b b a b a a b b a b b b a b a
We call this behavior Reset Semantics
triggertriggernot a triggernot a trigger
triggertriggernot a triggernot a trigger
triggertrigger
The Filter: Result
Consider the following filter expression:
(a + b) | (a + c)
And the following streams:
a b a a c c …
a c a b b a …
c b b c a a …
matches: a + b
matches: a + c
matches: a + band a + c
Subexpressions which are matchedby the current trigger are called
active.
Subexpressions which are matchedby the current trigger are called
active.
The Filter: Result
(a + b) | (a + c)
And again the streams:
a b a a c c …
a c a b b a …
c b b c a a …
subexpression at l1
subexpression at l2
subexpressions atl1 and l2
l1:(a + b) | l2:(a + c)
Adding Labels to the expressionAdding Labels to the expressionLabels attached to active subexpressionsare called active.
Labels attached to active subexpressionsare called active.
The Filter: Result
Labels are the connection between filter and transformer
Active labels identify the subpatterns which are present in the input
The level of detail can be chosen easily
Result of the filter is theset of active labels
The Filter: Summary The filter detects patterns in the input
stream. Patterns are specified by labeled
expressions over the combinators +, |, ; (and on top level the parallel operator ||).
The correlator triggers on a complete shortest match.
Result of the evaluation is the set of active labels.
Note that it is easy to build an acceptor for a given filter expression, since they describe a subset of regular languages.
General Outline of the Correlator
type correlation name (type name, type name, …) filter-expression { transformer- specification }
type correlation name (type name, type name, …) filter-expression { transformer- specification }
We specify a correlation as follows:
The Transformer: Outline
{
case l1:push b
case l2:push new Notify { timeStamp := c.timeStamp}
case !l1 & !l2:}
List of action clausesList of action clauses
Guarded by booleanexpressions over labels
Guarded by booleanexpressions over labels
Events can be forwardedinput events
Events can be forwardedinput events
Or they can be new events constructedfrom the payload of input events
Or they can be new events constructedfrom the payload of input events
Each clause contains zero or moreactions, e.g. the emission of an
event (push)
Each clause contains zero or moreactions, e.g. the emission of an
event (push)
The Transformer: Example 1
Consider the filter expression:l1:(a + b) | l2:(a + c)
Option 1:
case l1: push new NavData {air = a.air, nav = b.nav}case l2: push new NavData {air = a.air, nav = c.nav}
case l1: push new NavData {air = a.air, nav = b.nav}case l2: push new NavData {air = a.air, nav = c.nav}
abacbca
Note that all clauses withsatisfied guard are executed
Note that all clauses withsatisfied guard are executed
case l1: push new NavData {air = a.air, nav = b.nav}case l2 & !l1: push new NavData {air = a.air, nav = c.nav}
case l1: push new NavData {air = a.air, nav = b.nav}case l2 & !l1: push new NavData {air = a.air, nav = c.nav}
The Transformer: Example 1
Consider the filter expression:l1:(a + b) | l2:(a + c)
Option 2:acbcaab
The Transformer: Example 1
Consider the filter expression:l1:(a + b) | l2:(a + c)
Option 3:
case true: push new DataAvailable {}
case true: push new DataAvailable {}
acbcaab
The Transformer: Example 2
We consider three subexpressions x1, x2, x3. x3 shall not interleave between x1 and x2.
x1 ; (l2:x2 | l3:x3)case l2: push new success-event
case l2: push new success-eventcase l3: push new error-event
case l3: push new error-eventcase l2: push new success-eventcase l3: push new error-event
case l2: push new success-eventcase l3: push new error-event
Previous approaches offer a specific,distinct construct to express interleaving(e.g. {e1;e2}!e3 in GEM, fail{do{φ1}unless{φ2}} in Event Correlation)Due to the two-phase model a specificoperator for interleaving is not necessary.
Previous approaches offer a specific,distinct construct to express interleaving(e.g. {e1;e2}!e3 in GEM, fail{do{φ1}unless{φ2}} in Event Correlation)Due to the two-phase model a specificoperator for interleaving is not necessary.
The Transformer: Summary
Boolean expressions over the active labels allow a flexible and versatile mean to fine-tune the reactions to occurring patterns
Being a communication device, the correlator can rearrange data into new events, but does no computation
Using data from incoming events, new events can be constructed, which match the type the receiving component expects
Dynamic Adaption
Consider an array of redundant componentsA1, A2, …, An.
and a single receiving component B, interested in the accumulation of all events
a1, a2, …, an.
The filter expression is thena1 + a2 + … + an
An
A3A2
…
A1 +B
Dynamic Adaption: Rationale
a1 + a2 + … + an
In a component system some components
can be temporarily unavailable!If one component does not send anymore
the whole pattern is never satisfied!
An
A3A2
…
A1 +B
We want to be able to adapt thepattern detection to this new situation.
We want to be able to adapt thepattern detection to this new situation.
Dynamic Adaption: Idea
Again, we use labels:l1:a1 + … + li:ai + … + ln:an
Assume e.g. component Ai becoming unavailable.
We want to “switch off” the corresponding subexpression
An
Ai
A1 +B…
…
For this we introduce the notion oflabels and their respective subexpressions
of being enabled or disabled
For this we introduce the notion oflabels and their respective subexpressions
of being enabled or disabled
Dynamic Adaption: Syntax
We add the following commands to the transformer syntax:
abort label,revive label,toggle label.
abort disables a label,revive re-enables a label, and
consequentlytoggle switches the status of a label.
Dynamic Adaption: Semantics
Intuitively, a disabled subexpression is simply omitted
l0 disabled: Filter: l0:x0 ● x1 ≡ x1
x1 ● l0:x0 ≡ x1 (for ● in {+,|,;,||}) Guard: l0 ♦ e ≡ e
e ♦ l0 ≡ e!l0 ♦ e ≡ ee ♦ !l0 ≡ e (for ♦ in {&,|})
An
A3A2
…
A1
Dynamic Adaption: ExampleNotify correlation SensorArray (Notify a1, …, Notify an, Control c1, …, Control cn)l1:a1 + … + ln:an || m1:c1 || … || mn:cn
{ case l1 & … & ln: push new Notify {} case m1: toggle l1 …case mn: toggle ln
}
Sensor
Array
B
C
Dynamic Adaption: Summary
Labels do not only serve as carrier from the filter to the transformer, the transformer can also communicate back changes to the filter
We can arbitrarily switch on and off subexpressions in the filter as well as in the guards inside the transformer
Standard tasks such as temporarily omitting input are easily specified
Synopsis
We presented a correlation service suitable to handle the requirements of component based systems
The specification of a correlator is intuitive and simple, but with a strict background
The correlation framework is implemented and used in and will probably be introduced into Prism