ballerina/streams package
Type Definitions
| Type | Values | Description | |
|---|---|---|---|
| EventType | RESET | EXPIRED | CURRENT | ALL |
Records Summary
| Record | Description | ||
|---|---|---|---|
| StreamEvent |
Objects Summary
| Object | Description | ||
|---|---|---|---|
| Aggregator | |||
| Average | |||
| Count | |||
| DistinctCount | |||
| Filter | |||
| GroupBy | |||
| LengthWindow | |||
| LinkedList | |||
| Max | |||
| MaxForever | |||
| Min | |||
| MinForever | |||
| Node | |||
| OutputProcess | |||
| Select | |||
| SimpleSelect | |||
| StdDev | |||
| Sum | |||
| TimeWindow |
Functions Summary
public type StreamEvent record
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| eventType | ALL|CURRENT|RESET|EXPIRED | ||
| eventObject | any | ||
| timestamp | int |
public function avg() returns (Aggregator)
| Return Type | Description | ||
|---|---|---|---|
| Aggregator |
public function buildStreamEvent(any o) returns (StreamEvent[])
| Parameter Name | Data Type | Default Value | Description |
|---|---|---|---|
| o | any |
| Return Type | Description | ||
|---|---|---|---|
| StreamEvent[] |
public function count() returns (Aggregator)
| Return Type | Description | ||
|---|---|---|---|
| Aggregator |
public function createFilter(function (streams:StreamEvent[]) returns (()) nextProcPointer, function (any) returns (boolean) conditionFunc) returns (Filter)
| Parameter Name | Data Type | Default Value | Description |
|---|---|---|---|
| nextProcPointer | function (streams:StreamEvent[]) returns (()) | ||
| conditionFunc | function (any) returns (boolean) |
| Return Type | Description | ||
|---|---|---|---|
| Filter |
public function createGroupBy(function (streams:StreamEvent[]) returns (()) nextProcPointer, string[] groupByFields) returns (GroupBy)
| Parameter Name | Data Type | Default Value | Description |
|---|---|---|---|
| nextProcPointer | function (streams:StreamEvent[]) returns (()) | ||
| groupByFields | string[] |
| Return Type | Description | ||
|---|---|---|---|
| GroupBy |
public function createOutputProcess(function (any) returns (()) outputFunc) returns (OutputProcess)
| Parameter Name | Data Type | Default Value | Description |
|---|---|---|---|
| outputFunc | function (any) returns (()) |
| Return Type | Description | ||
|---|---|---|---|
| OutputProcess |
public function createSelect(function (streams:StreamEvent[]) returns (()) nextProcPointer, streams:Aggregator[] aggregatorArr, function (streams:StreamEvent) returns (string)? groupbyFunc, function (streams:StreamEvent,streams:Aggregator[]) returns (any) selectFunc) returns (Select)
| Parameter Name | Data Type | Default Value | Description |
|---|---|---|---|
| nextProcPointer | function (streams:StreamEvent[]) returns (()) | ||
| aggregatorArr | streams:Aggregator[] | ||
| groupbyFunc | function (streams:StreamEvent) returns (string)? | ||
| selectFunc | function (streams:StreamEvent,streams:Aggregator[]) returns (any) |
| Return Type | Description | ||
|---|---|---|---|
| Select |
public function createSimpleSelect(function (streams:StreamEvent[]) returns (()) nextProcPointer, function (any) returns (any) selectFunc) returns (SimpleSelect)
| Parameter Name | Data Type | Default Value | Description |
|---|---|---|---|
| nextProcPointer | function (streams:StreamEvent[]) returns (()) | ||
| selectFunc | function (any) returns (any) |
| Return Type | Description | ||
|---|---|---|---|
| SimpleSelect |
public function distinctCount() returns (Aggregator)
| Return Type | Description | ||
|---|---|---|---|
| Aggregator |
public function lengthWindow(int length, ALL|CURRENT|RESET|EXPIRED eventType, function (streams:StreamEvent[]) returns (()) nextProcessorPointer) returns (LengthWindow)
| Parameter Name | Data Type | Default Value | Description |
|---|---|---|---|
| length | int | ||
| eventType | ALL|CURRENT|RESET|EXPIRED | ||
| nextProcessorPointer | function (streams:StreamEvent[]) returns (()) |
| Return Type | Description | ||
|---|---|---|---|
| LengthWindow |
public function max() returns (Aggregator)
| Return Type | Description | ||
|---|---|---|---|
| Aggregator |
public function maxForever() returns (Aggregator)
| Return Type | Description | ||
|---|---|---|---|
| Aggregator |
public function min() returns (Aggregator)
| Return Type | Description | ||
|---|---|---|---|
| Aggregator |
public function minForever() returns (Aggregator)
| Return Type | Description | ||
|---|---|---|---|
| Aggregator |
public function stdDev() returns (Aggregator)
| Return Type | Description | ||
|---|---|---|---|
| Aggregator |
public function sum() returns (Aggregator)
| Return Type | Description | ||
|---|---|---|---|
| Aggregator |
public function timeWindow(int timeLength, ALL|CURRENT|RESET|EXPIRED eventType, function (streams:StreamEvent[]) returns (()) nextProcessPointer) returns (TimeWindow)
| Parameter Name | Data Type | Default Value | Description |
|---|---|---|---|
| timeLength | int | ||
| eventType | ALL|CURRENT|RESET|EXPIRED | ||
| nextProcessPointer | function (streams:StreamEvent[]) returns (()) |
| Return Type | Description | ||
|---|---|---|---|
| TimeWindow |
public type Aggregator object
-
<Aggregator> clone() returns (Aggregator)
Return Type Description Aggregator -
<Aggregator> process(any value, ALL|CURRENT|RESET|EXPIRED eventType) returns (any)
Parameter Name Data Type Default Value Description value any eventType ALL|CURRENT|RESET|EXPIRED Return Type Description any
public type Average object
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| count | int | 0 | |
| sum | float | 0.0 |
-
<Average> process(any value, ALL|CURRENT|RESET|EXPIRED eventType) returns (any)
Parameter Name Data Type Default Value Description value any eventType ALL|CURRENT|RESET|EXPIRED Return Type Description any -
<Average> clone() returns (Aggregator)
Return Type Description Aggregator
public type Count object
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| count | int | 0 |
-
<Count> process(any value, ALL|CURRENT|RESET|EXPIRED eventType) returns (any)
Parameter Name Data Type Default Value Description value any eventType ALL|CURRENT|RESET|EXPIRED Return Type Description any -
<Count> clone() returns (Aggregator)
Return Type Description Aggregator
public type DistinctCount object
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| distinctValues | map |
-
<DistinctCount> process(any value, ALL|CURRENT|RESET|EXPIRED eventType) returns (any)
Parameter Name Data Type Default Value Description value any eventType ALL|CURRENT|RESET|EXPIRED Return Type Description any -
<DistinctCount> clone() returns (Aggregator)
Return Type Description Aggregator
public type Filter object
-
<Filter> process(streams:StreamEvent[] streamEvents)
Parameter Name Data Type Default Value Description streamEvents streams:StreamEvent[]
public type GroupBy object
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| nextProcessorPointer | function (streams:StreamEvent[]) returns (()) | ||
| groupByFields | string[] | ||
| groupedStreamEvents | map |
-
<GroupBy> performGrouping(streams:StreamEvent[] streamEvents)
Parameter Name Data Type Default Value Description streamEvents streams:StreamEvent[]
public type LengthWindow object
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| counter | int | ||
| size | int | ||
| eventType | ALL|CURRENT|RESET|EXPIRED | ALL |
-
<LengthWindow> add(streams:StreamEvent event)
Parameter Name Data Type Default Value Description event streams:StreamEvent -
<LengthWindow> getEventToBeExpired() returns (StreamEvent)
Return Type Description StreamEvent
public type LinkedList object
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| first | streams:Node? | ||
| last | streams:Node? | ||
| curr | streams:Node? | ||
| size | int | 0 | |
| ascend | boolean | true |
-
<LinkedList> isEmpty() returns (boolean)
Return Type Description boolean -
<LinkedList> resetToFront()
-
<LinkedList> resetToRear()
-
<LinkedList> hasNext() returns (boolean)
Return Type Description boolean -
<LinkedList> hasPrevious() returns (boolean)
Return Type Description boolean -
<LinkedList> next() returns (any)
Return Type Description any -
<LinkedList> previous() returns (any)
Return Type Description any -
<LinkedList> removeCurrent()
-
<LinkedList> getSize() returns (int)
Return Type Description int -
<LinkedList> clear()
-
<LinkedList> removeFirstOccurrence(any elem) returns (boolean)
Parameter Name Data Type Default Value Description elem any Return Type Description boolean -
<LinkedList> remove(any elem) returns (boolean)
Parameter Name Data Type Default Value Description elem any Return Type Description boolean -
<LinkedList> getFirst() returns (any)
Return Type Description any -
<LinkedList> getLast() returns (any)
Return Type Description any -
<LinkedList> addFirst(any data)
Parameter Name Data Type Default Value Description data any -
<LinkedList> addLast(any data)
Parameter Name Data Type Default Value Description data any -
<LinkedList> removeFirst() returns (any)
Return Type Description any -
<LinkedList> removeLast() returns (any)
Return Type Description any -
<LinkedList> dequeue() returns (any)
Return Type Description any -
<LinkedList> asArray() returns (any[])
Return Type Description any[]
public type Max object
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| iMaxQueue | streams:LinkedList | ||
| fMaxQueue | streams:LinkedList | ||
| iMax | int? | null | |
| fMax | float? | null |
-
<Max> process(any value, ALL|CURRENT|RESET|EXPIRED eventType) returns (any)
Parameter Name Data Type Default Value Description value any eventType ALL|CURRENT|RESET|EXPIRED Return Type Description any -
<Max> clone() returns (Aggregator)
Return Type Description Aggregator
public type MaxForever object
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| iMax | int? | null | |
| fMax | float? | null |
-
<MaxForever> process(any value, ALL|CURRENT|RESET|EXPIRED eventType) returns (any)
Parameter Name Data Type Default Value Description value any eventType ALL|CURRENT|RESET|EXPIRED Return Type Description any -
<MaxForever> clone() returns (Aggregator)
Return Type Description Aggregator
public type Min object
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| iMinQueue | streams:LinkedList | ||
| fMinQueue | streams:LinkedList | ||
| iMin | int? | null | |
| fMin | float? | null |
-
<Min> process(any value, ALL|CURRENT|RESET|EXPIRED eventType) returns (any)
Parameter Name Data Type Default Value Description value any eventType ALL|CURRENT|RESET|EXPIRED Return Type Description any -
<Min> clone() returns (Aggregator)
Return Type Description Aggregator
public type MinForever object
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| iMin | int? | null | |
| fMin | float? | null |
-
<MinForever> process(any value, ALL|CURRENT|RESET|EXPIRED eventType) returns (any)
Parameter Name Data Type Default Value Description value any eventType ALL|CURRENT|RESET|EXPIRED Return Type Description any -
<MinForever> clone() returns (Aggregator)
Return Type Description Aggregator
public type Node object
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| data | any | ||
| next | streams:Node? | ||
| prev | streams:Node? |
public type OutputProcess object
-
<OutputProcess> process(streams:StreamEvent[] streamEvents)
Parameter Name Data Type Default Value Description streamEvents streams:StreamEvent[]
public type Select object
-
<Select> process(streams:StreamEvent[] streamEvents)
Parameter Name Data Type Default Value Description streamEvents streams:StreamEvent[]
public type SimpleSelect object
-
<SimpleSelect> process(streams:StreamEvent[] streamEvents)
Parameter Name Data Type Default Value Description streamEvents streams:StreamEvent[]
public type StdDev object
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| mean | float | 0.0 | |
| stdDeviation | float | 0.0 | |
| sumValue | float | 0.0 | |
| count | int | 0 |
-
<StdDev> process(any value, ALL|CURRENT|RESET|EXPIRED eventType) returns (any)
Parameter Name Data Type Default Value Description value any eventType ALL|CURRENT|RESET|EXPIRED Return Type Description any -
<StdDev> clone() returns (Aggregator)
Return Type Description Aggregator
public type Sum object
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| iSum | int | 0 | |
| fSum | float | 0.0 |
-
<Sum> process(any value, ALL|CURRENT|RESET|EXPIRED eventType) returns (any)
Parameter Name Data Type Default Value Description value any eventType ALL|CURRENT|RESET|EXPIRED Return Type Description any -
<Sum> clone() returns (Aggregator)
Return Type Description Aggregator
public type TimeWindow object
| Field Name | Data Type | Default Value | Description |
|---|---|---|---|
| counter | int | ||
| timeLength | int | ||
| eventType | ALL|CURRENT|RESET|EXPIRED | ALL |
-
<TimeWindow> startEventRemovalWorker()
-
<TimeWindow> add(streams:StreamEvent event)
Parameter Name Data Type Default Value Description event streams:StreamEvent -
<TimeWindow> returnContent() returns (StreamEvent[])
Return Type Description StreamEvent[]