SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
<Insert Picture Here>




          A General Extension System for Event Processing Languages
          Alexandre Alves - Oracle CEP




Monday, July 11, 2011
Agenda                                                   DEBS2011



        • Scenario 1
              •   String manipulation (programming-in-the-small)
        • Blending CQL and Java
        • Architecture
        • Scenario 2            Text
              •   Geo-fence (extensibility)
        • Blending CQL and Spatial
        • Architecture
        • Q/A




Monday, July 11, 2011
Scenario 1:                                   DEBS2011
          Programming-in-the-small

        • Correlate security price changes to real-time event
          news.



                                  Text




Monday, July 11, 2011
Scenario 1:                   DEBS2011
          Programming-in-the-small
                                     Oracle CQL
                                     Processor

           SELECT *
           FROM            Text
           news [RANGE 1 HOUR],
           stock_tick [RANGE 1 HOUR]
           WHERE /* join-criteria */



Monday, July 11, 2011
Scenario 1:                                                   DEBS2011
          Programming-in-the-small

        • Problem: the NEWS feed is a unstructured (String),
          hence not trivial to identify its event properties
              •   For example, a naive join criteria is to look for a stock’s
                  symbol
        • The problem of parsing a String can be solved using
          Regular Expressions. Text
        • Regular Expressions and other programming-in-the-
          small tasks have long been solved by general
          purpose programming languages
        • Can we leverage this within an event processing
          language (e.g. CQL)?



Monday, July 11, 2011
Java Regular Expressions                                       DEBS2011



        • Let’s look at a simple solution to the problem using
          Java:


               Matcher matcher =
                                             Text
                    Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher
                    (message);
               if (matcher.find()) {
                                                                             Matches three letter
                symbol = message.substring(matcher.start() + 1,              symbols, separated by
                                                                             leading and trailing
                    matcher.end() - 1));                                     white-spaces
               }




Monday, July 11, 2011
Blending CQL with Java                                      DEBS2011



       CREATE VIEW filtered_news(message, matcher) AS
       SELECT
        message,
        Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher(message) as
       matcher
       FROM news [RANGE 1 HOUR] Text

       SELECT
        location, item_description, message
       FROM filtered_news, stock_tick[RANGE 1 HOUR]
       WHERE
        matcher.find() = true AND
        filtered_news.message.substring(matcher.start() + 1,
          matcher.end() - 1) = stock_tick.symbol



Monday, July 11, 2011
Blending CQL with Java                                     DEBS2011
                                                                 CQL char conversion
                                                                 to Java String

       CREATE VIEW filtered_news(message, matcher) AS
       SELECT
        message,
        Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher(message) as matcher
       FROM news [RANGE 1 HOUR]
                                          Text
       SELECT
        location, item_description, message                      Method invocation
       FROM filtered_news, stock_tick[RANGE 1 HOUR]
       WHERE
        matcher.find() = true AND                                Static method
        filtered_news.message.substring(matcher.start() + 1,     invocation
          matcher.end() - 1) = stock_tick.symbol




Monday, July 11, 2011
Blending CQL with Java                                     DEBS2011


                                                                 ‘matcher’ is a Java
                                                                 Object, and treated as
       CREATE VIEW filtered_news(message, matcher) AS
                                                                 a complex type by
       SELECT                                                    CQL
        message,
        Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher(message) as matcher
       FROM news [RANGE 1 HOUR]
                                          Text
       SELECT                                                     Overload of CQL ‘+’
        location, item_description, message                      operator to handle
       FROM filtered_news, stock_tick[RANGE 1 HOUR]              Java Integer
       WHERE
        matcher.find() = true AND                                Overload of CQL
        filtered_news.message.substring(matcher.start() + 1,     equality to handle
          matcher.end() - 1) = stock_tick.symbol                 Java String




Monday, July 11, 2011
Architecture                                                    DEBS2011




                  Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher
                  Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher(message)
                  (message)
        • Is this symbol:
              •                              Text
                   A stream attribute (e.g. message)?
              •    A stream alias (e.g. FROM S1 as A)
              •    A CQL function (e.g. SELECT myfunc())
              •    The l-value of complex type (e.g. myObj.myMethod())
              •    A constructor
              •    A (static) method
              •    A class name




