IBM Streams 4.2.1

Operator Punctor

Primitive operator image not displayed. Problem loading file: ../../image/tk$spl/op$spl.relational$Punctor.svg

The Punctor operator is used to transform input tuples into output ones and add window punctuation to the output.

Checkpointed data

When the Punctor operator is checkpointed, logic state variables (if present) are saved in checkpoint.

Behavior in a consistent region

The Punctor operator can be an operator within the reachability graph of a consistent region. It cannot be the start of a consistent region. In a consistent region, a Punctor operator stores its state when a checkpoint is taken. When the region is reset, the operator restores the state from the checkpoint.

Checkpointing behavior in an autonomous region

When the Punctor operator is in an autonomous region and configured with config checkpoint : periodic(T) clause, a background thread in SPL Runtime checkpoints the operator every T seconds, and such periodic checkpointing activity is asynchronous to tuple processing. Upon restart, the operator restores its state from the last checkpoint.

When the Punctor operator is in an autonomous region and configured with config checkpoint : operatorDriven clause, no checkpoint is taken at runtime. Upon restart, the operator restores to its initial state.

Such checkpointing behavior is subject to change in the future.

Windowing

The Punctor operator does not accept any window configurations.

Assignments

The Punctor operator allows assignments to output attributes. The output tuple attributes whose assignments are not specified are automatically forwarded from the input ones. After the automatic forwarding, the Punctor operator expects all output tuple attributes to be completely assigned.

Examples

This example uses the Punctor operator.

    composite Main {                                             
      graph                                                               
        stream<rstring name, uint32 age, uint64 salary> Beat = Beacon() {}  
        stream<rstring name, uint32 age, rstring login,                                  
           tuple<boolean young, boolean rich> info>                                
         Annotated = Punctor(Beat)                                                   
    {                                                                                     
      param punctuate : age >= 18u;                                                
            position : after; // add a punctuation after the generated tuple,             
                             // if the age is >= 18                                       
      output Annotated : login = lower(name),                                         
                         info  = { young = (age<=30u), rich = (salary>1000000ul) }; 
    }                                                                                     
}  

Summary

Ports
This operator has 1 input port and 1 output port.
Windowing
This operator does not accept any windowing configurations.
Parameters
This operator supports 2 parameters.

Required: position, punctuate

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)

The Punctor operator is configurable with a single input port, which ingests tuples to be punctuated.

Properties

Output Ports

Assignments
This operator allows any SPL expression of the correct type to be assigned to output attributes. Attributes not assigned in the output clause will be automatically assigned from the attributes of the input ports that have the same name and type. If there is no such input attribute, an error is reported at compile-time.
Ports (0)

The Punctor operator is configurable with a single output port, which produces tuples with generated punctuation.

Properties

Parameters

This operator supports 2 parameters.

Required: position, punctuate

position

Specifies the position of the generated window punctuation with respect to the current tuple. The valid values are before and after. If the value is before, the punctuation is generated before the output tuple; otherwise it is generated after the output tuple.

Properties

punctuate

Specifies the condition that determines when a window punctuation is to be generated.

Properties

Code Templates

Punctor
stream<${schema}> ${streamName} = Punctor(${inputStream}) {
            param
                punctuate : ${booleanExpression};
                position: ${beforeOrAfter};
        }