Query can be modified via Odysseus script. For this, the queries must be named. A query can be named with #QNAME:
#PARSER CQL #QNAME query1 #ADDQUERY SELECT * FROM nexmark:person
#STARTQUERY
This command can be used to start a named query.
#STARTQUERY query1
#STOPQUERY
This command can be used to stop a nazmed query.
#STOPQUERY query1
#SUSPENDQUERY
This comand can be used to pause a query. Remark: received elements are stored, so this can lead to a memory problem.
#SUSPENDQUERY query1
#PARTIALQUERY
This comand can be used to reduce load of a query by throwing away some received elements. The factor is a number between 0 and 100 where 0 means keep every element and 100 throw away every element
#PARTIALQUERY query1 factor
#RESUMEQUERY
A suspended query can be resumed by this.
#RESUMEQUERY query1
#REMOVEQUERY
Remove a query from the system. Cannot be undone.
#REMOVEQUERY query1
#WAITFORQUERY
With this comand, the execution of a Odysseus Script can be paused until a query is stopped or removed. period in ms states in which time intervals the query should be checked (default is 1000). maxwaitingtime states how should be waited for the query at maxium (default wait forever).
#WAITFORQUERY query1 [period [maxwaitingtime]]
#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
#DROPALLQUERIES
#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:
#BUFFERPLACEMENT None
Adds a buffer before each operator:
#BUFFERPLACEMENT Standard Buffer Placement
Adds a buffer after each source:
#BUFFERPLACEMENT Source Buffer Placement
Adds a buffer for each query:
#BUFFERPLACEMENT Query Buffer Placement
#DOQUERYSHARING
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
/// 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
/// query rewrite off #DOREWRITE false /// query rewrite on #DOREWRITE true