Field Gather Operator Samples

About The Samples

In this sample, the Spotfire Streaming Field Gather operator to gather fields from multiple tuples into a single filled tuple.

Importing This Sample into StreamBase Studio

In StreamBase Studio, import this sample with the following steps:

  • From the top-level menu, select File>Import Samples and Community Content.

  • Enter field g to narrow the list of options.

  • Select Field Gather Operator from the Data Constructs and Operators category.

  • Click Import Now.

StreamBase Studio creates a single project containing the sample files.

Running The Field Gather Samples

AggregateInterval Sample

In the AggregateInterval sample, the Spotfire Streaming® Field Gather operator is configured to gather tuple fields over a 1 second window averaging the inputs over that time and producing a single output tuple per second.

  1. In the Project Explorer view, open this sample's folder.

    Keep an eye on the bottom right status bar of the Studio window. Make sure any Updating, Downloading, Building, or Rebuild project messages finish before you proceed.

  2. Open the src/main/eventflow/packageName folder.

  3. Double-click to open the FieldGather_AggregateInterval.sbapp module. Make sure the module is the currently active tab in the EventFlow Editor.

  4. Click the Run button. This opens the SB Test/Debug perspective and starts the module.

  5. In the Feed Simulations view, select the available feed simulation and click the Run button.

  6. In the Output Streams view, observe tuples emitted on the DataOut output stream.

  7. Press F9 or click the Stop Running Application button.

AllSelected Sample

In the AllSelected sample, the Spotfire Streaming® Field Gather operator is configured to gather tuple fields and output a tuple only when the values change for all the selected fields, which in this sample are the Temperature and Voltage fields.

  1. In the Project Explorer view, open this sample's folder.

    Keep an eye on the bottom right status bar of the Studio window. Make sure any Updating, Downloading, Building, or Rebuild project messages finish before you proceed.

  2. Open the src/main/eventflow/packageName folder.

  3. Double-click to open the FieldGather_AllSelected.sbapp module. Make sure the module is the currently active tab in the EventFlow Editor.

  4. Click the Run button. This opens the SB Test/Debug perspective and starts the module.

  5. In the Feed Simulations view, select the available feed simulation and click the Run button.

  6. In the Output Streams view, observe tuples emitted on the DataOut output stream.

  7. Press F9 or click the Stop Running Application button.

AnySelected Sample

In the AnySelected sample, the Spotfire Streaming® Field Gather operator is configured to gather tuple fields and output a tuple only when the values change for any of the selected fields, which in this sample are the Temperature and Voltage fields.

  1. In the Project Explorer view, open this sample's folder.

    Keep an eye on the bottom right status bar of the Studio window. Make sure any Updating, Downloading, Building, or Rebuild project messages finish before you proceed.

  2. Open the src/main/eventflow/packageName folder.

  3. Double-click to open the FieldGather_AnySelected.sbapp module. Make sure the module is the currently active tab in the EventFlow Editor.

  4. Click the Run button. This opens the SB Test/Debug perspective and starts the module.

  5. In the Feed Simulations view, select the available feed simulation and click the Run button.

  6. In the Output Streams view, observe tuples emitted on the DataOut output stream.

  7. Press F9 or click the Stop Running Application button.

Expression Sample

In the Expression sample, the Spotfire Streaming® Field Gather operator is configured to gather tuple fields and output a tuple only when the given StreamBase expression returns a true result. In this sample, the expression requires the Temperature to be greater than 60 or the Pressure to be greater than 25.

  1. In the Project Explorer view, open this sample's folder.

    Keep an eye on the bottom right status bar of the Studio window. Make sure any Updating, Downloading, Building, or Rebuild project messages finish before you proceed.

  2. Open the src/main/eventflow/packageName folder.

  3. Double-click to open the FieldGather_Expression.sbapp module. Make sure the module is the currently active tab in the EventFlow Editor.

  4. Click the Run button. This opens the SB Test/Debug perspective and starts the module.

  5. In the Feed Simulations view, select the available feed simulation and click the Run button.

  6. In the Output Streams view, observe tuples emitted on the DataOut output stream.

  7. Press F9 or click the Stop Running Application button.

Interval Sample

In the Interval sample, the Spotfire Streaming® Field Gather operator is configured to gather tuple fields over a 1 second window with all new input tuples values overwriting any previous values and producing a single output tuple per second.

  1. In the Project Explorer view, open this sample's folder.

    Keep an eye on the bottom right status bar of the Studio window. Make sure any Updating, Downloading, Building, or Rebuild project messages finish before you proceed.

  2. Open the src/main/eventflow/packageName folder.

  3. Double-click to open the FieldGather_Interval.sbapp module. Make sure the module is the currently active tab in the EventFlow Editor.

  4. Click the Run button. This opens the SB Test/Debug perspective and starts the module.

  5. In the Feed Simulations view, select the available feed simulation and click the Run button.

  6. In the Output Streams view, observe tuples emitted on the DataOut output stream.

  7. Press F9 or click the Stop Running Application button.

Sample Location

When you load the sample into StreamBase® Studio, Studio copies the sample project's files to your Studio workspace, which is normally part of your home directory, with full access rights.

Important

Load this sample in StreamBase® Studio, and thereafter use the Studio workspace copy of the sample to run and test it, even when running from the command prompt.

Using the workspace copy of the sample avoids permission problems. The default workspace location for this sample is:

studio-workspace/sample_fieldgather

See Default Installation Directories for the default location of studio-workspace on your system.