180 likes | 294 Views
Filters for Composite Events. Susan D. Urban Suzanne Dietrich Yi Chen School of Computing and Informatics Arizona State University. Filtering Features for a Composite Event Definition Language , S. Urban, I. Biswas, S. Dietrich SAINT 2005 (From MS Thesis of I. Biswas).
E N D
Filters for Composite Events Susan D. Urban Suzanne Dietrich Yi Chen School of Computing and Informatics Arizona State University Filtering Features for a Composite Event Definition Language, S. Urban, I. Biswas, S. Dietrich SAINT 2005 (From MS Thesis of I. Biswas) Dagstuhl
Motivation: Composite Events • Composite events are increasingly being used as a communication mechanism to achieve enterprise application integration or business-to-business integration. • Credit Card Application • Monitoring continuous late payments from a customer • Banking Application • Monitoring total withdrawals over a specified period of time • Online Shopping Application • Monitoring purchases or shopping habits of a customer • Filtering is needed to create a meaningful context for transformation, aggregation, and correlation of related events. Dagstuhl
ECA Rules Could be primitive or composite create rule afterSetQtyRule event afterSetQty(qty) on InventoryItem iItem condition immediate when iItem.qty < iItem.threshold and iItem.reorderStatus = "notOrdered" action decoupled do receivePurchaseItems(iItem.itemNo, iItem.code, iItem.reorderQty, iItem.getSupplier()) Dagstuhl
Design of CEDL (Composite Event Definition Language) • Adoption of existing composite event operators • AND, OR, SEQ, TIMES • Adoption of existing consumption modes • Continuous • Latest (Recent) • Commulative • Design of Filtering Capabilities • Time filters • Parameter filters • Filtering of cumulative events • Indexing • Aggregation • Quantifiers • Time-stamping module based on NTP model Dagstuhl
Filtering of Primitive Events filter bigConsignment (status, purchaseOrderId, amount) { afterUpdatePurchaseStatus (String status, String purchaseOrderId, float amount) wherestatus == "complete" andamount >= 100000; } (Can push some rule conditions into event filters to improve rule processing, especially in distributed environments) Dagstuhl
AND Event with Parameter and Time Filters composite freeShipping(loginName) { C: completeOrder(String loginName, String orderId1, float amount1) AND C: completeOrder(String loginName, String orderId2, float amount2) whereorderId1 != orderId2 andamount1 >= 99 andamount2 >= 99 within1 day; } Dagstuhl
OR Event composite notApproved(loginName, errorCode) { aboveCreditLimit(String loginName, String orderId, float amount, String errorCode) OR cardInvalid(String loginName, String errorCode); } Limitations • Can only filter on common event parameters • Cannot compare event parameters • Can only output common event parameters Dagstuhl
SEQ Event with Parameter and Time Filters composite completeOrder(loginName, orderId, amount) { C: afterCheckout(String loginName, String orderId) SEQ L: afterCheckCredit(String loginName, String orderId , float amount, String status) whereamount > 0 andstatus == “OK”; within3 hours; } (Combines multiple consumption modes) Dagstuhl
Times Event with Indexing, Aggregate, and Time Filter composite updateCustomerHistory(loginName) { TIMES(afterCancelOrder(String loginName, String orderId, float amount), 2) for loginName wheresum(amount) > 3000 andorderId(1) != orderId (2) andamount(1) > 99 within8 weeks; } Aggregate : SUM, MIN, MAX, COUNT, AVG Quantifier : For all, exists (Additional functions?: increasing and decreasing values, nonoccurence) Dagstuhl
a3 a1 a2 an . . . Primitive Events Composite Events TIMES(a1a2…an, n) CEDL: Cumulative Selection Mode • Assume : A(p1, p2, p3) • TIMES(a1, _) is [1 2 3] • 2. TIMES(a1a2, _) is: [1 2 3] • [4 5 6] • Cumulative Selection Mode for TIMES(A, n) • For cumulative, only one event will be fired Dagstuhl
Times Event with Existential Quantifier composite updateCustomerHistory(loginName) { TIMES(afterCancelOrder(String loginName, String orderId, float amount), 2 ) for loginName whereorderId(1) != orderId(2) and exists a in amount: a >= 100 within8 weeks ; } Quantifier : For all, exists Dagstuhl
composite possibleNuisanceShopper(loginName) { C: completeOrder(String loginName, String orderId, float amount)SEQ ( ( TIMES (returnItems(String loginName, String orderId, String itemNo1), 2) for loginName, orderId within 4 weeks;ORTIMES (registerComplaint(String loginName, String orderId, String itemNo2), 2) for loginName, orderIdwithin 4 weeks; ; ) OR C: cancelOrder(String loginName, String orderId) ; ) within 12 weeks; } composite nuisanceShopper(loginName) { TIMES (possibleNuisanceShopper (String loginName), *) for loginName where count(loginName) >= 3within 24 weeks ; } Nested Composite Events Dagstuhl
Need to Consider Models that Integrate Stream Processing, Event Processing, and Queries Over Persistent Data Rules Dashboards Alerts Filter Composite Event Parameters (((A and B) or C) SEQ D) Additional filters over context DBs and event histories Context Database Stream Processing (Queries to Extract an Initial Level of Events) Dagstuhl
Distributed Event Processing Agents Dagstuhl
Issues • Filtering is an important component of composite event processing • Need to refine filtering features • Need clear semantics for use of filters with consumption modes • Enhance with some of Sharma’s work on detection time vs. interval based semantics • Without filtering, too many meaningless events are generated • In a rule processing system, the generation of meaningless events causes unnecessary load on the rule processor • In time critical applications with filters over a persistent DB, need to use condition monitoring techniques (also an application of event processing) • Distributed detection of the composite event – can build on distributed query processing techniques Dagstuhl
Additional Design Issues to Consider • Separation between event and stream processing • How much of the filter can be pushed into the initial stream query? • Need to use SQL-based stream query languages combined with composite event specification languages. • Separation between event filters and rule conditions • What’s the difference between the event filter and the rule condition Dagstuhl
r1 r1 r1 r2 r3 r2 r3 r3 r2 S1 S1 S1 Desirable Properties of Active Rules Termination (finite triggering behavior) Confluence (deterministic result) r1 r1 r2 r2 r3 r1 r3 r4 r3 r2 Cycles in a rule triggering graph indicate a potential for non-terminating behavior. S2 Non-deterministic Deterministic Dagstuhl
Barriers to Use • Defining meaningful conditions requires the extraction of domain knowledge • Can extract from domain experts • Use data mining to identify well-defined composite event patterns and filters • Difficulty of rule-based environments • Are termination and confluence still problems if conditions are pushed into event filters? • Need a methodology for event and rule-based programming • Meaningful dashboards that monitor the occurrence of events and help users understand how to interpret and respond to events. • The paradigm shift is found in the proactive, reactive, or interactive computation • Event processing is an enabling technology Dagstuhl