28.11.2012 Views

IBM Tivoli NetView for z/OS Programming: Pipes - IBM notice

IBM Tivoli NetView for z/OS Programming: Pipes - IBM notice

IBM Tivoli NetView for z/OS Programming: Pipes - IBM notice

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Introduction and Concepts<br />

Pipeline Stages<br />

2 <strong>Programming</strong>: <strong>Pipes</strong><br />

Imagine a stage as a small black box inserted into the plumbing pipeline described<br />

in Table 1 on page 1. Also, imagine a series of such boxes, all connected serially,<br />

one after the other, throughout the length of the pipeline. Furthermore, imagine<br />

that each box per<strong>for</strong>ms one specific task on the water passing through it: adjust<br />

temperature, remove salt, or add chlorine. Even though each box does only one<br />

thing, the cumulative result is salt-free, temperature-controlled, chlorinated water.<br />

Something similar happens in a <strong>NetView</strong> pipeline: data passes through a stage<br />

which per<strong>for</strong>ms some action on the data. In Figure 1 you can see several stages<br />

linked together to <strong>for</strong>m a pipeline that takes data from a disk, processes it, and<br />

displays it on an operator console.<br />

Disk<br />

File<br />

Stage<br />

1<br />

Figure 1. Stages within a Pipeline<br />

Stage<br />

2<br />

Stage<br />

3<br />

Bit<br />

Bucket<br />

Data in the pipeline is viewed as a series of discrete records called messages. They<br />

are so called because, when read into the pipeline, each record becomes a message<br />

consisting of message text and message attributes.<br />

Figure 2 shows an example of a stage processing messages. Unprocessed messages<br />

enter from the left, the stage reads and processes them, and the output appears on<br />

the right. This is analogous to the operation of one black box in our earlier<br />

plumbing metaphor. Just as in the earlier metaphor, you can string together several<br />

stages, each one driven by the output of a preceding stage and each one<br />

per<strong>for</strong>ming some unique operation on your data.<br />

Input Message 1<br />

Input Message 2<br />

Input Message 3<br />

Stage<br />

Figure 2. Messages Flowing through a Stage<br />

Output Message 1<br />

Output Message 2<br />

In this example, practically anything can happen to the messages: they can be<br />

modified, discarded, split apart, joined together, and so on. Precisely what happens<br />

depends on the stage that is being used. Many stages generate one output message<br />

<strong>for</strong> each input message; some commands do not. In this example, three messages

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!