ballerina/streams package
Type Definitions
Type | Values | Description | |
---|---|---|---|
EventType | RESET | EXPIRED | CURRENT | ALL |
Records Summary
Record | Description | ||
---|---|---|---|
StreamEvent |
Objects Summary
Object | Description | ||
---|---|---|---|
Aggregator | |||
Filter | |||
GroupBy | |||
LengthWindow | |||
OutputProcess | |||
Select | |||
SimpleSelect | |||
Sum | |||
TimeWindow |
Functions Summary
public type StreamEvent record
Field Name | Data Type | Default Value | Description |
---|---|---|---|
eventType | ALL|RESET|EXPIRED|CURRENT | ||
eventObject | any | ||
timestamp | int |
public function buildStreamEvent(any o) returns (StreamEvent[])
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
o | any |
Return Type | Description | ||
---|---|---|---|
StreamEvent[] |
public function createFilter(function (streams:0.0.0:StreamEvent[]) returns (()) nextProcPointer, function (any) returns (boolean) conditionFunc) returns (Filter)
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
nextProcPointer | function (streams:0.0.0:StreamEvent[]) returns (()) | ||
conditionFunc | function (any) returns (boolean) |
Return Type | Description | ||
---|---|---|---|
Filter |
public function createGroupBy(function (streams:0.0.0:StreamEvent[]) returns (()) nextProcPointer, string[] groupByFields) returns (GroupBy)
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
nextProcPointer | function (streams:0.0.0: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:0.0.0:StreamEvent[]) returns (()) nextProcPointer, streams:0.0.0:Aggregator[] aggregatorArr, function (streams:0.0.0:StreamEvent) returns (string)? groupbyFunc, function (streams:0.0.0:StreamEvent,streams:0.0.0:Aggregator[]) returns (any) selectFunc) returns (Select)
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
nextProcPointer | function (streams:0.0.0:StreamEvent[]) returns (()) | ||
aggregatorArr | streams:0.0.0:Aggregator[] | ||
groupbyFunc | function (streams:0.0.0:StreamEvent) returns (string)? | ||
selectFunc | function (streams:0.0.0:StreamEvent,streams:0.0.0:Aggregator[]) returns (any) |
Return Type | Description | ||
---|---|---|---|
Select |
public function createSimpleSelect(function (streams:0.0.0:StreamEvent[]) returns (()) nextProcPointer, function (any) returns (any) selectFunc) returns (SimpleSelect)
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
nextProcPointer | function (streams:0.0.0:StreamEvent[]) returns (()) | ||
selectFunc | function (any) returns (any) |
Return Type | Description | ||
---|---|---|---|
SimpleSelect |
public function createSumAggregator() returns (Sum)
Return Type | Description | ||
---|---|---|---|
Sum |
public function lengthWindow(int length, ALL|RESET|EXPIRED|CURRENT eventType, function (streams:0.0.0:StreamEvent[]) returns (()) nextProcessorPointer) returns (LengthWindow)
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
length | int | ||
eventType | ALL|RESET|EXPIRED|CURRENT | ||
nextProcessorPointer | function (streams:0.0.0:StreamEvent[]) returns (()) |
Return Type | Description | ||
---|---|---|---|
LengthWindow |
public function timeWindow(int timeLength, ALL|RESET|EXPIRED|CURRENT eventType, function (streams:0.0.0:StreamEvent[]) returns (()) nextProcessPointer) returns (TimeWindow)
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
timeLength | int | ||
eventType | ALL|RESET|EXPIRED|CURRENT | ||
nextProcessPointer | function (streams:0.0.0:StreamEvent[]) returns (()) |
Return Type | Description | ||
---|---|---|---|
TimeWindow |
public type Aggregator object
-
<Aggregator> clone() returns (Aggregator)
Return Type Description Aggregator -
<Aggregator> process(int value, ALL|RESET|EXPIRED|CURRENT eventType) returns (int)
Parameter Name Data Type Default Value Description value int eventType ALL|RESET|EXPIRED|CURRENT Return Type Description int
public type Filter object
-
<Filter> process(streams:0.0.0:StreamEvent[] streamEvents)
Parameter Name Data Type Default Value Description streamEvents streams:0.0.0:StreamEvent[]
public type GroupBy object
Field Name | Data Type | Default Value | Description |
---|---|---|---|
nextProcessorPointer | function (streams:0.0.0:StreamEvent[]) returns (()) | ||
groupByFields | string[] | ||
groupedStreamEvents | map |
-
<GroupBy> performGrouping(streams:0.0.0:StreamEvent[] streamEvents)
Parameter Name Data Type Default Value Description streamEvents streams:0.0.0:StreamEvent[]
public type LengthWindow object
Field Name | Data Type | Default Value | Description |
---|---|---|---|
counter | int | ||
size | int | ||
eventType | ALL|RESET|EXPIRED|CURRENT | ALL |
-
<LengthWindow> add(streams:0.0.0:StreamEvent event)
Parameter Name Data Type Default Value Description event streams:0.0.0:StreamEvent -
<LengthWindow> getEventToBeExpired() returns (StreamEvent)
Return Type Description StreamEvent
public type OutputProcess object
-
<OutputProcess> process(streams:0.0.0:StreamEvent[] streamEvents)
Parameter Name Data Type Default Value Description streamEvents streams:0.0.0:StreamEvent[]
public type Select object
-
<Select> process(streams:0.0.0:StreamEvent[] streamEvents)
Parameter Name Data Type Default Value Description streamEvents streams:0.0.0:StreamEvent[]
public type SimpleSelect object
-
<SimpleSelect> process(streams:0.0.0:StreamEvent[] streamEvents)
Parameter Name Data Type Default Value Description streamEvents streams:0.0.0:StreamEvent[]
public type Sum object
Field Name | Data Type | Default Value | Description |
---|---|---|---|
sumValue | int | 0 |
-
<Sum> process(int value, ALL|RESET|EXPIRED|CURRENT eventType) returns (int)
Parameter Name Data Type Default Value Description value int eventType ALL|RESET|EXPIRED|CURRENT Return Type Description int -
<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|RESET|EXPIRED|CURRENT | ALL |
-
<TimeWindow> startEventRemovalWorker()
-
<TimeWindow> add(streams:0.0.0:StreamEvent event)
Parameter Name Data Type Default Value Description event streams:0.0.0:StreamEvent -
<TimeWindow> returnContent() returns (StreamEvent[])
Return Type Description StreamEvent[]