Changing an exported port's properties
The Export operator is used in the SPL language to export a stream using a set of export properties, which can be modified at run time.
Note: The Java™ Operator
API does not support modifying an imported stream's subscription.
The
export properties of a stream can be updated at runtime only by the
operator that produces the stream. The StreamingOutput
interface
for the exported port contains methods to fetch and add or remove
stream properties. Exported stream properties support a limited number
of SPL types and the supported types and their mapping to Java™ types are shown in the Javadoc™ for StreamingOutput.getStreamProperties()
.Here is an example of adding the stream properties color
(type rstring
,
value orange
) and ranking
(type int64
,
value 3
) to output port 0 (using an Operator
that
extends from AbstractOperator
).
StreamingOutput<OutputTuple> port = getOutput(0);
Map<String,Object> properties = new HashMap<String,Object>();
properties.put("color", "orange");
properties.put("ranking", 3L);
port.addStreamProperties(properties);