FANIN stage v1.1 |
Pipelines v2.1 |
Syntax |
>>──FANIN──┬───────────────┬──┬─────┬────────────────────────────────────────────────><
│ ┌─<─────────┐ │ ├─ALL─┤
└─┴─streamnum─┴─┘ └─*───┘
Purpose |
Use the FANIN stage to combine multiple input streams into a single output stream. FANIN reads records from all specified input streams and copies the records from each input stream to its primary output stream.
FANIN, without operands, copies all of the records from its primary input stream to its primary output stream, then all of the records from its secondary input stream to its primary output stream, and so on, until all of its input streams have been processed. Operands can be specified with FANIN to indicate which input streams are read and the order in which they are read.
Operands |
Streams |
The following streams are used by the FANIN stage:
|
Usage |
1. |
FANIN
does not delay the records. |
2. |
If the
FANIN stage discovers that its primary output stream is not connected, the
FANIN stage ends. |
3. |
FANIN can cause a set of pipelines
to stall if: Two or more input streams
originate in the same device driver or stream n does not reach the end-of-file because a previous stage is
trying to write to stream n+1. The
following diagram shows how a BUFFER
stage can prevent a pipeline that uses a FANIN stage from stalling. Stream
numbers are shown to identify the streams used. |
4. |
You can also use the FANINANY
stage to prevent a stall. |
5. |
You
do not have to specify all connected input streams with FANIN. For example,
if streams 0, 1, 2, 3 and 4 are connected, you can specify only streams 0, 4
and 2 as in the following FANIN stage: ... | f: fanin 0 4 2 | ... FANIN
does not read any records from streams 1 and 3. However, if you specify the
ALL or *
operand: ... | f: fanin 0 4 2 all | ... all the streams will be read, in
the order: 0, 4, 2, 1, 3. |
6. |
FANIN verifies that its primary output
stream is the only connected output stream and then begins execution. |
Examples |
Related |
BUFFER, ELASTIC, FANINANY, FANOUT
History |
Version |
Date |
Action |
Description |
Pipelines |
1.1 |
24.12.2021 |
changed |
Application-wide rewrite. |
|
1.0 |
06.09.2007 |
created |
First version. |
|