Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the following we will show different processing scenarios. All scenarios are build with Procedural Query Language (PQL) and for many cases we use the Nexmark scenario (Getting Started with Nexmark). You should also have installed the nexmark source (Simple Query Processing).

All queries defined in Odysseus are data pipelines, i.e. data is received from one operator, processed and send to the next operator. By this, complex processing pipelines can be built.

Pattern 1: Preprocessing

Filtering some events

...

Splitting and combining of attributes in a single stream can be done with the Map operator. This operator allows many different  mathematical expressions over all attributes inside the input stream.

...

Transformation can also be done with the Map operator by applying mathematical functions (see Mathematical Functions and Operators).

Pattern 2: Alerts and Thresholds

This pattern detects a condition and generates alerts based on a condition. (e.g., Alarm on high temperature). These alerts can be based on a simple value or more complex conditions such as rate of increase etc.

In Odysseus generating an altert is simply so create a data pipeline where an element reaches an final operator that sends out the value. E.g. if you use the Select operator to filter out every bid that has a lower price than 400 only bids with a value higher or equals 400 is send to the next operator. An altert can be sending an e-mail (in the following example without authentification at the SMTP server). See Transport Handler for further ways to output values.

Code Block
out = SELECT({
          predicate = 'price >= 400'
        },
        nexmark:bid
      )

mail = SENDER({
            sink='Sink',
            wrapper='GenericPush',
            transport='SMTP',
            protocol='CSV',
            datahandler='Tuple',
            options=[
              ['from','alert@test.de'],
              ['to','receiver@test.de'],
              ['subject','Price Alter'],
              ['host','smtp.server.de'],
              ['tls','false']
            ]
          },
          out
        )

 

 

Pattern 3: Simple Counting and Counting with Windows

...