Odysseus provides some special handlers to allow automatic processing of execution parameters. Although they belong to different Metadata features, we will show them here.
Special operators can be used to determine metadata by including special operators with distinct parameters at special points in the query plan (e.g. CalcLatency operator). With this extension you will not need to cope with the integration of operators but let Odysseus do the work. For
this we provide the Odysseus Script Command #PRETRANSFORM which will call different functions that transform the query plan, before the execution starts. The Control Parallelismn Feature has a similar approach.
All the generic parameter can be used in the following three Evaluation handlers. If no path is given, no output will be created. When using stop* parameters, these should only be part of one of the handlers.
See Latency for more information about this metadata.
Example
#PRETRANSFORM LatencyEvaluation (useMaxLatency=false) (delimmitter=,) (path="I:/tmp/Latencytest/") |
See Data rate for more information about this metadata.
#PRETRANSFORM DatarateEvaluation (updaterate=10) |
See Systemload Metadata for more information about this metadata.
#PRETRANSFORM SystemloadEvaluation |
All the evaluation keywords can be combined:
/// Some examples ///#PRETRANSFORM LatencyEvaluation (useMaxLatency=false) (delimmitter=,) (path="I:/tmp/Latencytest/") ///#PRETRANSFORM DatarateEvaluation (updaterate=10) (delimmitter=,) (path="I:/tmp/Dataratetest/") /// #PRETRANSFORM SystemloadEvaluation (path="I:/tmp/Systemloadtest/") ///#PRETRANSFORM LatencyEvaluation (stopafterelements=10) (stopafterpredicate=TimeInterval.START>10000) #PRETRANSFORM LatencyEvaluation (stopafterelementswritten=10) #PRETRANSFORM DatarateEvaluation (updaterate=10) ///#PRETRANSFORM SystemloadEvaluation ///#PRETRANSFORM AddSender (transport=AMQP) (wrapper=GenericPush) (protocol=CSV) (datahandler=Tuple) (SINK=SENDER) (QUEUE_NAME=nexmark) (CONSUMER_TAG=bid) (HOST=localhost) (writeMetadata=true) #PARSER PQL #RUNQUERY timer = TIMER({PERIOD = 1000, TIMEFROMSTART = true , SOURCE = 'timerSource'}) map = MAP({EXPRESSIONS = ['sleep(1000)']}, timer) |
Sometimes it is helpful to add a Sender operator after the processing to send the data to another receiver. This AddSender cannot be used together with path!
#PRETRANSFORM AddSender (transport=AMQP) (wrapper=GenericPush) (protocol=CSV) (datahandler=Tuple) (SINK=SENDER) (QUEUE_NAME=nexmark) (CONSUMER_TAG=bid) (HOST=localhost) (writeMetadata=true) |
The parameters that can be used are the same as in the Sender operator.