Port mutability configuration settings for standard SPL operators
The port mutability configuration settings of the SPL Standard Toolkit operators are based on tuple use and modification.
The following table shows the port mutability
settings for four of the operators included in the SPL Standard Toolkit
and explains the reasons for the settings.
Operator | Input port mutability | Reason | Output port mutability | Reason |
---|---|---|---|---|
Join | Non-mutating | Operator does not modify content of incoming tuples. | Mutating | Operator does not reuse joined tuple after its submission. |
Aggregate | Non-mutating | Operator does not modify content of incoming tuples. | Mutating | Operator does not reuse aggregated tuple after its submission. |
Filter | Non-mutating | Operator does not modify content of incoming tuples. | Non-mutating | Operator forwards incoming tuples without modification. If the output port was mutating, the operator logic would need to make a copy of the tuple content to be able to submit a non-constant version of it. By configuring it as non-mutating, it leaves the copying decision to the SPL runtime. |
Functor | Non-mutating | Operator can modify the tuple content, but it can also change the stream type. Changing the stream type forces the creation of a new tuple. | Mutating | Operator does not use the generated tuple after its submission. |