Monday, July 11, 2011
Architecture                                                  DEBS2011




                Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher
                Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher(message)
                (message)
        • To be able to semantically compile symbols, we need
          to have type information.Text
        • However, CQL is not aware of Java, nor should it be.
        • There is a need of a generic type-system, and an
          extension model for providers to plug-in their own
          languages




Monday, July 11, 2011
Architecture                                   DEBS2011



                        CQL    Parser




                              Semantic         Type
                              Analyzer        Registry

                              Text

                                Code
                              Generator   Java
                                          Type-System




                               Code
                              Executor




Monday, July 11, 2011
Architecture                                                      DEBS2011




                Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher
                Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher(message)
                (message)

                                                              ComplexType

                 “Pattern”
                                             Text
                                          Type               fields
                                         Registry
                                                             methods




                                     Java
                                     Type-System




Monday, July 11, 2011
Architecture                                                      DEBS2011




                                                 ComplexType
                                                fields
    “Pattern”                Type
                            Registry
                                                methods



                                       Text
                        Java
                        Type-System

                                         CQL deals with a ‘complex type’ abstraction, and
                                         does not know of its ‘Java Language’ binding.




Monday, July 11, 2011
Architecture                                                  DEBS2011




                Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher
                Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher(message)
                (message)
                        Pattern
                  ComplexType
                 fields                      Text
                                         Find a “compile” method and its return type
                 methods




Monday, July 11, 2011
Architecture                                                   DEBS2011




                Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher(message)


              Pattern                  Matcher
          ComplexType               ComplexType  Text
         fields                     fields                    Store ‘matcher’ as
         methods                   methods                  a stream/view attribute




Monday, July 11, 2011
Architecture                                                                      DEBS2011


                                             Extensible Language

                                              stream 1     *   attribute                      Type
                                                                           <<is-of>>



     ‘matcher’ is an attribute of the view
     of type ‘java.util.regex.Matcher’                                                   ComplexType


                                                  Text                                 <<metadata binding>>




                                                                               Extension Java Language

 CREATE VIEW filtered_news(message, matcher)
                                                                                          Java Class




Monday, July 11, 2011
Extensibility                                                          DEBS2011


                                  Extensible Language

                                   stream 1     *   attribute                      Type
                                                                <<is-of>>




                                                                              ComplexType


                                       Text                                 <<metadata binding>>




           How do we know which                                     Extension Java Language

           ‘language extension’ to use?
           How to provide new                                                  Java Class

           extensions?




Monday, July 11, 2011
Scenario 2:                                                   DEBS2011
          Spatial Integration

        • Targeted marketing for a mobile subscriber
              •   CEP application checks if the location of the subscriber is
                  within the distance of a registered shop


                                           Text
                                            Text


                                                               Oracle Spatial
                                                                    Shop
                                                            id: CHAR
                                                            geometry: SDO_GEOMETRY




Monday, July 11, 2011
Blending CQL with Spatial                                   DEBS2011




      CREATE VIEW CustomerLocation-Stream(point, custId) AS
      SELECT createPoint@spatial(lng, lat) as point, custId
      FROM Location-Stream
                                                              point is a spatial type
      SELECT loc.custId, shop.id         Text
      FROM
       CustomerLocation-Stream[NOW] AS loc, Shop as shop
      WHERE
       contain@spatial(shop.geometry, loc.point, 2.0d)   ‘spatial’ link points to
                                                              Oracle Spatial
                                                              ‘extension’, where
                                                              ‘contain’ function
                                                              resides




Monday, July 11, 2011
Architecture                                         DEBS2011



                                                       CQL
     CQL link specifies language
     extension, which are plugged
     into the system as a CQL
     cartridge

                                        Text                 <<link>>


                                                   CQL Cartridge
                                                      Cartridge


 contain@spatial(shop.geometry, loc.point, 2.0d)




Monday, July 11, 2011
Conclusion                                     DEBS2011



        • Blending of CQL with other languages allow for the
          creation of feature-rich CEP applications while still
          being highly descriptive
              •   Example:
                   • String manipulation using Java
                                          Text
                   • Geo-fencing using Oracle Spatial
        • Generic frameworks allows for the dynamic plugin of
          extensions (cartridges)




