The operator
sample group provides one small EventFlow
application for each operator and most data constructs in the Palette view in
StreamBase Studio.
-
An operator is a StreamBase processing unit that performs predefined work on streaming data, such as aggregating windows of data streams, merging streams, or retrieving shared data from a table.
-
A data construct is a component that can store information from a stream or from an external data source that can then be used by an associated StreamBase operator. Samples to illustrate data constructs are at the end of the following table.
Each sample has a separate README that describes the steps to run that sample.
Component Sample | Description |
---|---|
Operator Samples | |
Aggregate Operator Time Dimension Sample | Demonstrates an Aggregate operator using a time-based dimension. |
Aggregate Operator Tuple Dimension Sample | Demonstrates an Aggregate operator using a tuple-based dimension. Calculates a moving average of price for each of four successive trades of a given stock. |
Aggregate Operator Field Dimension Sample | Demonstrates an Aggregate operator using a field-based dimension. Sums the volume of trades in a particular stock over 30-second windows, advancing every 30 seconds. |
Aggregate Operator Predicate Dimension Sample | Demonstrates an Aggregate operator with a predicate-based dimension. |
Aggregate Operator Two-Dimension Sample | Demonstrates an Aggregate operator with two dimensions. |
BSort Operator Sample | Uses a BSort operator to reorder trades by time for an input stream where trades arrive in random order. It is instructive to compare the results of running this application with two passes versus six passes. |
Extension Point Operator Sample | This sample uses an Extension Point operator to dispatch tuples based on a user-specified action to one of two modules, which double or triple an integer field within the tuple. If no action is specified, the tuple is sent to both modules. This sample illustrates StreamBase interfaces used with the Extension Point operator, and illustrates module dispatch based on a predicate condition. |
Extension Point Deployment Sample |
This sample is a variation on the Extension Point operator sample to
illustrate the use of StreamBase deployment files. The StreamBase interface
in this sample specifies externally defined modules. Two example .sbdeploy files are provided, which you use to run this
sample.
|
Filter Operator Sample | Uses a Filter operator to pass only trades of 10,000 shares or more. |
Gather Operator Sample | Uses a Gather operator to generate an alarm (a "true") for trades of 10,000 shares or more for a stock whose price is $200 or greater. |
Heartbeat Aggregate Sample | Uses a Heartbeat operator to output the number of stock quotes received every five seconds. The actual counting is done by an Aggregate operator, but it relies on the Heartbeat to trigger output during periods when no quotes are received. |
Heartbeat Merge Sample | Uses two Heartbeat operators to prevent a Merge operator from starving when either of its inputs stop receiving tuples. |
Iterate Operator Sample |
Uses an Aggregate operator and the aggregatelist() expression language function to aggregate
incoming tuples and collect them into three-element lists of tuples, so that
every list output contains three input tuples of the same stock. An Iterate operator then
takes these lists, extracts their component tuples, and feeds them to a Map
operator, which reorders the output fields.
|
Join Operator Sample | Uses a Join operator to combine trades from a Reuters data feed and a feed from Interactive Data PlusFeed (formerly Comstock), where the stocks are the same and the price per share is greater than or equal to $1, over a period of 60 seconds. |
Lock and Unlock Operators Sample | Uses paired Lock and Unlock operators to protect shared data against concurrent writes. The sample is intended only to demonstrate how to protect the data, and does not include other concurrent operations which might access the data. Other concurrent operations could derive from data on different streams sharing the Query Table, or they could be generated by tuples on the same stream, which would have to wait for the tuple being protected by the Lock clearing the Unlock. (There would be additional operators between the Lock and Unlock operator to process the data.) This example uses the same key for both the key into the Query Table and the key on which to lock for exclusive access. |
Map Operator Sample | Uses a Map operator to accept tuples from a comma-separated list, and demonstrates the use of the Map operator to reorder and drop output fields, as well as calculate new output fields. |
Merge Operator Sample | Uses a Merge operator to interlace trades from a Reuters data feed and a feed from Interactive Data PlusFeed (formerly Comstock), based on trade time. |
Metronome Operator Sample | Uses a Metronome operator to output the current share price of all stocks every five seconds. The current prices are stored in a Query Table. |
Pattern Operator Sample | Uses a Pattern operator to pass through only market data for securities that have already been traded. |
Query Operator Sample | Uses a Query Table data construct and Query operators to provide lookup capabilities for the name and description of a stock in the NASDAQ-100 index, given its symbol. |
Query Table Index by Expression Sample | Illustrates the Query Table's index by expression feature. This feature allows you to use an expression as part of specifying the field or fields that comprise a secondary index for a Query Table. |
Query TopN Sample |
Uses a Query
operator to retrieve the first n rows in a b-tree-indexed Query Table, processing
output with Aggregate and Map operators to output the top n values as a list and as separate tuples.
|
Sequence Operator Sample | Uses a Sequence operator to generate unique ID numbers for generic product orders, allowing for easy querying when updating orders. |
Split Operator Sample | Uses a Split operator to explicitly declare the order in which copies of a tuple are processed by downstream components. This type of configuration is seen when a component has a single output port, with multiple output arcs connected to separate downstream paths. |
Union Operator Sample | Uses a Union operator to interlace trades from a Reuters data feed and a feed from Interactive Data PlusFeed (formerly Comstock). |
Data Construct Samples | |
JDBC Table Data Construct Sample |
Contains a JDBC Table
data construct and several Query operators that perform operations on an external database.
This sample is provided in its own entry in the Load
StreamBase Samples dialog, and is not part of the operator sample group.
|