Define the new stream and operator details

Now, you need to define the schema for the stream from the DirectoryScan and tell that operator where to look for files. The Observations operator now gets its instructions from an input stream rather than a static parameter, so you have to adjust its configuration. Finally, you need to tell the Throttle the desired flow rate.

The DirectoryScan operator’s output port supports only one schema: a single attribute of type rstring, which will hold the full path to the file. You can call that attribute anything you like.

  1. Select the output stream from DirectoryScan_4 and rename it to Files.
  2. In the Schema tab in the Properties view, click the first Name field (placeholder varName) and enter file.
  3. Press the Tab key to move to the next field (placeholder varType) and enter rstring. Remember to use content assist (Ctrl+Space) to reduce typing and avoid errors. Press Enter.
  4. In the editor, select the DirectoryScan_4 operator. In the Properties view, go to the Param tab and set the directory parameter to the value "/home/streamsadmin/data". Remember to include the double quotation marks.
  5. Rename the operator (to Files) by removing its alias.
    A FileSource operator knows which file or files to read either from a static parameter (called file) or from the tuples coming in on an input stream, but not both. Now that you are getting file names from a DirectoryScan operator, that file parameter you used previously is no longer needed. You’ll get an error if you keep it.
  6. Select the Observations operator in the editor. In the Properties view (Param tab), click the file parameter and then click Remove.
    The Throttle operator has a mandatory parameter for specifying the desired flow rate. It is a floating-point number with a unit of tuples per second.
  7. In the editor, select Throttled.
  8. In the Properties view (Param tab), click the Value field next to the rate parameter and enter 40.0. The decimal point is necessary to indicate a floating-point value.
  9. Save. There should be no build errors.