This topic describes the actions you can take on each tab of the Split operator's Properties view.
The Split operator splits its incoming stream into two or more outgoing streams that execute in a guaranteed specific order. Each incoming tuple is sent first to output port 1, then to output port 2, and so on.
By contrast, you can also split the path of execution by drawing multiple arcs from an operator's output ports, as shown in the following illustration.
|
However, in this case, the order in which tuples proceed out the multiple arcs is not known and is not guaranteed. By using a Split operator, you can obtain guaranteed processing order.
|
In the example above, an inbound tuple is first sent to the downstream components connected to the Split operator's Output port #1, the top port. After the processing of that tuple completes on the top path, an exact copy of the inbound tuple is sent out the Split operator's Output port #2 to the bottom path.
How does the Split operator know that a tuple has completed processing along the top path before sending the same tuple out the bottom path? The Split operator does not track the processing undergone by a tuple after it leaves its output ports, and it does not wait for a return value in any way. The processing sequence is guaranteed because, when StreamBase Server compiles the EventFlow application into executable code, it does so in the order in which components are organized in the canvas, and in the order of output port numbers of the Split operator.
The diagram above has red numbers to indicate the processing order of each component. When the server runs this compiled application, it encounters steps 2 and 6 in the Split operator. The server executes in the order 2, 3, 4, and 5 before returning to step 6 and beyond.
Name: Every application component must have a unique name. Use this field to specify or change the component's name. The name must contain only alphabetic characters, numbers, and underscores, and no hyphens or other special characters. The first character must be alphabetic or an underscore.
Enable Error Output Port: Check this box to add an Error Port to this component. In the EventFlow canvas, the Error Port shows as a red output port, always the last port for the component. See Using Error Ports and Error Streams to learn about Error Ports.
Description: Optionally, enter a description to briefly describe the component's purpose and function. In the EventFlow canvas, you can see the description by pressing Ctrl while the component's tooltip is displayed.
Use the Split Settings tab to specify the number of output ports, which correspond to the number of downstream paths that will receive a copy of the tuple in sequence, as in output port number order. Once the output ports are set up, you can then draw an arc from the Split operator's Output port #1 (top port) to the intended downstream path that should receive the tuple first. Then connect the Split operator's Output port #2 to the downstream path that should receive the same tuple second, after the first copy of the tuple was processed to completion. As needed, continue making the connections (in sequence) for each output port and the intended downstream path.
Tip
To easily view the output port numbers, make sure tooltips are enabled, as described in Authoring Preferences. This is especially helpful when you have many output ports and want to be sure you are connecting the arcs as intended. The following illustration shows the cursor is hovering over the top output port on the right side of the Split operator:
|
- Run this component in a separate thread
-
This option causes the server to process the component's requests concurrently with other processing in the application. You can distribute the processing of the threads automatically across multiple processors on an SMP machine.
If this is a compute-intensive component and you know that it can run without data dependencies on other components in the StreamBase application, you may be able to improve performance by enabling this option.
Caution
These features are not suitable for every application. For details, see Execution Order, Concurrency, and Parallelism. It includes important guidelines for the use of these features.
- Run in parallel threads
-
If you checked the first option, you can also choose this option, which causes the server to run multiple instances of this component. That is, each instance runs in its own thread. At run time, tuples are dispatched to particular instances based on the Key Expression value (which must evaluate to an int).
