[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Classes
Class | Description | |
---|---|---|
![]() | AddPropertyValueView |
This view simply adds a property to the events posted to it. This is useful for the group-merge views.
|
![]() | GroupByView | The group view splits the data in a stream to multiple subviews, based on a key index.
The key is one or more fields in the stream. Any view that follows the GROUP view will be executed
separately on each subview, one per unique key.
The view takes a single parameter which is the field name returning the key value to group.
This view can, for example, be used to calculate the average price per symbol for a list of symbols.
The view treats its child views and their child views as prototypes. It dynamically instantiates copies
of each child view and their child views, and the child view's child views as so on. When there are
no more child views or the special merge view is encountered, it ends. The view installs a special merge
view unto each leaf child view that merges the value key that was grouped by back into the stream
using the group-by field name.
|
![]() | LastElementView | This view is a very simple view presenting the last event posted by the parent view to any subviews.
Only the very last event object is kept by this view. The update method invoked by the parent view supplies
new data in an object array, of which the view keeps the very last instance as the 'last' or newest event.
The view always has the same schema as the parent view and attaches to anything, and accepts no parameters.
Useful is the last view for example for "stocks.time_window(100).last()".
Notice that "stocks.last().Count" and
"stocks.win:length(10).std:lastevent().std:size()" must always return 0 or 1.
Thus if 5 pieces of new data arrive, the child view receives 5 elements of new data
and also 4 pieces of old data which is the first 4 elements of new data.
I.e. New data elements immediatly gets to be old data elements.
Old data received from parent is not handled, it is ignored.
We thus post old data as follows:
last event is not null +
new data from index zero to N-1, where N is the index of the last element in new data
|
![]() | MergeView | The merge view works together with a group view that splits the data in a stream to multiple subviews, based on
a key index. Every group view requires a merge view to merge the many subviews back into a single view.
Typically the last view in a chain containing a group view is a merge view.
The merge view has no other responsibility then becoming the single last instance in the chain
to which external listeners for updates can be attached to receive updates for the many subviews
that have this merge view as common child views.
The parent view of this view is generally the AddPropertyValueView that adds the grouped-by information
back into the data.
|
![]() | SizeView |
This view is a very simple view presenting the number of elements in a stream or view.
The view computes a single long-typed count of the number of events passed through it similar
to the base statistics COUNT column.
|
![]() | UniqueByPropertyView | This view includes only the most recent among events having the same value for the specified field.
The view accepts the field name as parameter from which the unique values are obtained.
For example, a trade's symbol could be used as a unique value.
In this example, the first trade for symbol IBM would be posted as new data to child views.
When the second trade for symbol IBM arrives the second trade is posted as new data to child views,
and the first trade is posted as old data.
Should more than one trades for symbol IBM arrive at the same time (like when batched)
then the child view will get all new events in newData and all new events in oldData minus the most recent event.
When the current new event arrives as old data, the the current unique event gets thrown away and
posted as old data to child views.
Iteration through the views data shows only the most recent events received for the unique value in the order
that events arrived in.
The type of the field returning the unique value can be any type but should override equals and hashCode()
as the type plays the role of a key in a map storing unique values.
|