Configuring output ports
You have the following three choices when you configure
the punctuation mode of output ports: Generating
, Free
,
and Preserving
.
An output port is set to Generating
when the operator
inserts punctuation into a stream according to its own logic. One
example is the Aggregate operator from the SPL
Standard Toolkit, which inserts a window marker into the output stream
after each aggregation. Operators that generate window punctuation
must not forward incoming window punctuation. Generated and forwarded punctuation
cannot be differentiated, which causes the loss of semantics of window punctuation.
The output port configuration must be Free
of
window punctuation when the operator logic does not generate window punctuation,
and the operator cannot forward incoming punctuation due to the loss
of punctuation semantics. This situation generally arises when the
operator has multiple input ports and the processing logic merges
the incoming streams. Two such examples from the SPL Standard Toolkit
are the Union and the Barrier operators.
If these operators were to forward window punctuation, operators downstream
would not be able to distinguish from which stream the punctuation
originally came from.
The operator must have a Preserving
output port
when it does not generate window punctuation itself but instead it
preserves the semantics of the incoming punctuation. If the operator
has more than one input port, developers must preserve punctuation
from only one port so downstream operators know the semantics of window punctuation.
The input port that is used for forwarding must also be indicated
in the operator model. One example of this scenario is the Gate operator
from the SPL Standard Toolkit. This operator has a data input port
and a control input port. Gate forwards window punctuation
from the data input port only, preserving their semantics from the
incoming stream. Developers of primitive operators that preserve window
markers must always code the forwarding logic.