Versions Compared

Key

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

...

New: All GenericPull sources can have an option scheduler.delay. If this value is given the scheduler waits scheduler.delay milliseconds between two calls. It can be used if the source update rate is known (e.g. a new value is produced every 15 minutes), the source does not allow more than a limited access per timeslot or the delivery rate should be slowed down.

Schema

When defining a new schema the following syntax is supported by the PQL parser:

The schema is a list of attribute definitions. Each attribute is defined in the following way:

  • The first optional entry can be a source name, e.g. nexmark
  • The second required entry is the name of the attribute, e.g. person
  • The third required entry is the datatype of the attribute

With this form, you will get:

Code Block
['bid','price','Double']
or in the short form without a source name
['price','Double']

Additionally, there could be attached arbitrary additional information to an attribute. Currently, only Unit has a fixed sematic as unit. Any other information is not interpreted atm. The additional information can be added by a list of key-value pairs:

Code Block
[['key1','value1'],['key2','value2'],...,['keyN','valueN']]

and this parameter must be the last content of the attribute definition, just before the closing bracket:

Code Block
['price','Double',[['Unit','Dollars'],['Description','The amount of the bid.']]

Transport

This parameter selects the input type of the Wrapper, see Transport Handler for current information.

...

The options field includes additional parameter for the transport and protocol handlers.

Example

 


Code Block
languagejavascript
themeEclipse
titleSender Operator
linenumberstrue
output = SENDER({
wrapper='GenericPush',
transport='TCPClient',
protocol='CSV',
dataHandler='Tuple',
options=[['host', 'example.com'],['port', '8081'],['read', '10240'],['write', '10240']]
}, input)

 


Mapping between CQL and PQL

...

Code Block
languagejava
SELECT * FROM nexmark:person WHERE...

 


Create Sink (sender)

Similar to creating sources for incoming data, you can also create sinks for outgoing data. The notation is very similar to "create stream". Since it is also based on the Access Framework, you can also need different Protocol Handler and Data handler and Transport Handler. For example, the following creates a sink that writes a CSV file:

...

This example would push all data that is produced by "SELECT * FROM nexmark:person WHERE..." into the sink named writeout, which is a file-writer in our case.