www.espertech.com
Documentation
Next
Esper Reference
by
EsperTech Inc.
Version 8.8.0
Copyright © 2022 EsperTech Inc.
Preface
1. Getting Started
1.1. Introduction to Complex Event Processing
1.2. Introduction to the Architecture
1.3. Introduction to EPL
1.4. Compiler Getting-Started
1.4.1. Compiler - Step One: Setting up the Compiler Classpath
1.4.2. Compiler - Step Two: Provide Information on Input Events
1.4.3. Compiler - Step Three: Compiling EPL
1.5. Runtime Getting-Started
1.5.1. Runtime - Step One: Setting up the Runtime Classpath
1.5.2. Runtime - Step Two: Obtain Runtime
1.5.3. Runtime - Step Three: Deploy EPL Compiled Module and Attach a Callback
1.5.4. Runtime - Step Four: Send Events
1.6. Required 3rd Party Libraries
1.6.1. Common Required 3rd Party Libraries
1.6.2. Compiler - Required 3rd Party Libraries
1.6.3. Runtime - Required 3rd Party Libraries
2. Basic Concepts
2.1. Introduction
2.2. Basic Select
2.3. Basic Aggregation
2.4. Basic Filter
2.5. Basic Filter and Aggregation
2.6. Basic Data Window
2.7. Basic Data Window and Aggregation
2.8. Basic Filter, Data Window and Aggregation
2.9. Basic Where-Clause
2.10. Basic Time Window and Aggregation
2.11. Basic Partitioned Statement
2.12. Basic Output-Rate-Limited Statement
2.13. Basic Partitioned and Output-Rate-Limited Statement
2.14. Basic Named Windows and Tables
2.14.1. Named Windows
2.14.2. Tables
2.15. Basic Aggregated Statement Types
2.15.1. Un-Aggregated and Un-Grouped
2.15.2. Fully Aggregated and Un-Grouped
2.15.3. Aggregated and Un-Grouped
2.15.4. Fully Aggregated and Grouped
2.15.5. Aggregated and Grouped
2.16. Basic Match-Recognize Patterns
2.17. Basic EPL Patterns
2.18. Basic Indexes
2.18.1. Index Kinds
2.18.2. Filter Indexes
2.18.3. Event Indexes
2.19. Basic Null
3. Event Representations
3.1. Event Underlying Java Objects
3.2. Event Properties
3.2.1. Escape Characters
3.2.2. Expression as Key or Index Value
3.3. Dynamic Event Properties
3.4. Fragment and Fragment Type
3.5. Comparing Event Representations
3.5.1. Incoming Events
3.5.2. Outgoing Events
3.5.3. Schema
3.5.4. Side-by-Side
3.6. Support for Generic Tuples
3.7. Updating, Merging and Versioning Events
3.8. Coarse-Grained Events
3.9. Event Objects Instantiated and Populated by Insert Into
3.10. Event Type Uniqueness
4. Context and Context Partitions
4.1. Introduction
4.2. Context Declaration
4.2.1. Context-Provided Properties
4.2.2. Keyed Segmented Context
4.2.3. Hash Segmented Context
4.2.4. Category Segmented Context
4.2.5. Non-Overlapping Context
4.2.6. Overlapping Context
4.2.7. Context Conditions
4.3. Context Nesting
4.3.1. Nested Context Sample Walk-Through
4.3.2. Built-In Nested Context Properties
4.4. Partitioning Without Context Declaration
4.5. Output When a Context Partition Starts (Non-Overlapping Context) or Initiates (Overlapping Context)
4.6. Output When a Context Partition Ends (Non-Overlapping Context) or Terminates (Overlapping Context)
4.7. Context and Named Window
4.8. Context and Tables
4.9. Context and Variables
4.10. Operations on Specific Context Partitions
5. EPL Reference: Clauses
5.1. EPL Introduction
5.2. EPL Syntax
5.2.1. Specifying Time Periods
5.2.2. Using Comments
5.2.3. Reserved Keywords
5.2.4. Escaping Strings
5.2.5. Data Types
5.2.6. Using Constants and Enum Types
5.2.7. Annotation
5.2.8. Expression Alias
5.2.9. Expression Declaration
5.2.10. Inlined-Class Declaration
5.2.11. Script Declaration
5.2.12. Referring to a Context
5.2.13. Composite Keys and Array Values as Keys
5.3. Choosing Event Properties and Events: The Select Clause
5.3.1. Choosing the Event Itself: Select *
5.3.2. Choosing Specific Event Properties
5.3.3. Expressions
5.3.4. Renaming Event Properties
5.3.5. Choosing Event Properties and Events in a Join
5.3.6. Choosing Event Properties and Events From a Pattern
5.3.7. Selecting Insert and Remove Stream Events
5.3.8. Select Distinct
5.3.9. Transposing an Expression Result to a Stream
5.3.10. Selecting EventBean Instead of Underlying Event
5.4. Specifying Event Streams: The From Clause
5.4.1. Filter-Based Event Streams
5.4.2. Pattern-Based Event Streams
5.4.3. Specifying Data Windows
5.4.4. Multiple Data Windows
5.4.5. Using the Stream Name
5.4.6. The From-Clause is Optional
5.5. Specifying Search Conditions: The Where Clause
5.6. Aggregates and Grouping: The Group-By Clause and the Having Clause
5.6.1. Using Aggregate Functions
5.6.2. Organizing Statement Results into Groups: The Group-by Clause
5.6.3. Using Group-By with Rollup, Cube and Grouping Sets
5.6.4. Specifying Grouping for Each Aggregation Function
5.6.5. Specifying a Filter Expression for Each Aggregation Function
5.6.6. Selecting Groups of Events: The Having Clause
5.6.7. How the Stream Filter, Where, Group By and Having-Clauses Interact
5.6.8. Comparing Keyed Segmented Context, the Group By Clause and #groupwin for Data Windows
5.7. Stabilizing and Controlling Output: The Output Clause
5.7.1. Output Clause Options
5.7.2. Aggregation, Group By, Having and Output Clause Interaction
5.8. Sorting Output: the Order By Clause
5.9. Limiting Row Count: the Limit Clause
5.10. Merging Streams and Continuous Insertion: The Insert Into Clause
5.10.1. Transposing a Property to a Stream
5.10.2. Merging Streams by Event Type
5.10.3. Merging Disparate Types of Events: Variant Streams
5.10.4. Decorated Events
5.10.5. Event as a Property
5.10.6. Instantiating and Populating an Underlying Event Object
5.10.7. Transposing an Expression Result
5.10.8. Select-Clause Expression and Inserted-Into Column Event Type
5.10.9. Insert Into for Event Types Without Properties
5.10.10. Insert Into and Event Precedence
5.11. Subqueries
5.11.1. The 'Exists' Keyword
5.11.2. The 'In' and 'Not In' Keywords
5.11.3. The 'Any' and 'Some' Keywords
5.11.4. The 'All' Keyword
5.11.5. Subquery With Group By Clause
5.11.6. Multi-Column Selection
5.11.7. Multi-Row Selection
5.11.8. Hints Related to Subqueries
5.12. Joining Event Streams
5.12.1. Introducing Joins
5.12.2. Inner (Default) Joins
5.12.3. Outer, Left and Right Joins
5.12.4. Unidirectional Joins
5.12.5. Unidirectional Full Outer Joins
5.12.6. Hints Related to Joins
5.13. Accessing Relational Data via SQL
5.13.1. Joining SQL Query Results
5.13.2. SQL Query and the EPL Where Clause
5.13.3. Outer Joins With SQL Queries
5.13.4. Using Patterns to Request (Poll) Data
5.13.5. Polling SQL Queries via Iterator
5.13.6. JDBC Implementation Overview
5.13.7. Oracle Drivers and No-Metadata Workaround
5.13.8. SQL Input Parameter and Column Output Conversion
5.13.9. SQL Row POJO Conversion
5.13.10. Executing SQL Fire-and-Forget Queries Using EPFireAndForgetService
5.14. Accessing Non-Relational Data via Method, Script or UDF Invocation
5.14.1. Joining Method, Script or UDF Invocation Results
5.14.2. Polling Invocation Results via Iterator
5.14.3. Providing the Method
5.14.4. Using a Map Return Type
5.14.5. Using a Object Array Return Type
5.14.6. Using an EventBean Return Type
5.14.7. Providing the Script
5.14.8. Providing the UDF
5.15. Declaring an Event Type: Create Schema
5.15.1. Declare an Event Type by Providing Names and Types
5.15.2. Declare an Event Type by Providing a Class Name
5.15.3. Declare a Variant Stream
5.16. Splitting and Duplicating Streams
5.16.1. Generating Marker Events for Contained Events
5.17. Variables and Constants
5.17.1. Creating Variables: The Create Variable Clause
5.17.2. Setting Variable Values: The On Set Clause
5.17.3. Using Variables
5.17.4. Object-Type Variables
5.17.5. Class and Event-Type Variables
5.18. Declaring Global Expressions, Aliases and Scripts: Create Expression
5.18.1. Global Expression Aliases
5.18.2. Global Expression Declarations
5.18.3. Global Scripts
5.19. Contained-Event Selection
5.19.1. Select-Clause in a Contained-Event Selection
5.19.2. Where Clause in a Contained-Event Selection
5.19.3. Contained-Event Selection and Joins
5.19.4. Sentence and Word Example
5.19.5. More Examples
5.19.6. Contained Expression Returning an Array of Property Values
5.19.7. Contained Expression Returning an Array of EventBean
5.19.8. Contained Expression Returning a Collection of Underlying Event Objects
5.19.9. Generating Marker Events Such as a Begin and End Event
5.19.10. Contained-Event Limitations
5.20. Updating an Insert Stream: The Update IStream Clause
5.20.1. Immutability and Updates
5.21. Controlling Event Delivery : The For Clause
6. EPL Reference: Named Windows and Tables
6.1. Overview
6.1.1. Named Window Overview
6.1.2. Table Overview
6.1.3. Comparing Named Windows and Tables
6.2. Named Window Usage
6.2.1. Creating Named Windows: The Create Window clause
6.2.2. Inserting Into Named Windows
6.2.3. Selecting From Named Windows
6.3. Table Usage
6.3.1. Creating Tables: The Create Table Clause
6.3.2. Aggregating Into Table Rows: The Into Table Clause
6.3.3. Table Column Keyed-Access Expressions
6.3.4. Inserting Into Tables
6.3.5. Selecting From Tables
6.3.6. Resetting Table Columns and Aggregation State
6.3.7. Initializing Table Columns and Aggregation State
6.4. Triggered Select: The On Select Clause
6.4.1. Notes on On-Select With Named Windows
6.4.2. Notes on On-Select With Tables
6.4.3. On-Select Compared to Join
6.5. Triggered Select+Delete: The On Select Delete Clause
6.6. Updating Data: The On Update Clause
6.6.1. Notes on On-Update With Named Windows
6.6.2. Notes on On-Update With Tables
6.7. Deleting Data: The On Delete Clause
6.7.1. Using Patterns in the On-Delete Clause
6.7.2. Silent Delete With Named Windows
6.7.3. Notes on On-Delete With Named Windows
6.7.4. Notes on On-Update With Tables
6.8. Triggered Upsert Using the On-Merge Clause
6.8.1. On-Merge Insert
6.8.2. On-Merge Update, Delete, Select (Upsert)
6.8.3. Notes on On-Merge With Named Windows
6.8.4. Notes on On-Merge With Tables
6.9. Explicitly Indexing Named Windows and Tables
6.10. Using Fire-and-Forget Queries With Named Windows and Tables
6.10.1. Inserting Data
6.10.2. Updating Data
6.10.3. Deleting Data
6.11. Events as Property
7. EPL Reference: Patterns
7.1. Event Pattern Overview
7.2. How to Use Patterns
7.2.1. Pattern Syntax
7.2.2. Patterns in EPL
7.2.3. Subscribing to Pattern Events
7.2.4. Pulling Data From Patterns
7.2.5. Pattern Error Reporting
7.2.6. Suppressing Same-Event Matches
7.2.7. Discarding Partially Completed Patterns
7.3. Operator Precedence
7.4. Filter Expressions in Patterns
7.4.1. Filter Expressions and Filter Indexes
7.4.2. Controlling Event Consumption
7.4.3. Use With Named Windows and Tables
7.5. Pattern Operators
7.5.1. Every
7.5.2. Every-Distinct
7.5.3. Repeat
7.5.4. Repeat-Until
7.5.5. And
7.5.6. Or
7.5.7. Not
7.5.8. Followed-By
7.5.9. Pattern Guards
7.6. Pattern Atoms
7.6.1. Filter Atoms
7.6.2. Observer Atoms Overview
7.6.3. Interval (timer:interval)
7.6.4. Crontab (timer:at)
7.6.5. Schedule (timer:schedule)
7.7. Event Pattern Walkthrough
8. EPL Reference: Match Recognize
8.1. Overview
8.2. Comparison of Match Recognize and EPL Patterns
8.3. Syntax
8.3.1. Syntax Example
8.4. Pattern and Pattern Operators
8.4.1. Operator Precedence
8.4.2. Concatenation
8.4.3. Alternation
8.4.4. Quantifiers Overview
8.4.5. Permutations
8.4.6. Variables Can Be Singleton or Group
8.4.7. Eliminating Duplicate Matches
8.4.8. Greedy or Reluctant
8.4.9. Quantifier - One or More (+ and +?)
8.4.10. Quantifier - Zero or More (* and *?)
8.4.11. Quantifier - Zero or One (? and ??)
8.4.12. Repetition - Exactly N Matches
8.4.13. Repetition - N or More Matches
8.4.14. Repetition - Between N and M Matches
8.4.15. Repetition - Between Zero and M Matches
8.4.16. Repetition Equivalence
8.5. Define Clause
8.5.1. The Prev Operator
8.6. Measure Clause
8.7. Datawindow-Bound
8.8. Interval
8.9. Interval-or-Terminated
8.10. Use With Different Event Types
8.11. Limiting Runtime-Wide State Count
8.12. Limitations
9. EPL Reference: Operators
9.1. Arithmetic Operators
9.2. Logical and Comparison Operators
9.2.1. Null-Value Comparison Operators
9.3. Concatenation Operators
9.4. Binary Operators
9.5. Array Definition Operator
9.6. Array Element Operator
9.7. Dot Operator
9.7.1. Duck Typing
9.8. The 'In' Keyword
9.8.1. 'In' for Range Selection
9.9. The 'Between' Keyword
9.10. The 'Like' Keyword
9.11. The 'Regexp' Keyword
9.12. The 'Any' and 'Some' Keywords
9.13. The 'All' Keyword
9.14. The 'New' Keyword
9.14.1. Using 'New' to Populate a Data Structure
9.14.2. Using 'New' to Instantiate an Object
9.14.3. Using 'New' to Allocate an Array
9.14.4. Using 'New' to Allocate and Initialize an Array
10. EPL Reference: Functions
10.1. Single-Row Function Reference
10.1.1. The Case Control Flow Function
10.1.2. The Cast Function
10.1.3. The Coalesce Function
10.1.4. The Current_Evaluation_Context Function
10.1.5. The Current_Timestamp Function
10.1.6. The Event_Identity_Equals Function
10.1.7. The Exists Function
10.1.8. The Grouping Function
10.1.9. The Grouping_Id Function
10.1.10. The Instance-Of Function
10.1.11. The Istream Function
10.1.12. The Min and Max Functions
10.1.13. The Previous Function
10.1.14. The Previous-Tail Function
10.1.15. The Previous-Window Function
10.1.16. The Previous-Count Function
10.1.17. The Prior Function
10.1.18. The Type-Of Function
10.2. Aggregation Functions
10.2.1. SQL-Standard Functions
10.2.2. Event Aggregation Functions
10.2.3. Approximation Aggregation Functions
10.2.4. Additional Aggregation Functions
10.3. User-Defined Functions
10.4. Select-Clause Transpose Function
10.4.1. Transpose with Insert-Into
11. EPL Reference: Enumeration Methods
11.1. Overview
11.2. Example Events
11.3. How to Use
11.3.1. Syntax
11.3.2. Introductory Examples
11.3.3. Index and Size Formal Parameters
11.3.4. Input, Output and Limitations
11.4. Inputs
11.4.1. Subquery Results
11.4.2. Named Window
11.4.3. Table
11.4.4. Event Property and Insert-Into With @eventbean
11.4.5. Event Aggregation Function
11.4.6. Prev, Prevwindow and Prevtail Single-Row Functions as Input
11.4.7. Single-Row Function, User-Defined Function and Enum Types
11.4.8. Declared Expression
11.4.9. Variables
11.4.10. Substitution Parameters
11.4.11. Match-Recognize Group Variable
11.4.12. Pattern Repeat and Repeat-Until Operators
11.5. Example
11.6. Reference
11.6.1. Aggregate
11.6.2. AllOf
11.6.3. AnyOf
11.6.4. ArrayOf
11.6.5. Average
11.6.6. CountOf
11.6.7. DistinctOf
11.6.8. Except
11.6.9. FirstOf
11.6.10. GroupBy
11.6.11. Intersect
11.6.12. LastOf
11.6.13. LeastFrequent
11.6.14. Max
11.6.15. MaxBy
11.6.16. Min
11.6.17. MinBy
11.6.18. MostFrequent
11.6.19. OrderBy and OrderByDesc
11.6.20. Reverse
11.6.21. SelectFrom
11.6.22. SequenceEqual
11.6.23. SumOf
11.6.24. Take
11.6.25. TakeLast
11.6.26. TakeWhile
11.6.27. TakeWhileLast
11.6.28. ToMap
11.6.29. Union
11.6.30. Where
12. EPL Reference: Date-Time Methods
12.1. Overview
12.2. How to Use
12.2.1. Syntax
12.3. Calendar and Formatting Reference
12.3.1. Between
12.3.2. Format
12.3.3. Get (By Field)
12.3.4. Get (By Name)
12.3.5. Minus
12.3.6. Plus
12.3.7. RoundCeiling
12.3.8. RoundFloor
12.3.9. RoundHalf
12.3.10. Set (By Field)
12.3.11. WithDate
12.3.12. WithMax
12.3.13. WithMin
12.3.14. WithTime
12.3.15. ToCalendar
12.3.16. ToDate
12.3.17. ToMillisec
12.4. Interval Algebra Reference
12.4.1. Examples
12.4.2. Interval Algebra Parameters
12.4.3. Performance
12.4.4. Limitations
12.4.5. After
12.4.6. Before
12.4.7. Coincides
12.4.8. During
12.4.9. Finishes
12.4.10. Finished By
12.4.11. Includes
12.4.12. Meets
12.4.13. Met By
12.4.14. Overlaps
12.4.15. Overlapped By
12.4.16. Starts
12.4.17. Started By
13. EPL Reference: Aggregation Methods
13.1. Overview
13.2. How to Use
13.2.1. Syntax
13.2.2. Use with Aggregation Function
13.2.3. Use with Table Column
13.2.4. Using Dot to Obtain Property Values
13.2.5. Using Dot to Enumerate Events
13.3. Aggregation Methods for Sorted Aggregations
13.3.1. Overview
13.3.2. Specifying Composite Keys
13.3.3. CeilingEvent, FloorEvent, HigherEvent, LowerEvent, GetEvent
13.3.4. CeilingEvents, FloorEvents, HigherEvents, LowerEvents, GetEvents
13.3.5. CeilingKey, FloorKey, HigherKey, LowerKey
13.3.6. FirstEvent, LastEvent, MinBy, MaxBy
13.3.7. FirstEvents, LastEvents
13.3.8. FirstKey, LastKey
13.3.9. ContainsKey
13.3.10. CountEvents
13.3.11. CountKeys
13.3.12. EventsBetween
13.3.13. Submap
13.3.14. NavigableMapReference
13.4. Aggregation Methods for Window Aggregations
13.4.1. Overview
13.4.2. CountEvents
13.4.3. ListReference
13.4.4. First, Last
13.5. Aggregation Methods for CountMinSketch Aggregations
13.6. Aggregation Methods for Custom Plug-In Multi-Function Aggregations
14. EPL Reference: Data Windows
14.1. A Note on Data Window Name and Parameters
14.2. A Note on Batch Windows
14.3. Data Windows
14.3.1. Length Window (length or win:length)
14.3.2. Length Batch Window (length_batch or win:length_batch)
14.3.3. Time Window (time or win:time)
14.3.4. Externally-timed Window (ext_timed or win:ext_timed)
14.3.5. Time batch Window (time_batch or win:time_batch)
14.3.6. Externally-timed Batch Window (ext_timed_batch or win:ext_timed_batch)
14.3.7. Time-Length Combination Batch Window (time_length_batch or win:time_length_batch)
14.3.8. Time-Accumulating Window (time_accum or win:time_accum)
14.3.9. Keep-All Window (keepall or win:keepall)
14.3.10. First Length Window(firstlength or win:firstlength)
14.3.11. First Time Window (firsttime or win:firsttime)
14.3.12. Expiry Expression Window (expr or win:expr)
14.3.13. Expiry Expression Batch Window (expr_batch or win:expr_batch)
14.3.14. Unique Window (unique or std:unique)
14.3.15. Grouped Data Window (groupwin or std:groupwin)
14.3.16. Last Event Window (std:lastevent)
14.3.17. First Event Window (firstevent or std:firstevent)
14.3.18. First Unique Window (firstunique or std:firstunique)
14.3.19. Sorted Window (sort or ext:sort)
14.3.20. Ranked Window (rank or ext:rank)
14.3.21. Time-Order Window (time_order or ext:time_order)
14.3.22. Time-To-Live Window (timetolive or ext:timetolive)
14.4. Special Derived-Value Windows
14.4.1. Size Derived-Value Window (size) or std:size)
14.4.2. Univariate Statistics Derived-Value Window (uni or stat:uni)
14.4.3. Regression Derived-Value Window (linest or stat:linest)
14.4.4. Correlation Derived-Value Window (correl or stat:correl)
14.4.5. Weighted Average Derived-Value Window (weighted_avg or stat:weighted_avg)
15. Compiler Reference
15.1. Introduction
15.2. Concepts
15.2.1. Module
15.2.2. EPL-objects
15.2.3. Dependencies
15.2.4. Dependency Resolution
15.2.5. Access Modifiers
15.2.6. Bus Modifier for Event Types
15.3. Compiling a Module
15.4. Reading and Writing a Compiled Module
15.5. Reading Module Content
15.6. Compiler Arguments
15.6.1. Compiler Configuration
15.6.2. Compiler Path
15.6.3. Compiler Options
15.6.4. Compiler Path Cache
15.7. Statement Object Model
15.7.1. Building an Object Model
15.7.2. Building Expressions
15.7.3. Building a Pattern Statement
15.7.4. Building a Select Statement
15.7.5. Building a Create-Variable and On-Set Statement
15.7.6. Building Create-Window, On-Delete and On-Select Statements
15.8. Substitution Parameters
15.9. OSGi, Class Loader, Class-For-Name
15.10. Authoring Tools
15.11. Testing Tools
15.12. Debugging
15.12.1. @Audit Annotation
15.13. Ordering Multiple Modules
15.14. Logging
15.15. Debugging Generated Code
15.16. Compiler Version and Runtime Version
15.17. Compiler Byte Code Optimizations
15.18. Compiler Filter Expression Analysis
15.18.1. Constituent Analysis
15.18.2. Value Composite Expression Analysis
15.18.3. Lookupable Composite Expression Analysis
15.18.4. Boolean Reusable Expression Analysis
15.18.5. Condition Analysis and Planning
15.19. Limitations
16. Runtime Reference
16.1. Introduction
16.2. Obtaining a Runtime From EPRuntimeProvider
16.3. The EPRuntime Runtime Interface
16.4. Deploying and Undeploying Using EPDeploymentService
16.4.1. Substitution Parameters
16.4.2. Roll-Out of Multiple Compiled Modules
16.4.3. Atomic Deployment Management
16.5. Obtaining Results Using EPStatement
16.5.1. Receiving Statement Results
16.5.2. Setting a Subscriber Object
16.5.3. Adding Listeners
16.5.4. Using Iterators
16.5.5. Event and Event Type
16.5.6. Type Information
16.5.7. Interrogating Annotations
16.6. Processing Events and Time Using EPEventService
16.6.1. Event Sender
16.6.2. Receiving Unmatched Events
16.7. Execute Fire-and-Forget Queries Using EPFireAndForgetService
16.7.1. Fire-and-forget Query Single Execution
16.7.2. Fire-and-forget Query Prepared Unparameterized Execution
16.7.3. Fire-and-forget Query Prepared Parameterized Execution
16.7.4. The From-Clause is Optional
16.7.5. The From-Clause can Access Relational Data via SQL
16.8. Runtime Threading and Concurrency
16.8.1. Advanced Threading
16.8.2. Processing Order
16.9. Controlling Time-Keeping
16.9.1. Controlling Time Using Time Span Events
16.9.2. Time Resolution and Time Unit
16.9.3. Internal Timer Based on JVM System Time
16.10. Exception Handling
16.11. Condition Handling
16.12. Runtime and Statement Metrics Reporting
16.12.1. Runtime Metrics
16.12.2. Statement Metrics
16.13. Monitoring and JMX
16.14. Event Rendering to XML and JSON
16.14.1. JSON Event Rendering Conventions and Options
16.14.2. XML Event Rendering Conventions and Options
16.15. Plug-In Loader
16.16. Context Partition Selection
16.16.1. Selectors
16.17. Context Partition Administration
16.18. Test and Assertion Support
16.18.1. EPAssertionUtil Summary
16.18.2. SupportUpdateListener Summary
16.18.3. Usage Example
16.19. OSGi, Class Loader, Class-For-Name
16.20. When Deploying with J2EE
16.20.1. J2EE Deployment Considerations
16.20.2. Servlet Context Listener
16.21. Stages
16.21.1. Overview
16.21.2. Stage APIs
16.21.3. Stage Example: Suspending and Resuming a Statement
16.21.4. Stage Other Considerations
16.21.5. Stage Limitations
17. Configuration
17.1. Overview
17.2. Programmatic Configuration
17.3. Configuration via XML File
17.4. Configuration Common
17.4.1. Annotation Class and Package Imports
17.4.2. Class and Package Imports
17.4.3. Events Represented by Classes
17.4.4. Events Represented by java.util.Map
17.4.5. Events Represented by Object[] (Object-array)
17.4.6. Events Represented by JSON
17.4.7. Events Represented by Avro GenericData.Record
17.4.8. Events Represented by org.w3c.dom.Node
17.4.9. Event Type Defaults
17.4.10. Event Type Import Package (Event Type Auto-Name)
17.4.11. From-Clause Method Invocation
17.4.12. Relational Database Access
17.4.13. Common Settings Related to Logging
17.4.14. Common Settings Related to Time Source
17.4.15. Variables
17.4.16. Variant Stream
17.5. Configuration Compiler
17.5.1. Compiler Settings Related to Byte Code Generation
17.5.2. Compiler Settings Related to View Resources
17.5.3. Compiler Settings Related to Logging
17.5.4. Compiler Settings Related to Stream Selection
17.5.5. Compiler Settings Related to Language and Locale
17.5.6. Compiler Settings Related to Expression Evaluation
17.5.7. Compiler Settings Related to Scripts
17.5.8. Compiler Settings Related to Execution of Statements
17.5.9. Compiler Settings Related to Serializers and Deserializers
17.6. Configuration Runtime
17.6.1. Runtime Settings Related to Concurrency and Threading
17.6.2. Runtime Settings Related to Logging
17.6.3. Runtime Settings Related to Variables
17.6.4. Runtime Settings Related to Patterns
17.6.5. Runtime Settings Related to Match-Recognize
17.6.6. Runtime Settings Related to Time Source
17.6.7. Runtime Settings Related to JMX Metrics
17.6.8. Runtime Settings Related to Metrics Reporting
17.6.9. Runtime Settings Related to Expression Evaluation
17.6.10. Runtime Settings Related to Execution of Statements
17.6.11. Runtime Settings Related to Exception Handling
17.6.12. Runtime Settings Related to Condition Handling
17.7. Passing Services or Transient Objects
17.7.1. Service Example
17.7.2. Class-for-Name
17.7.3. Class Loader
17.8. Type Names
17.9. Logging Configuration
17.9.1. Log4j Logging Configuration
18. Inlined Classes
18.1. Overview
18.2. Declaring a Local Class
18.3. Declaring a Global Class
18.4. Performance Notes
18.5. Known Limitations
19. Script Support
19.1. Overview
19.2. Syntax
19.3. Examples
19.4. Built-In EPL Script Attributes
19.5. Performance Notes
19.6. Additional Notes
20. EPL Reference: Spatial Methods and Indexes
20.1. Overview
20.2. Spatial Methods
20.2.1. Point-Inside-Rectangle
20.2.2. Rectangle-Intersects-Rectangle
20.3. Spatial Index - Quadtree
20.3.1. Overview
20.3.2. Declaring a Point-Region Quadtree Index
20.3.3. Using a Point-Region Quadtree as a Filter Index
20.3.4. Using a Point-Region Quadtree as an Event Index
20.3.5. Declaring a MX-CIF Quadtree Index
20.3.6. Using a MX-CIF Quadtree as a Filter Index
20.3.7. Using a MX-CIF Quadtree as an Event Index
20.4. Spatial Types, Functions and Methods from External Libraries
21. EPL Reference: Data Flow
21.1. Introduction
21.2. Usage
21.2.1. Overview
21.2.2. Syntax
21.3. Built-In Operators
21.3.1. BeaconSource
21.3.2. EPStatementSource
21.3.3. EventBusSink
21.3.4. EventBusSource
21.3.5. Filter
21.3.6. LogSink
21.3.7. Select
21.4. API
21.4.1. Declaring a Data Flow
21.4.2. Instantiating a Data Flow
21.4.3. Executing a Data Flow
21.4.4. Instantiation Options
21.4.5. Start Captive
21.4.6. Data Flow Punctuation With Markers
21.4.7. Exception Handling
21.5. Examples
21.6. Operator Implementation
21.6.1. Sample Operator Acting as Source
21.6.2. Sample Tokenizer Operator
21.6.3. Sample Aggregator Operator
21.6.4. Passing Operator Parameters
22. Integration and Extension
22.1. Overview
22.2. Single-Row Function
22.2.1. Using an Inlined Class to Provide a Single-Row Function
22.2.2. Using an Application Class to Provide a Single-Row Function
22.2.3. Value Cache
22.2.4. Single-Row Functions in Filter Predicate Expressions
22.2.5. Single-Row Functions Taking Events as Parameters
22.2.6. Single-Row Functions Returning Events
22.2.7. Receiving a Context Object
22.2.8. Exception Handling
22.3. Virtual Data Window
22.3.1. How to Use
22.3.2. Implementing the Forge
22.3.3. Implementing the Factory-Factory
22.3.4. Implementing the Factory
22.3.5. Implementing the Virtual Data Window
22.4. Data Window View and Derived-Value View
22.4.1. Implementing a View Forge
22.4.2. Implementing a View Factory
22.4.3. Implementing a View
22.4.4. View Contract
22.4.5. Configuring View Namespace and Name
22.4.6. Requirement for Data Window Views
22.4.7. Requirement for Derived-Value Views
22.5. Aggregation Function
22.5.1. Aggregation Single-Function Development
22.5.2. Aggregation Multi-Function Development
22.6. Pattern Guard
22.6.1. Implementing a Guard Forge
22.6.2. Implementing a Guard Factory
22.6.3. Implementing a Guard Class
22.6.4. Configuring Guard Namespace and Name
22.7. Pattern Observer
22.7.1. Implementing an Observer Forge
22.7.2. Implementing an Observer Factory
22.7.3. Implementing an Observer Class
22.7.4. Configuring Observer Namespace and Name
22.8. Date-Time Method
22.8.1. Implement the DateTimeMethodForgeFactory Interface
22.8.2. Implement the Static Methods
22.8.3. Add the Date-Time Method Extension to the Compiler Configuration
22.8.4. Use the new Date-Time Methods
22.9. Enumeration Method
22.9.1. Implement the EnumMethodForgeFactory Interface
22.9.2. Implement the EnumMethodState Interface
22.9.3. Implement the Static Method for Processing
22.9.4. Add the Enumeration Method Extension to the Compiler Configuration
22.9.5. Use the new Enumeration Method
22.9.6. Further Information to Lambda Parameters
23. Examples, Tutorials, Case Studies
23.1. Examples Overview
23.2. Running the Examples
23.3. AutoID RFID Reader
23.4. Runtime Configuration
23.5. JMS Server Shell and Client
23.5.1. Overview
23.5.2. JMS Messages as Events
23.5.3. JMX for Remote Dynamic Statement Management
23.6. Market Data Feed Monitor
23.6.1. Input Events
23.6.2. Computing Rates per Feed
23.6.3. Detecting a Fall-Off
23.6.4. Event generator
23.7. OHLC Plug-In Data Window
23.8. Transaction 3-Event Challenge
23.8.1. The Events
23.8.2. Combined Event
23.8.3. Real-Time Summary Data
23.8.4. Find Problems
23.8.5. Event Generator
23.9. Self-Service Terminal
23.9.1. Events
23.9.2. Detecting Customer Check-In Issues
23.9.3. Absence of Status Events
23.9.4. Activity Summary Data
23.9.5. Sample Application for J2EE Application Server
23.10. Assets Moving Across Zones - An RFID Example
23.11. StockTicker
23.12. MatchMaker
23.13. Named Window Query
23.14. Sample Virtual Data Window
23.15. Sample Cycle Detection
23.16. Quality of Service
23.17. Trivia Geeks Club
24. Performance
24.1. Big O Notation
24.1.1. Big-O Complexity of Matching Events to Statements and Context Partitions
24.1.2. Big-O Complexity of Matching Time to Statements and Context Partitions
24.1.3. Big-O Complexity of Joins, Subqueries, On-Select, On-Merge, On-Update, On-Delete
24.1.4. Big-O Complexity of Enumeration Methods
24.1.5. Big-O Complexity of Aggregation Methods
24.2. Performance Tips
24.2.1. Understand How to Tune Your Java Virtual Machine
24.2.2. Input and Output Bottlenecks
24.2.3. Threading
24.2.4. Select the Underlying Event Rather Than Individual Fields
24.2.5. Prefer Stream-Level Filtering Over Where-Clause Filtering
24.2.6. Reduce the Use of Arithmetic in Expressions
24.2.7. Remove Unneccessary Constructs
24.2.8. End Pattern Sub-Expressions
24.2.9. Consider Using EventPropertyGetter for Fast Access to Event Properties
24.2.10. Consider Casting the Underlying Event
24.2.11. Turn Off Logging and Audit
24.2.12. Tune or Disable Delivery Order Guarantees
24.2.13. Use a Subscriber Object to Receive Events
24.2.14. Consider Data Flows
24.2.15. High-Arrival-Rate Streams and Single Statements
24.2.16. Subqueries Versus Joins and Where-Clause and Data Windows
24.2.17. Patterns and Pattern Sub-Expression Instances
24.2.18. Pattern Sub-Expression Instance Versus Data Window Use
24.2.19. The Keep-All Data Window
24.2.20. Statement Design for Reduced Memory Consumption - Diagnosing OutOfMemoryError
24.2.21. Performance, JVM, OS and Hardware
24.2.22. Consider Using Hints
24.2.23. Optimizing Stream Filter Expressions
24.2.24. Statement and Runtime Metric Reporting
24.2.25. Expression Evaluation Order and Early Exit
24.2.26. Large Number of Threads
24.2.27. Filter Evaluation Tuning
24.2.28. Context Partition Related Information
24.2.29. Prefer Constant Variables Over Non-Constant Variables
24.2.30. Prefer Object-Array Events
24.2.31. Notes on Query Planning
24.2.32. Query Planning Expression Analysis Hints
24.2.33. Query Planning Index Hints
24.2.34. Measuring Throughput
24.2.35. Do Not Create the Same or Similar Statement X Times
24.2.36. Comparing Single-Threaded and Multi-Threaded Performance
24.2.37. Incremental Versus Recomputed Aggregation for Named Window Events
24.2.38. When Does Memory Get Released
24.2.39. Measure Throughput of Non-Matches as Well as Watches
24.2.40. Options for When an Event Type has a Large Number of Event Properties i.e. Large Events
24.3. Using the Performance Kit
24.3.1. How to Use the Performance Kit
25. References
25.1. Reference List
A. Output Reference and Samples
A.1. Introduction and Sample Data
A.2. Output for Un-Aggregated and Un-Grouped Statements
A.2.1. No Output Rate Limiting
A.2.2. Output Rate Limiting - Default
A.2.3. Output Rate Limiting - Last
A.2.4. Output Rate Limiting - First
A.2.5. Output Rate Limiting - Snapshot
A.3. Output for Fully-Aggregated and Un-Grouped Statements
A.3.1. No Output Rate Limiting
A.3.2. Output Rate Limiting - Default
A.3.3. Output Rate Limiting - Last
A.3.4. Output Rate Limiting - First
A.3.5. Output Rate Limiting - Snapshot
A.4. Output for Aggregated and Un-Grouped Statements
A.4.1. No Output Rate Limiting
A.4.2. Output Rate Limiting - Default
A.4.3. Output Rate Limiting - Last
A.4.4. Output Rate Limiting - First
A.4.5. Output Rate Limiting - Snapshot
A.5. Output for Fully-Aggregated and Grouped Statements
A.5.1. No Output Rate Limiting
A.5.2. Output Rate Limiting - Default
A.5.3. Output Rate Limiting - All
A.5.4. Output Rate Limiting - Last
A.5.5. Output Rate Limiting - First
A.5.6. Output Rate Limiting - Snapshot
A.6. Output for Aggregated and Grouped Statements
A.6.1. No Output Rate Limiting
A.6.2. Output Rate Limiting - Default
A.6.3. Output Rate Limiting - All
A.6.4. Output Rate Limiting - Last
A.6.5. Output Rate Limiting - First
A.6.6. Output Rate Limiting - Snapshot
A.7. Output for Fully-Aggregated, Grouped Statements With Rollup
A.7.1. No Output Rate Limiting
A.7.2. Output Rate Limiting - Default
A.7.3. Output Rate Limiting - All
A.7.4. Output Rate Limiting - Last
A.7.5. Output Rate Limiting - First
A.7.6. Output Rate Limiting - Snapshot
B. Runtime Considerations for Output Rate Limiting
B.1. For Un-Aggregated and Un-Grouped Statements
B.1.1. Output Last
B.1.2. Output All
B.2. For Fully Aggregated and Un-Grouped Statements
B.2.1. Output Last
B.2.2. Output All
B.3. For Aggregated and Un-Grouped Statements
B.3.1. Output Last
B.3.2. Output All
B.4. For Fully Aggregated and Grouped Statements (Includes Rollup)
B.4.1. Output Last
B.4.2. Output All
B.5. For Aggregated and Grouped Statements
B.5.1. Output Last
B.5.2. Output All
C. Reserved Keywords
D. Event Representation: Plain-Old Java Object Events
D.1. Overview
D.2. Java Object Event Properties
D.3. Property Names
D.4. Parameterized Types
D.5. Setter Methods for Indexed and Mapped Properties
D.6. Superclasses and Interfaces
E. Event Representation: java.util.Map Events
E.1. Overview
E.2. Map Properties
E.3. Map Supertypes
E.4. Advanced Map Property Types
E.4.1. Nested Properties
E.4.2. One-to-Many Relationships
F. Event Representation: Object-Array (Object[]) Events
F.1. Overview
F.2. Object-Array Properties
F.3. Object-Array Supertype
F.4. Advanced Object-Array Property Types
F.4.1. Nested Properties
F.4.2. One-to-Many Relationships
G. Event Representation: JSON Events
G.1. Overview
G.2. JSON Event Type
G.3. JSON Object Nesting
G.4. JSON Supported Types
G.4.1. Numeric Types
G.4.2. Boolean Type
G.4.3. String Type
G.4.4. Map Type for Holding an Untyped JSON Object
G.4.5. Object-Array Type for Holding an Untyped JSON Array
G.4.6. Object Type for Holding an Untyped JSON Value (Any JSON Value)
G.5. JSON Application-Provided Class
G.5.1. Class with Public Fields
G.5.2. Application-Provided Enumeration Type
G.6. JSON Dynamic Event Properties
G.7. API for Parsing JSON Documents
G.8. API for Building JSON Documents
G.9. Customizing JSON Serializing and Deserializing
G.10. Customizing the JSON Event Class
G.11. Limitations
H. Event Representation: Avro Events (org.apache.avro.generic.GenericData.Record)
H.1. Overview
H.2. Avro Event Type
H.3. Avro Schema Name Requirement
H.4. Avro Field Schema to Property Type Mapping
H.5. Primitive Data Type and Class to Avro Schema Mapping
H.6. Customizing Avro Schema Assignment
H.7. Customizing Class-to-Avro Schema
H.8. Customizing Object-to-Avro Field Value Assignment
H.9. API Examples
H.10. Limitations
I. Event Representation: org.w3c.dom.Node XML Events
I.1. Overview
I.2. Schema-Provided XML Events
I.2.1. Getting Started
I.2.2. Property Expressions and Namespaces
I.2.3. Property Expression to XPath Rewrite
I.2.4. Array Properties
I.2.5. Dynamic Properties
I.2.6. Transposing Properties
I.2.7. Event Sender
I.2.8. Limitations
I.3. No-Schema-Provided XML Events
I.4. Explicitly-Configured Properties
I.4.1. Simple Explicit Property
I.4.2. Explicit Property Casting and Parsing
I.4.3. Node and Nodeset Explicit Property
I.5. Using XML-Schema Annotations with create xml schema
J. NEsper .NET -Specific Information
J.1. .NET General Information
J.2. .NET and Annotations
J.3. .NET and Locks and Concurrency
J.4. .NET and Threading
J.5. .NET and Timer
J.6. .NET NEsper Configuration
J.7. .NET Event Underlying Objects
J.8. .NET Object Events
J.9. .NET IDictionary Events
J.10. .NET XML Events
J.11. .NET Event Objects Instantiated and Populated by Insert Into
J.12. .NET Basic Concepts
J.13. .NET EPL Syntax - Data Types
J.14. .NET Accessing Relational Data via SQL
J.15. .NET API - Receiving Statement Results
J.16. .NET API - Adding Listeners
J.17. .NET Configurations - Relational Database Access
J.18. .NET Configurations - Logging Configuration
Index
Next
Preface