|
||||||||||||
|
Using the Event Processing Language
An EPL statement uses Data Providers to access persistent data using the same syntax as streams. EPL functionality uses SQL-like conditions. For example, Logical conditions include AND OR XOR NOT TRUE … Comparison conditions use the standard SQL > < = != <= >=. Math conditions include + - / * % ^ &, and the Grouping condition ( ). EPL uses time-based analysis via data batches, calendar synchronization and scheduling. EPL also uses aggregation, which includes branch (or fork), for example STOCKS [SYMBOL=*] .MEAN ('PRICE'); asynchronous stream joins; 1:N, N:N joins; and sorting and filtering. Accessing Streams Further, every stream can be used for input and output. For example, in the EPL statement in Figure 2, the stream TRADES provides the input and the data for the condition. In the THEN part, the event definition creates new events and pushes them to the ALERTS stream.
A stream is defined using an EPL statement, CREATE STREAM with similar syntax to the SQL CREATE TABLE statement. The stream is a tabular data structure, and like an SQL table has named fields with data types. A stream can also accept Java Beans as input. In all cases, the syntax of EPL is identical, for accessing a field within a stream. When doing STREAM.FIELD, you use a JavaBean property. XML streams use XML schema for the stream definition. Again, the same STREAM.FIELD syntax is used to access individual fields within the XML. Using WHEN Using Views Using Functions Using Data Providers Creating Data Schemas for Event Streams A stream can also use Java Beans for event data. A stream that uses Java Beans does not need to specify the list of fields and their types. They are already defined in the Bean. Using this method an application sends Java objects directly to the event server with no additional data mapping and integration. You can define a stream by an XML schema. Access to the stream data in an event definition is identical, regardless of the schema of the stream. Data providers are defined in a similar way, plus additional configuration parameters that are required to connect the data provider to an underlying data source. The data provider configuration contains the configuration properties, as well as the data schema for the data provider.
|
||||||||||||
|