Functions -
streams
| avg | Returns a |
| buildStreamEvent | Creates |
| count | Returns a |
| createAndOperatorProcessor | Creates and returns a |
| createCompoundPatternProcessor | Creates and returns a |
| createFilter | Creates a |
| createFollowedByProcessor | Creates and returns a |
| createNotOperatorProcessor | Creates and returns a |
| createOperandProcessor | Creates and returns a |
| createOrOperatorProcessor | Creates and returns a |
| createOrderBy | Creates an |
| createOutputProcess | Creates and return a |
| createResetStreamEvent | Creates a RESET event from a given event. |
| createSelect | Creates and returns a select clause. |
| createStateMachine | Creates and returns a |
| createStreamJoinProcessor | Creates a |
| createTableJoinProcessor | Creates a |
| delay | The |
| distinctCount | Returns a |
| externalTime | The |
| externalTimeBatch | The |
| getStreamEvent | Get the stream event from any? field. This function can only be used only if we are sure that the |
| hopping | The |
| initPersistence | Function to initialize and start snapshotting. |
| length | The |
| lengthBatch | The |
| max | Returns a |
| maxForever | Returns a |
| min | Returns a |
| minForever | Returns a |
| registerSnapshotable | Function to register Snapshotables. |
| removeState | Function to clear an existing state. |
| restoreState | Function to restore state of a given object. |
| sort | The |
| stdDev | Returns a |
| sum | Returns a |
| time | The |
| timeAccum | The |
| timeBatch | The |
| timeLength | The |
| timeOrder | The |
| toSnapshottableEvent | Convert a single |
| toSnapshottableEvents | Converts a given array of streams:StreamEvent objects to an array of |
| toStreamEvent | Convert a single |
| toStreamEvents | Converts a given array of snapshotable events to an array of |
| uniqueLength | The |
Returns a Average aggregator object. The aggregator function name which is used in a streaming query should have the
same name as this function's name.
-
Return Type
(Aggregator) A
Aggregatorobject which performs averaging.
Creates streams:StreamEvent object array for a record t received by the stream denoted by the name streamNme.
Parameters
- t anydata
-
A record received by the stream
streamName.
- streamName string
-
Name of the stream to which the record
tis received.
-
Return Type
(StreamEvent?[]) Returns an array of streams:StreamEvents|()
Returns a Count aggregator object. The aggregator function name which is used in a streaming query should have the
same name as this function's name.
-
Return Type
(Aggregator) A
Aggregatorobject which performs counting.
Creates and returns a AndOperatorProcessor instance.
-
Return Type
(AndOperatorProcessor) A
AndOperatorProcessorinstance.
Creates and returns a CompoundPatternProcessor instance.
Parameters
- withinTimeMillis int? (default ())
-
time from initial state to current state
-
Return Type
(CompoundPatternProcessor) A
CompoundPatternProcessorinstance.
createFilter
( function(StreamEvent?[]) returns (()) nextProcPointer, function(map) returns (boolean) conditionFunc)
Creates a Filter object and return it.
Parameters
-
nextProcPointer
function(StreamEvent?[]) returns (()) -
The function pointer to the
processfunction of the next processor.
-
conditionFunc
function(map) returns (boolean) -
The function pointer to the condition evaluator. This is a function which returns true or false based on the boolean expression given in the where clause.
-
Return Type
(Filter) Returns a
Filterobject.
Creates and returns a FollowedByProcessor instance.
-
Return Type
(FollowedByProcessor) A
FollowedByProcessorinstance.
Creates and returns a NotOperatorProcessor instance.
Parameters
- forTimeMillis int?
-
fortime in milliseconds
-
Return Type
(NotOperatorProcessor) A
NotOperatorProcessorinstance.
createOperandProcessor
(string alias, function(map) returns (boolean) onConditionFunc, int minOccurs, int maxOccurs)
Creates and returns a OperandProcessor instance.
Parameters
- alias string
-
processor alias
-
onConditionFunc
function(map) returns (boolean) -
condition function (i.e [e1.id == id])
- minOccurs int (default 1)
-
minimum occurrences of the event
- maxOccurs int (default 1)
-
maximum occurrences of the event
-
Return Type
(OperandProcessor) A
OperandProcessorinstance.
Creates and returns a OrOperatorProcessor instance.
-
Return Type
(OrOperatorProcessor) A
OrOperatorProcessorinstance.
createOrderBy
( function(StreamEvent?[]) returns (()) nextProcessorPointer, function(map) returns (anydata) [] fields, string[] sortFieldMetadata)
Creates an OrderBy object and return it.
Parameters
-
nextProcessorPointer
function(StreamEvent?[]) returns (()) -
A function pointer to the
processfunction of the next processor.
-
fields
function(map) returns (anydata)[] -
An array of function pointers which each returns a field by which the events are sorted. Events are sorted by the first field, if there are elements of same value, the second field is used and so on.
- sortFieldMetadata string[]
-
sortTypes of the fields (
streams:ASCENDINGorstreams:DESCENDING). First element is the sort type of the first element offieldsand so on.
-
Return Type
(OrderBy) Returns a
OrderByobject.
Creates and return a OutputProcess object.
Parameters
-
outputFunc
function(map[]) returns (()) -
The function pointer to a lambda function created out of the statements in the streaming action
-
Return Type
(OutputProcess) Returns a
OutputProcessobject.
Creates a RESET event from a given event.
Parameters
- event StreamEvent
-
The event from which the reset event is created.
-
Return Type
(StreamEvent) A stream event of type streams:RESET.
createSelect
( function(StreamEvent?[]) returns (()) nextProcPointer, Aggregator[] aggregatorArr, function(StreamEvent) returns (anydata) []? groupbyFuncArray, function(StreamEvent, Aggregator[]) returns (map) selectFunc, string scopeName)
Creates and returns a select clause.
Parameters
-
nextProcPointer
function(StreamEvent?[]) returns (()) -
The function pointer to the
processfunction of the next processor.
- aggregatorArr Aggregator[]
-
The array of aggregators used in the select clause. If the same aggregator is used twice, the
aggregatorArrwill contains that specific aggregator twice in the order they appear in the select clause.
-
groupbyFuncArray
function(StreamEvent) returns (anydata)[]? -
The array of function pointer which contains the lambda function which returns the expressions in the group by clause.
-
selectFunc
function(StreamEvent, Aggregator[]) returns (map) -
The function pointer to a lambda function that creates the
datafield of the output stream event.
- scopeName string (default $scope$name)
-
A unique id to identify the forever block if there are multiple forever blocks.
-
Return Type
(Select) Returns a
Selectobject.
createStateMachine
(CompoundPatternProcessor rootProcessor, function(StreamEvent?[]) returns (()) nextProcPointer)
Creates and returns a StateMachine object.
Parameters
- rootProcessor CompoundPatternProcessor
-
pointer to the root processor
-
nextProcPointer
function(StreamEvent?[]) returns (()) -
pointer for the next processor
-
Return Type
(StateMachine) A
StateMachineobject which performs pattern processing.
createStreamJoinProcessor
( function(StreamEvent?[]) returns (()) nextProcessor, JoinType joinType, function(map, map) returns (boolean) conditionFunc)
Creates a StreamJoinProcessor and returns it.
Parameters
-
nextProcessor
function(StreamEvent?[]) returns (()) -
The
processfunction of the next processor, which can be aSelectprocessor,Aggregatorprocessor,Havingprocessor.. etc.
- joinType JoinType
-
Type of the join being performed ("JOIN"|"LEFTOUTERJOIN"|"RIGHTOUTERJOIN"|"FULLOUTERJOIN")
-
conditionFunc
function(map, map) returns (boolean)(default ()) -
A lambda function which contains the joining condition and return true if the condition satifies the condition.
-
Return Type
(StreamJoinProcessor) Returns a
StreamJoinProcessorobject.
createTableJoinProcessor
( function(StreamEvent?[]) returns (()) nextProcessor, JoinType joinType, function(StreamEvent) returns (map[]) tableQuery)
Creates a TableJoinProcessor and return it.
Parameters
-
nextProcessor
function(StreamEvent?[]) returns (()) -
The function pointer to
processfunction of the next processor, which can be aSelectprocessor,Aggregatorprocessor,Havingprocessor.. etc
- joinType JoinType
-
The type of the join and it can be any value defined by
streams:JoinType.
-
tableQuery
function(StreamEvent) returns (map[]) -
The function pointer to a function which retrieves the records from the table and joins w ith each stream event.
-
Return Type
(TableJoinProcessor) Returns a
TableJoinProcessorobject.
delay
(any[] windowParameters, function(StreamEvent?[]) returns (()) nextProcessPointer)
The delay function creates a DelayWindow object and returns it.
Parameters
- windowParameters any[]
-
Arguments which should be passed with the window function in the streams query in the order they appear in the argument list.
-
nextProcessPointer
function(StreamEvent?[]) returns (())(default ()) -
The function pointer to the
processfunction of the next processor.
-
Return Type
(Window) Returns the created window.
Returns a DistinctCount aggregator object. The aggregator function name which is used in a streaming query should
have the same name as this function's name.
-
Return Type
(Aggregator) A
Aggregatorobject which represents DistinctCount.
externalTime
(any[] windowParameters, function(StreamEvent?[]) returns (()) nextProcessPointer)
The externalTime function creates a ExternalTimeWindow object and returns it.
Parameters
- windowParameters any[]
-
Arguments which should be passed with the window function in the streams query in the order they appear in the argument list.
-
nextProcessPointer
function(StreamEvent?[]) returns (())(default ()) -
The function pointer to the
processfunction of the next processor.
-
Return Type
(Window) Returns the created window.
externalTimeBatch
(any[] windowParameters, function(StreamEvent?[]) returns (()) nextProcessPointer)
The externalTimeBatch function creates a ExternalTimeBatchWindow object and returns it.
Parameters
- windowParameters any[]
-
Arguments which should be passed with the window function in the streams query in the order they appear in the argument list.
-
nextProcessPointer
function(StreamEvent?[]) returns (())(default ()) -
The function pointer to the
processfunction of the next processor.
-
Return Type
(Window) Returns the created window.
Get the stream event from any? field. This function can only be used only if we are sure that the anyEvent is a
streams:StreamEvent.
Parameters
- anyEvent any?
-
The object from which, the stream event is extracted.
-
Return Type
(StreamEvent) Returns the extracted streams:StreamEvent object.
hopping
(any[] windowParameters, function(StreamEvent?[]) returns (()) nextProcessPointer)
The hopping function creates a HoppingWindow object and returns it.
Parameters
- windowParameters any[]
-
Arguments which should be passed with the window function in the streams query in the order they appear in the argument list.
-
nextProcessPointer
function(StreamEvent?[]) returns (())(default ()) -
The function pointer to the
processfunction of the next processor.
-
Return Type
(Window) Returns the created window.
length
(any[] windowParameters, function(StreamEvent?[]) returns (()) nextProcessPointer)
The length function creates a LengthWindow object and returns it.
Parameters
- windowParameters any[]
-
Arguments which should be passed with the window function in the streams query in the order they appear in the argument list.
-
nextProcessPointer
function(StreamEvent?[]) returns (())(default ()) -
The function pointer to the
processfunction of the next processor.
-
Return Type
(Window) Returns the created window.
lengthBatch
(any[] windowParameters, function(StreamEvent?[]) returns (()) nextProcessPointer)
The lengthBatch function creates a LengthBatchWindow object and returns it.
Parameters
- windowParameters any[]
-
Arguments which should be passed with the window function in the streams query in the order they appear in the argument list.
-
nextProcessPointer
function(StreamEvent?[]) returns (())(default ()) -
The function pointer to the
processfunction of the next processor.
-
Return Type
(Window) Returns the created window.
Returns a Max aggregator object. The aggregator function name which is used in a streaming query should
have the same name as this function's name.
-
Return Type
(Aggregator) A
Aggregatorwhich representsMax.
Returns a MaxForever aggregator object. The aggregator function name which is used in a streaming query should
have the same name as this function's name.
-
Return Type
(Aggregator) A
Aggregatorwhich representsMaxForever.
Returns a Min aggregator object. The aggregator function name which is used in a streaming query should
have the same name as this function's name.
-
Return Type
(Aggregator) A
Aggregatorwhich representsMin.
Returns a MinForever aggregator object. The aggregator function name which is used in a streaming query should
have the same name as this function's name.
-
Return Type
(Aggregator) A
Aggregatorwhich representsMainForever.
Function to register Snapshotables.
Parameters
- key string
-
An unique
stringidentifier for the snapshotable reference.
- reference any
-
The snapshotable reference to be registered.
Function to clear an existing state.
Parameters
- key string
-
An unique
stringidentifier for the snapshotable reference.
-
Return Type
(boolean) A
booleanindicating whether the state for the given key removed successfully.
Function to restore state of a given object.
Parameters
- key string
-
An unique
stringidentifier for the snapshotable reference.
- reference any
-
The snapshotable reference to be restored.
sort
(any[] windowParameters, function(StreamEvent?[]) returns (()) nextProcessPointer)
The sort function creates a SortWindow object and returns it.
Parameters
- windowParameters any[]
-
Arguments which should be passed with the window function in the streams query in the order they appear in the argument list.
-
nextProcessPointer
function(StreamEvent?[]) returns (())(default ()) -
The function pointer to the
processfunction of the next processor.
-
Return Type
(Window) Returns the created window.
Returns a StdDev aggregator object. The aggregator function name which is used in a streaming query should
have the same name as this function's name.
-
Return Type
(Aggregator) A
Aggregatorwhich representsStdDev.
Returns a Sum aggregator object. The aggregator function name which is used in a streaming query should have the
same name as this function's name.
-
Return Type
(Aggregator) A
Aggregatorwhich perform addition/summation.
time
(any[] windowParameters, function(StreamEvent?[]) returns (()) nextProcessPointer)
The time function creates a TimeWindow object and returns it.
Parameters
- windowParameters any[]
-
Arguments which should be passed with the window function in the streams query in the order they appear in the argument list.
-
nextProcessPointer
function(StreamEvent?[]) returns (())(default ()) -
The function pointer to the
processfunction of the next processor.
-
Return Type
(Window) Returns the created window.
timeAccum
(any[] windowParameters, function(StreamEvent?[]) returns (()) nextProcessPointer)
The timeAccum function creates a TimeAccumulatingWindow object and returns it.
Parameters
- windowParameters any[]
-
Arguments which should be passed with the window function in the streams query in the order they appear in the argument list.
-
nextProcessPointer
function(StreamEvent?[]) returns (())(default ()) -
The function pointer to the
processfunction of the next processor.
-
Return Type
(Window) Returns the created window.
timeBatch
(any[] windowParameters, function(StreamEvent?[]) returns (()) nextProcessPointer)
The timeBatch function creates a TimeBatchWindow object and returns it.
Parameters
- windowParameters any[]
-
Arguments which should be passed with the window function in the streams query in the order they appear in the argument list.
-
nextProcessPointer
function(StreamEvent?[]) returns (())(default ()) -
The function pointer to the
processfunction of the next processor.
-
Return Type
(Window) Returns the created window.
timeLength
(any[] windowParameters, function(StreamEvent?[]) returns (()) nextProcessPointer)
The timeLength function creates a TimeLengthWindow object and returns it.
Parameters
- windowParameters any[]
-
Arguments which should be passed with the window function in the streams query in the order they appear in the argument list.
-
nextProcessPointer
function(StreamEvent?[]) returns (())(default ()) -
The function pointer to the
processfunction of the next processor.
-
Return Type
(Window) Returns the created window.
timeOrder
(any[] windowParameters, function(StreamEvent?[]) returns (()) nextProcessPointer)
The timeOrder function creates a TimeOrderWindow object and returns it.
Parameters
- windowParameters any[]
-
Arguments which should be passed with the window function in the streams query in the order they appear in the argument list.
-
nextProcessPointer
function(StreamEvent?[]) returns (())(default ()) -
The function pointer to the
processfunction of the next processor.
-
Return Type
(Window) Returns the created window.
Convert a single streams:StreamEvent object to streams:SnapshottableStreamEvent object.
Parameters
- event StreamEvent
-
The
streams:StreamEventobject to be converted to snapshotable event.
-
Return Type
(SnapshottableStreamEvent) The converted
streams:SnapshottableStreamEventobject.
Converts a given array of streams:StreamEvent objects to an array of streams:SnapshottableStreamEvent.
Parameters
- events StreamEvent[] | any[] | ()
-
The events to be coverted to snapshotable events.
-
Return Type
(SnapshottableStreamEvent?[]) Returns the converted snapshotable events.
Convert a single streams:SnapshottableStreamEvent object to streams:StreamEvent object.
Parameters
- event SnapshottableStreamEvent
-
The
streams:SnapshottableStreamEventobject to be converted to a stream event.
-
Return Type
(StreamEvent) The converted
streams:StreamEventobject.
Converts a given array of snapshotable events to an array of streams:StreamEvent objects.
Parameters
- events SnapshottableStreamEvent[] | any[] | ()
-
Snapshotable events to be converted to
streams:StreamEvents.
-
Return Type
(StreamEvent?[]) Returns the converted
streams:StreamEventsobjects array.
uniqueLength
(any[] windowParameters, function(StreamEvent?[]) returns (()) nextProcessPointer)
The uniqueLength function creates a UniqueLengthWindow object and returns it.
Parameters
- windowParameters any[]
-
Arguments which should be passed with the window function in the streams query in the order they appear in the argument list.
-
nextProcessPointer
function(StreamEvent?[]) returns (())(default ()) -
The function pointer to the
processfunction of the next processor.
-
Return Type
(Window) Returns the created window.