You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

This document describes the steps to create a new user defined operator with ODL.

Name

First you need to choose a meaningful name for the new operator. Note, there is no other operator with the same name.

Example
operator ODLSelect {
	//...
}

 

Metadata

Next you can set metadata to configure the operator with static information.

Example
operator ODLSelect(outputMode = "INPUT", minInputPorts = 1, maxInputPorts = 1){
    //...
}

The following table shows the available metadata:

MetadataPossible values
outputmode (important)
  • "INPUT"
    • read element wil not be modified
  • "MODIFIED_INPUT" (default)
    • read element will be modified
  • "NEW_ELEMENT"
    • operator creates a new element
persistent
  • true
    • operator will be automatically added to operator framework after each start of Odysseus
  • false (default)
minInputPorts
  • Integer-Value
    • Minimal number of ports that the operator needs
maxInputPorts
  • Integer-Value
    • Maximum number of ports that the operator needs

Please look at the LogicalOperator-Interface of Odysseus for more available metadata (e.g. doc, url, category).

Parameter

You need to define parameters if the operator should be configurable while building a continuous query. A parameter can be optional and consists of a data type and a name.

Example
operator ODLSelect(outputMode = "INPUT", minInputPorts = 1, maxInputPorts = 1){   

    parameter IPredicate predicate;

    optional parameter int heartbeatrate;

}

 

Note that not every data type can be used for a parameter because each data type must have a corresponding parameter class in Odysseus. The following table shows the available data types:

Data typeParameter class
String

StringParameter

FileNameParameter

HttpStringParameter

BooleanBooleanParameter
ByteByteParameter
IntegerIntegerParameter
DoubleDoubleParameter
LongLongParameter
Resource

ResourceParameter

AccessAOSourceParameter

AggregateItem

AggregateItemParameter

BitVector

BitVectorParameter

RenameAttribute

CreateAndRenameSDFAttributeParameter

SDFAttribute

CreateSDFAttributeParameter

ResolvedSDFAttributeParameter

File

ValidatedFileNameParameter

IMetaAttribute

MetaAttributeParameter

IPhysicalOperator

PhysicalOperatorParameter

IPredicate

PredicateParameter

NamedExpression

SDFExpressionParameter

AccessAO

SourceParameter

TimeValueItem

TimeParameter

Some data types have more than one corresponding parameter class. In these cases you can optionally set a parameter class as a metadata of a parameter. Please look at the Parameter-Interface of Odysseus for more available metadata.

Example
operator ODLProject(outputMode ="MODIFIED_INPUT", minInputPorts = 1, maxInputPorts = 1){    
    
    parameter(type=ResolvedSDFAttributeParameter) SDFAttribute[] attributes;
          
}
  • No labels