Monday, July 11, 2011

Más contenido relacionado

La actualidad más candente

La actualidad más candente (18)

Vba functions
Vba functionsVba functions
Vba functions
 
Bean Intro
Bean IntroBean Intro
Bean Intro
 
Java beans
Java beansJava beans
Java beans
 
Xml session
Xml sessionXml session
Xml session
 
Go Faster With Native Compilation
Go Faster With Native CompilationGo Faster With Native Compilation
Go Faster With Native Compilation
 
Go faster with_native_compilation Part-2
Go faster with_native_compilation Part-2Go faster with_native_compilation Part-2
Go faster with_native_compilation Part-2
 
Java Beans
Java BeansJava Beans
Java Beans
 
JavaFX and Scala in the Cloud
JavaFX and Scala in the CloudJavaFX and Scala in the Cloud
JavaFX and Scala in the Cloud
 
Extending the Xbase Typesystem
Extending the Xbase TypesystemExtending the Xbase Typesystem
Extending the Xbase Typesystem
 
Jpa
JpaJpa
Jpa
 
Java Beans Unit 4(Part 1)
Java Beans Unit 4(Part 1)Java Beans Unit 4(Part 1)
Java Beans Unit 4(Part 1)
 
Introduction to JPA and Hibernate including examples
Introduction to JPA and Hibernate including examplesIntroduction to JPA and Hibernate including examples
Introduction to JPA and Hibernate including examples
 
En webinar jpa v2final
En webinar jpa v2finalEn webinar jpa v2final
En webinar jpa v2final
 
Sdtl manual
Sdtl manualSdtl manual
Sdtl manual
 
Modul Praktek Java OOP
Modul Praktek Java OOP Modul Praktek Java OOP
Modul Praktek Java OOP
 
Oop features java presentationshow
Oop features java presentationshowOop features java presentationshow
Oop features java presentationshow
 
Autonomous transaction
Autonomous transactionAutonomous transaction
Autonomous transaction
 
iOS overview
iOS overviewiOS overview
iOS overview
 

Destacado

Englekirk Brochure
Englekirk BrochureEnglekirk Brochure
Englekirk Brochure
kimtanouye
 
Assignment 4 - Certification in Dispute Management
Assignment 4 - Certification in Dispute ManagementAssignment 4 - Certification in Dispute Management
Assignment 4 - Certification in Dispute Management
Jyotpreet Kaur
 
Традо питание по дошам
Традо питание по дошамТрадо питание по дошам
Традо питание по дошам
Елена Шальнова
 
Intravert Server side processing for Cassandra
Intravert Server side processing for CassandraIntravert Server side processing for Cassandra
Intravert Server side processing for Cassandra
Edward Capriolo
 
하비인사업계획서0624홍보
하비인사업계획서0624홍보하비인사업계획서0624홍보
하비인사업계획서0624홍보
비인 하
 

Destacado (20)

Dealing with growing social demands in the mining industry
Dealing with growing social demands in the mining industryDealing with growing social demands in the mining industry
Dealing with growing social demands in the mining industry
 
Englekirk Brochure
Englekirk BrochureEnglekirk Brochure
Englekirk Brochure
 
Kkk1
Kkk1Kkk1
Kkk1
 
Notam 01-01-17
Notam 01-01-17Notam 01-01-17
Notam 01-01-17
 
Plant Healthcare Client Report
Plant Healthcare Client ReportPlant Healthcare Client Report
Plant Healthcare Client Report
 
Discussion continuum - Dostep do leczenia
Discussion continuum - Dostep do leczeniaDiscussion continuum - Dostep do leczenia
Discussion continuum - Dostep do leczenia
 
Assignment 4 - Certification in Dispute Management
Assignment 4 - Certification in Dispute ManagementAssignment 4 - Certification in Dispute Management
Assignment 4 - Certification in Dispute Management
 
Multimedia01
Multimedia01Multimedia01
Multimedia01
 
