Rapid Prototyping Feature
The Rapid Prototyping Feature allows the usage of data stream processing in arbitrary programming languages. To do so, the feature provides multiple operators that reads a text file with the instructions.
The SCRIPT operator allows the usage of arbitrary so called script languages. Access to the elements of the data stream is available using the public variables attrN (depending on the script language) where N is the index of the attribute. The total number of attributes is available in the attrs variable.
The following script languages are supported by this feature:
To support other languages a JSR 223 ScriptEngine has to be implemented. In addition, you can use the operators JS, PYTHON, RUBY, and GROOVY as an alias for the SCRIPT operator to increase the readability of your query.
This example calls the file script.rb with the following Ruby script to calculate the Fibonacci number of the first attribute value.
You are also free to write a program in Java that will be compiled together with the query.
This example compiles the file Example.java with the following Java program.
You do not need any annotation. The only important thing is the function name "process" with the two parameters and the return type. The program will be compiled on every start of the query so you can just change something in your prototype and restart the query again without restarting the complete Odysseus system.