46
Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State University A Correlation Framework for the CORBA Component Model

Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

Embed Size (px)

Citation preview

Page 1: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 2: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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)

Page 3: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 4: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 5: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

Component-based Design

Component IntegrationComponent Integration…up to 1000+ components

Page 6: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

Middleware-based Implementation

Event channel

Page 7: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

Middleware-based Implementation

Event channelAbstractly…Abstractly…

produceproduce

consumeconsume

Page 8: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 9: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 10: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 11: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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/

Page 12: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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.

Page 13: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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/)

Page 14: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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.

Page 15: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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.

Page 16: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 17: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 18: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 19: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 20: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 21: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

The Filter: Combinators

Accumulation: b + c

d a c c b a a d a b c

match!match!

Page 22: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

The Filter: Combinators

Accumulation: b + c Sequence: b ; c

d a c c b a a d a b c

match!match!

match!match!

Page 23: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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!

Page 24: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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!

Page 25: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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.

Page 26: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 27: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 28: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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.

Page 29: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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.

Page 30: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 31: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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.

Page 32: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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:

Page 33: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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)

Page 34: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 35: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 36: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 37: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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.

Page 38: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 39: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 40: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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.

Page 41: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 42: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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.

Page 43: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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 {&,|})

Page 44: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 45: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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

Page 46: Georg Jung, John Hatcliff, Venkatesh Prasad Ranganath, {jung,hatcliff,rvprasad}@cis.ksu.edu Department of Computing and Information Sciences Kansas State

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