-
Notifications
You must be signed in to change notification settings - Fork 43
SPL Annotations
SPL annotations are used to preserve information about the actual application (implemented in Python/Java/Scala) in the SPL graph.
An operator can have multiple @spl.note
annotations, the approach is to use the id
value to indicate what the note represents. id
values used start with __spl_
as a unofficial claimed namespace. text
is usually a representation of a JSON object unless it is clear only a single value is ever needed.
Examples are shown as SPL code, thus text values are shown as SPL string literals.
An operator may be annotated with an @spl.note
that provides information about the applications source the operator corresponds to.
id=__spl_sourcelocation
- text=String representation of a single JSON object or array of JSON objects containing these properties. Note each property is optional.
file: source file name
class: class name
-
method : method name
- Method or function call the api.method was invoked from. -
line: line number in source file
- this is line that the api method was invoked -
topology.method: api method
- The API method used by the application, probably should be renamed toapi.method
.
Example
@spl_note(id="__spl_sourcelocation", text="{\"file\":\"quick.py\",\"method\":\"main\",\"line\":15,\"topology.method\":\"source\"}")
An operator may be annotated with multiple @spl.note
that provide information native type of the stream.
Note that only a subset of ports might have this annotation.
-
id=__spl_nativeType_output_N
- where N is the index of the output port. -
text=native type name
.
Example: