#BUFFERPLACEMENT
This command is used to control how buffers are (automatically) placed within the query plan if a query is transformed (e.g. by #QUERY).
Parameters
The parameter is the name of a buffer placement strategy. Since the strategies are dynamically loaded, the availability of certain strategies depends on the current system setting (which features are installed and which not). Some possible stragies are shown in the examples.
Examples
No buffers:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#BUFFERPLACEMENT None |
Adds a buffer before each operator:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#BUFFERPLACEMENT Standard Buffer Placement |
Adds a buffer after each source:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#BUFFERPLACEMENT Source Buffer Placement |
Adds a buffer for each query:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#BUFFERPLACEMENT Query Buffer Placement |
#CONFIG
Allows to define additional processing informations, e.g. IsSecurtyAware.
...
This command is used to define variables to reuse certain values. See also at Variables how to use a defined variable or at #IFDEF to see how to use defined variables within if-statements.
Parameters
The parameters are one or two values, which are separated by a blank or tab. Therefore, the parameters may not have any blanks or tabs. The first parameter is the name and the second paramter is the value that is assigned to the name. However, the second parameter (the value) is optional, because it a value for #IFDEF is not necessary, otherwise it cannot be used for replacement.
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#DEFINE one #DEFINE two 1234 |
...
This command switches the query sharing (which tries to optimize a query be reusing parts of already installed query plans) on or off.
Parameters
The parameter is a boolean: the parameter may be either "true" or "false".
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
/// query sharing off
#DOQUERYSHARING false
/// query sharing on
#DOQUERYSHARING true |
#DOREWRITE
This command switches the rewriting (tries to optimize a query plan by switching, deleting, splitting or merging operators without changing the query's semantics) on or off.
Parameters
The parameter is a boolean: the parameter may be either "true" or "false".
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
/// query rewrite off
#DOREWRITE false
/// query rewrite on
#DOREWRITE true |
#DROPALLQUERIES
This command drops all installed queries. It does not remove andy sources or sinks, but you can use #DROPALLSINKS or #DROPALLSOURCES for this.
Parameters
It has no parameters.
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#DROPALLQUERIES |
#DROPALLSINKS
This command drops all installed sinks. It does not remove andy queries or sources, but you can use #DROPALLQUERIES or #DROPALLSOURCES
Parameters
It has no parameters.
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#DROPALLSINKS |
#DROPALLSOURCES
This command drops all installed sources. It does not remove andy queries or sinks, but you can use #DROPALLQUERIES or #DROPALLSINKS
Parameters
It has no parameters.
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#DROPALLSOURCES |
#EVAL
It behaves like #DEFINE, except it evaluates the expression to a result, which is then stored in the specified variable.
Parameters
The parameters are two values, which are separated by a blank, tab or "=". Therefore, the parameters may not have any blanks or tabs. The first parameter is the name and the second paramter is the expression, whose value is assigned to the name.
Example
The first variable is called "aNumber" and is a normal #DEFINE. "bNumber" gets the evaluated result of "aNumber + 2000": "3000". "cNumber" demonstrates an alternative way to specify new variables (omitting "=").
...
Code Block |
---|
#INPUT ${WORKSPACEPROJECT/}Source.qry #INCLUDE http://odysseus.offis.uni-oldenburg.de/download/test/StreamSources.qry |
#LOGIN
Changes the login that is used by other commands like #QUERY
Parameters
There are two parameters: the username and the password.
Example
This example changes the user to "System" with password "manager"
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#LOGIN System manager |
#LOGOUT
Logs the current used user out
Parameters
Has no parameters
Example
| ||||||
#LOGOUT |
#MDASTORE_DROP
This command drops an existing MDA store. See MDA store functions.
Parameters
The name for the store.
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#MDASTORE_DROP MyStore |
...
This command creates a new MDA store. See MDA store functions.
Parameters
- The name for the store
- A list of the dimensions for the MDA store. Each dimension must contain the following information separated by colons:
- The lower border for the dimension
- The upper border for the dimension
- The number of borders for the dimension (incl. lower and upper)
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#MDASTORE_INIT MyStore 0:200:3 100:300:5 |
#METADATA
In the default processing scenario, all elements in Odysseus are tagged with time stamp meta data. This command can be used to define the meta data.
Hint: This flag overwrites the standard configuration so you must provide all metadata that should be used!
Example
Code Block |
---|
#METADATA TimeInterval
#METADATA Latency
#METADATA Priority |
Remark: There are some combined metadata elements available: e.g. IntervalLatency or IntervalLatencyPriority
#ODYSSEUS_PARAM
Can be used to set internal Odysseus configuration params. This should be only
Parameters
The parameters are: The name of the Odysseus configuration param and the new value
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#ODYSSEUS_PARAM scheduler_TimeSlicePerStrategy 10 |
#OPTIMIZE_PREDICATES
Enable predicate optimization for the current query. The optimizer tries to simplify the predicates used in select operations and transforms the predicate into its conjunctive normal form to move clauses in the expression down to the sources.
Example
Code Block | |
---|---|
language | javascript |
theme | Eclipse | linenumbers | true
#OPTIMIZE_PREDICATES true |
For debugging purpose the values of variables that are defined using #DEFINE or arbitrary expressions can be printed to the std output using #PRINT.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#DEFINE path F:/odysseus/example/ #PRINT path #PRINT "Running on "+toString(OS.NAME) |
#PARSER
This command sets the current parser for following commands, e.g. by #QUERY or #ADDQUERY. The according parser is used until another parser is set.
Parameters
The parser: Which parsers are available strongly depends on the current system setting and installed features. Normally in the default product, there is "PQL" for Procedural Query Language (PQL) and "CQL" for Continuous Query Language (CQL).
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#PARSER PQL |
#QName
Set the name of the following query.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#QNAME Query1 |
#QPARAM
Some special processing could require query specific processing.This command can be used to set these parameters as key value pairs.
Code Block |
---|
#QPARAM key1 value1
#QPARAM key2 value2
#QPARAM key3 value3 |
#QPRIORITY
Set the priority of the next following query
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#QPRIORITY 10 |
#QUERY
This command executes a query in a certain language. This might be, for example Procedural Query Language (PQL) or Continuous Query Language (CQL). There are three different commands to execute such a query: #QUERY, #ADDQUERY and #RUNQUERY. While #QUERY and #ADDQUERY (they are one and the same) only passes the definied query to Odysseus, the #RUNQUERY additionally starts the query. This means, a query that was added with #QUERY or #ADDQUERY is inactive and not started until it is explicetely started. The #RUNQUERY in contrast immediatly starts a query after it is added, e.g. by using #STARTQUERIES .
Parameters
The query command is dependent on the current parser (which is set by #PARSER) and the current transformation configuration (which is set by #TRANSCFG). Therefore, it is necessary to run these two commands before. Furthermore, you can switch to other parsers / transformation within one script by using #PARSER or #TRANSCFG again. Thus, if you want to run a query in CQL that last #PARSER command before should set the parser to "CQL".
If #QName is defined before, the query will get this name.
Example
The example shows four queries after the parser is set to CQL and the transformation configuration is set to Standard. The first one uses #QUERY and it is executed as a CQL-Query, but not started. The second query is equal to the first one (it still uses CQL and is not started). The third query also uses CQL and the Standard transformation configuration, but is (in contrast to the first and second) started (it is directly running). Then, the parser is switched to PQL, so that the fourth query is parsed by the PQL-Parser and not by the CQL-Parser anymore.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#PARSER CQL
#TRANSCFG Standard
#QUERY
SELECT * FROM bid
#ADDQUERY
SELECT * FROM bid
#RUNQUERY
SELECT * FROM bid
#PARSER PQL
#QUERY
result = PROJECT({ATTRIBUTES=['id','name']}, person) |
#RELOADFROMLOG
The reload log is a file that logs all queries that were sucessfully installed into the system. This command can be used to run these logged queries from the log, e.g. to recreat an old ystem state.
Parameters
This command has no parameters.
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#RELOADFROMLOG |
#RUNQUERY
...
#SCHEDULER
Sets the used scheduler and its scheduling strategy.
Parameters
It needs two parameters: The scheduler and the scheduling-strategy. The available schedulers and strategies depends on the current system setting (additional features could be necessary!), because they are dynamically bound.
Example
Uses the "Single Thread Scheduler" with a "Round Robin" scheduling strategy
...
This command can be used to wait a certain time before executing the next command
Parameters
The parameter is a number. It defines the time in milliseconds for which the script execution should sleep.
Example
Waiting 2 seconds (2000 milliseconds) until the next command is invoked.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#SLEEP 2000 |
...
This command starts all installed queries that are not running at the moment.
Parameters
This command has no parameters.
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#STARTQUERIES |
#STARTSCHEDULER
This command starts the scheduling.Notice that the scheduling strongly influences the processing and should be carefully used. The scheduler is running by default. You can stop it by using #STOPSCHEDULER
Parameters
This command has no parameters.
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#STARTSCHEDULER |
...
This command stops the scheduling.Notice that the scheduling strongly influences the processing and should be carefully used. The scheduler is running by default. You can start it by using #STARTSCHEDULER
Parameters
This command has no parameters.
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#STOPSCHEDULER |
#TRANSCFG
This command sets the transformation configuration for following commands. The transformation configuration defines how a query is transformed into an executable plan. The transformation configuration that was set is used until another configuration is explicitly set.
Parameters
The configuration: Which configruations are available strongly depends on the current system setting and installed features. Normally in the default product, there is "Standard" for the default transformation configuration. If the latency feature is installed, there is also "StandardLatency" available, which invokes specific transformations so that the latency is automatically calculated.
Remark: For most cases, this parameter is not needed anymore. Use #METADATA if you want to attach additional metadata. Use #CONFIG to define distinct aspects.
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#TRANSCFG Standard |
#UNDEF
This command sets the transformation configuration for following commands. The transformation configuration defines how a query is transformed into an executable plan. The transformation configuration that was set is used until another configuration is explicitly set.
Parameters
The configuration: Which configruations are available strongly depends on the current system setting and installed features. Normally in the default product, there is "Standard" for the default transformation configuration. If the latency feature is installed, there is also "StandardLatency" available, which invokes specific transformations so that the latency is automatically calculated.
Example
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#UNDEF variable |