Operator AddSeq

Toolkits > com.ibm.streamsx.topology.pysamples 1.1.0 > com.ibm.streamsx.topology.pysamples.positional > AddSeq

Add a sequence number as the last attribute.

Python

@spl.map()
class AddSeq(object):
    """Add a sequence number as the last attribute."""
    def __init__(self):
        self.seq = 0

    def __call__(self, *tuple_):
        id = self.seq
        self.seq += 1
        return tuple_ + (id,)

Summary

Ports
This operator has 1 input port and 1 output port.
Windowing
This operator does not accept any windowing configurations.
Parameters
This operator does not support parameters.
Metrics
This operator does not report any metrics.

Properties

Implementation
C++
Threading
Always - Operator always provides a single threaded execution context.

Input Ports

Ports (0)

Tuple attribute values are passed by position to the Python callable.

Properties

Output Ports

Assignments
This operator does not allow assignments to output attributes.
Ports (0)

Properties

Libraries

SPLPY header
Include Path: ../../opt/.splpy/include
Python libraries.
Command: ../../opt/.splpy/common/pyversion3.sh