Skip to content
Dan Debrunner edited this page Apr 25, 2017 · 25 revisions

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. 'idvalues used start with_splas a unofficial claimed namespace.text` is usually a representation of a JSON object unless it is clear only a single value is ever needed.

Source location

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 to api.method.

Example

@spl_note(id="__spl_sourcelocation", text="{\"file\":\"quick.py\",\"method\":\"main\",\"line\":15,\"topology.method\":\"source\"}")

## Stream type
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: