Package com.ibm.streams.operator

Java Operator API for Streams.

See: Description

Package com.ibm.streams.operator Description

Java Operator API for Streams. The main interface for an operator is Operator, an instance of operator acts as a processor of tuples. When an Operator has streaming inputs (ports) incoming tuples are passed into its process method as Tuple objects. An OperatorContext provides information about the context the operator is executing in and access to the method to submit tuples on its streaming outputs.

Java Operators are invoked from a IBM Streams Processing Language (SPL) application either using a Java primitive operator or the generic spl.utility.JavaOp operator from the SPL Standard toolkit.

Java Primitive Operators

A Java primitive operator defines the operator class and its required jar files in its operator model. In addition the operator model defines the syntax for the operator, such as expected parameters, ports and windowing semantics. A Java primitive operator is then is invoked like any other operator within SPL.

JavaOp

A JavaOp operator invocation supports these parameters:
  • generated Optional - A boolean parameter, that if set to true it indicates that the SPL compilation generates classes and interfaces specific to the operator and its ports.
  • className Required - The full class name of the operator that is used to process and submit tuples. The specified class must implement Operator.
  • classLibrary Required - Application specific class path elements required by the operator class, each value corresponds to a single JAR file or a directory containing Java classes.
  • vmArg Optional Command line arguments passed to the invoked Java virtual machine the operator is executed within. Operators that are fused into a single processing element must have equivalent values for vmArg. While Java system properties can be set using vmArg, the preference should be to set them within the operator's code, to avoid incompatible vmArg setting for fusing. Only when a system property is required to be set at JVM startup should it be set using vmArg.
In addition any number of arbitrary constant parameters can be defined that will be handled by the application's operator within the class defined by className.

For full details see the SPL Standard Toolkit reference.