Notam 05 02-16
Notam 05 02-16Notam 05 02-16
Notam 05 02-16
 
Kudavi 1.26.2016
Kudavi 1.26.2016Kudavi 1.26.2016
Kudavi 1.26.2016
 
Egoera: La economía de Bizkaia - Marzo 2016 - nº21
Egoera: La economía de Bizkaia - Marzo 2016 - nº21Egoera: La economía de Bizkaia - Marzo 2016 - nº21
Egoera: La economía de Bizkaia - Marzo 2016 - nº21
 
Conversation01
Conversation01Conversation01
Conversation01
 
Традо питание по дошам
Традо питание по дошамТрадо питание по дошам
Традо питание по дошам
 
Intravert Server side processing for Cassandra
Intravert Server side processing for CassandraIntravert Server side processing for Cassandra
Intravert Server side processing for Cassandra
 
Training company une partnerships
Training company   une partnershipsTraining company   une partnerships
Training company une partnerships
 
Mm wcmc v12
Mm wcmc v12Mm wcmc v12
Mm wcmc v12
 
하비인사업계획서0624홍보
하비인사업계획서0624홍보하비인사업계획서0624홍보
하비인사업계획서0624홍보
 
An Ounce of Prevention
An Ounce of PreventionAn Ounce of Prevention
An Ounce of Prevention
 
Umbrella campaign
Umbrella campaignUmbrella campaign
Umbrella campaign
 
Desejo sexual com mais de 45 anos
Desejo sexual com mais de 45 anosDesejo sexual com mais de 45 anos
Desejo sexual com mais de 45 anos
 

Similar a A General Extension System for Event Processing Languages

scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono
 
Clojure - An Introduction for Java Programmers
Clojure - An Introduction for Java ProgrammersClojure - An Introduction for Java Programmers
Clojure - An Introduction for Java Programmers
elliando dias
 
Reactive cocoa
Reactive cocoaReactive cocoa
Reactive cocoa
gillygize
 
An Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional ParadigmsAn Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional Paradigms
Miles Sabin
 
Kings 120711
Kings 120711Kings 120711
Kings 120711
ClarkTony
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lisp
elliando dias
 

Similar a A General Extension System for Event Processing Languages (20)

Clojure talk at Münster JUG
Clojure talk at Münster JUGClojure talk at Münster JUG
Clojure talk at Münster JUG
 
Clojure for Java developers
Clojure for Java developersClojure for Java developers
Clojure for Java developers
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
JavaScript Editions ES7, ES8 and ES9 vs V8
JavaScript Editions ES7, ES8 and ES9 vs V8JavaScript Editions ES7, ES8 and ES9 vs V8
JavaScript Editions ES7, ES8 and ES9 vs V8
 
An overview of java script in 2015 (ecma script 6)
An overview of java script in 2015 (ecma script 6)An overview of java script in 2015 (ecma script 6)
An overview of java script in 2015 (ecma script 6)
 
Seeking Clojure
Seeking ClojureSeeking Clojure
Seeking Clojure
 
Clojure made-simple - John Stevenson
Clojure made-simple - John StevensonClojure made-simple - John Stevenson
Clojure made-simple - John Stevenson
 
Clojure
ClojureClojure
Clojure
 
Clojure - An Introduction for Java Programmers
Clojure - An Introduction for Java ProgrammersClojure - An Introduction for Java Programmers
Clojure - An Introduction for Java Programmers
 
Reactive cocoa
Reactive cocoaReactive cocoa
Reactive cocoa
 
ICSM07.ppt
ICSM07.pptICSM07.ppt
ICSM07.ppt
 
An Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional ParadigmsAn Introduction to Scala - Blending OO and Functional Paradigms
An Introduction to Scala - Blending OO and Functional Paradigms
 
Kings 120711
Kings 120711Kings 120711
Kings 120711
 
Clojure - A new Lisp
Clojure - A new LispClojure - A new Lisp
Clojure - A new Lisp
 
Java 7
Java 7Java 7
Java 7
 
Sql Summit Clr, Service Broker And Xml
Sql Summit   Clr, Service Broker And XmlSql Summit   Clr, Service Broker And Xml
Sql Summit Clr, Service Broker And Xml
 
What's new in Java EE 6
What's new in Java EE 6What's new in Java EE 6
What's new in Java EE 6
 

Más de Alexandre de Castro Alves (7)

A Guideline to Statistical and Machine Learning
A Guideline to Statistical and Machine LearningA Guideline to Statistical and Machine Learning
A Guideline to Statistical and Machine Learning
 
Developing Modular Systems using OSGi
Developing Modular Systems using OSGiDeveloping Modular Systems using OSGi
Developing Modular Systems using OSGi
 
Speeding up big data with event processing
Speeding up big data with event processingSpeeding up big data with event processing
Speeding up big data with event processing
 
Ts 4783 1
Ts 4783 1Ts 4783 1
Ts 4783 1
 
Bpel4 Ws 1.1 To Ws Bpel 2.0
Bpel4 Ws 1.1 To Ws Bpel 2.0Bpel4 Ws 1.1 To Ws Bpel 2.0
Bpel4 Ws 1.1 To Ws Bpel 2.0
 
Introduction to OSGi
Introduction to OSGiIntroduction to OSGi
Introduction to OSGi
 
Alves Mea Pch1 Free
Alves Mea Pch1 FreeAlves Mea Pch1 Free
Alves Mea Pch1 Free
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

A General Extension System for Event Processing Languages

  • 1. <Insert Picture Here> A General Extension System for Event Processing Languages Alexandre Alves - Oracle CEP Monday, July 11, 2011
  • 2. Agenda DEBS2011 • Scenario 1 • String manipulation (programming-in-the-small) • Blending CQL and Java • Architecture • Scenario 2 Text • Geo-fence (extensibility) • Blending CQL and Spatial • Architecture • Q/A Monday, July 11, 2011
  • 3. Scenario 1: DEBS2011 Programming-in-the-small • Correlate security price changes to real-time event news. Text Monday, July 11, 2011
  • 4. Scenario 1: DEBS2011 Programming-in-the-small Oracle CQL Processor SELECT * FROM Text news [RANGE 1 HOUR], stock_tick [RANGE 1 HOUR] WHERE /* join-criteria */ Monday, July 11, 2011
  • 5. Scenario 1: DEBS2011 Programming-in-the-small • Problem: the NEWS feed is a unstructured (String), hence not trivial to identify its event properties • For example, a naive join criteria is to look for a stock’s symbol • The problem of parsing a String can be solved using Regular Expressions. Text • Regular Expressions and other programming-in-the- small tasks have long been solved by general purpose programming languages • Can we leverage this within an event processing language (e.g. CQL)? Monday, July 11, 2011
  • 6. Java Regular Expressions DEBS2011 • Let’s look at a simple solution to the problem using Java: Matcher matcher = Text Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher (message); if (matcher.find()) { Matches three letter symbol = message.substring(matcher.start() + 1, symbols, separated by leading and trailing matcher.end() - 1)); white-spaces } Monday, July 11, 2011
  • 7. Blending CQL with Java DEBS2011 CREATE VIEW filtered_news(message, matcher) AS SELECT message, Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher(message) as matcher FROM news [RANGE 1 HOUR] Text SELECT location, item_description, message FROM filtered_news, stock_tick[RANGE 1 HOUR] WHERE matcher.find() = true AND filtered_news.message.substring(matcher.start() + 1, matcher.end() - 1) = stock_tick.symbol Monday, July 11, 2011
  • 8. Blending CQL with Java DEBS2011 CQL char conversion to Java String CREATE VIEW filtered_news(message, matcher) AS SELECT message, Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher(message) as matcher FROM news [RANGE 1 HOUR] Text SELECT location, item_description, message Method invocation FROM filtered_news, stock_tick[RANGE 1 HOUR] WHERE matcher.find() = true AND Static method filtered_news.message.substring(matcher.start() + 1, invocation matcher.end() - 1) = stock_tick.symbol Monday, July 11, 2011
  • 9. Blending CQL with Java DEBS2011 ‘matcher’ is a Java Object, and treated as CREATE VIEW filtered_news(message, matcher) AS a complex type by SELECT CQL message, Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher(message) as matcher FROM news [RANGE 1 HOUR] Text SELECT Overload of CQL ‘+’ location, item_description, message operator to handle FROM filtered_news, stock_tick[RANGE 1 HOUR] Java Integer WHERE matcher.find() = true AND Overload of CQL filtered_news.message.substring(matcher.start() + 1, equality to handle matcher.end() - 1) = stock_tick.symbol Java String Monday, July 11, 2011
  • 10. Architecture DEBS2011 Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher(message) (message) • Is this symbol: • Text A stream attribute (e.g. message)? • A stream alias (e.g. FROM S1 as A) • A CQL function (e.g. SELECT myfunc()) • The l-value of complex type (e.g. myObj.myMethod()) • A constructor • A (static) method • A class name Monday, July 11, 2011
  • 11. Architecture DEBS2011 Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher(message) (message) • To be able to semantically compile symbols, we need to have type information.Text • However, CQL is not aware of Java, nor should it be. • There is a need of a generic type-system, and an extension model for providers to plug-in their own languages Monday, July 11, 2011
  • 12. Architecture DEBS2011 CQL Parser Semantic Type Analyzer Registry Text Code Generator Java Type-System Code Executor Monday, July 11, 2011
  • 13. Architecture DEBS2011 Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher(message) (message) ComplexType “Pattern” Text Type fields Registry methods Java Type-System Monday, July 11, 2011
  • 14. Architecture DEBS2011 ComplexType fields “Pattern” Type Registry methods Text Java Type-System CQL deals with a ‘complex type’ abstraction, and does not know of its ‘Java Language’ binding. Monday, July 11, 2011
  • 15. Architecture DEBS2011 Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher(message) (message) Pattern ComplexType fields Text Find a “compile” method and its return type methods Monday, July 11, 2011
  • 16. Architecture DEBS2011 Pattern.compile("[.,; ][A-Z][A-Z][A-Z][.,; ]").matcher(message) Pattern Matcher ComplexType ComplexType Text fields fields Store ‘matcher’ as methods methods a stream/view attribute Monday, July 11, 2011
  • 17. Architecture DEBS2011 Extensible Language stream 1 * attribute Type <<is-of>> ‘matcher’ is an attribute of the view of type ‘java.util.regex.Matcher’ ComplexType Text <<metadata binding>> Extension Java Language CREATE VIEW filtered_news(message, matcher) Java Class Monday, July 11, 2011
  • 18. Extensibility DEBS2011 Extensible Language stream 1 * attribute Type <<is-of>> ComplexType Text <<metadata binding>> How do we know which Extension Java Language ‘language extension’ to use? How to provide new Java Class extensions? Monday, July 11, 2011
  • 19. Scenario 2: DEBS2011 Spatial Integration • Targeted marketing for a mobile subscriber • CEP application checks if the location of the subscriber is within the distance of a registered shop Text Text Oracle Spatial Shop id: CHAR geometry: SDO_GEOMETRY Monday, July 11, 2011
  • 20. Blending CQL with Spatial DEBS2011 CREATE VIEW CustomerLocation-Stream(point, custId) AS SELECT createPoint@spatial(lng, lat) as point, custId FROM Location-Stream point is a spatial type SELECT loc.custId, shop.id Text FROM CustomerLocation-Stream[NOW] AS loc, Shop as shop WHERE contain@spatial(shop.geometry, loc.point, 2.0d) ‘spatial’ link points to Oracle Spatial ‘extension’, where ‘contain’ function resides Monday, July 11, 2011
  • 21. Architecture DEBS2011 CQL CQL link specifies language extension, which are plugged into the system as a CQL cartridge Text <<link>> CQL Cartridge Cartridge contain@spatial(shop.geometry, loc.point, 2.0d) Monday, July 11, 2011
  • 22. Conclusion DEBS2011 • Blending of CQL with other languages allow for the creation of feature-rich CEP applications while still being highly descriptive • Example: • String manipulation using Java Text • Geo-fencing using Oracle Spatial • Generic frameworks allows for the dynamic plugin of extensions (cartridges) Monday, July 11, 2011