Skip to content

API Docs - v4.2.1

Reorder

akslack (Stream Processor)

This stream processor extension performs reordering of an event stream which is out of order.
 It implements the AQ-K-Slack based out-of-order handling algorithm which is originally described in
'http://dl.acm.org/citation.cfm?doid=2675743.2771828'.

Syntax

reorder:akslack(<LONG> timestamp, <INT|FLOAT|LONG|DOUBLE> correlation.field, <LONG> batch.size, <LONG> timer.timeout, <LONG> max.k, <BOOL> discard.flag, <DOUBLE> error.threshold, <DOUBLE> confidence.level)

QUERY PARAMETERS

Name Description Default Value Possible Data Types Optional Dynamic
timestamp The attribute used for ordering the events. LONG No No
correlation.field This corresponds to the data field of which the accuracy directly gets affected, by the adaptive operation of the Alpha K-Slack extension. This field is used to calculate the runtime window coverage threshold which is an upper limit set for the unsuccessfully handled late arrivals. INT
FLOAT
LONG
DOUBLE
No No
batch.size The parameter 'batch.size' denotes the number of events that should be considered in the calculation of an alpha value. It should be a value which should be greater than or equal to fifteen. 10,000 LONG Yes No
timer.timeout This corresponds to a fixed time out value in milliseconds, which is set at the beginning of the process. Once the time out value expires, the extension drains out all the events that are buffered within the reorder extension. The time out has been implemented internally using a timer. The events buffered within the extension are released each time the timer ticks. -1 (timeout is infinite) LONG Yes No
max.k This is the maximum threshold value for 'K' parameter in the Alpha K-Slack algorithm. 9,223,372,036,854,775,807 (The maximum Long value) LONG Yes No
discard.flag This indicates whether the out-of-order events which appear after the expiration of the Alpha K-slack window should be discarded or not. When this value is set to 'true', the events are discarded. false BOOL Yes No
error.threshold The error threshold to be applied in Alpha K-Slack algorithm. This parameter must be defined simultaneously with 'confidenceLevel'. 0.03 (3%) DOUBLE Yes No
confidence.level The confidence level to be applied in Alpha K-Slack algorithm. This parameter must be defined simultaneously with 'errorThreshold'. 0.95 (95%) DOUBLE Yes No
Extra Return Attributes
Name Description Possible Types
beta0 The timestamp based on which the reordering is performed. LONG
beta1 An upper limit value assigned for the unsuccessfully handled late arrivals. DOUBLE
beta2 The number of events that should be considered in the calculation of an alpha value. LONG
beta3 The fixed time-out value in milliseconds assigned for flushing all the events buffered inside the extension. LONG
beta4 The maximum threshold value assigned for 'K' parameter. LONG
beta5 The flag set to indicate whether the out-of-order events which arrive after buffer eviction are to be discarded or not. BOOL
beta6 The error threshold value set for Alpha K-Slack algorithm. DOUBLE
beta7 The confidence level set for the Alpha K-Slack algorithm. DOUBLE

Examples EXAMPLE 1

define stream InputStream (eventtt long,data double);
@info(name = 'query1')
from InputStream#reorder:akslack(eventtt, data, 20)
select eventtt, data
insert into OutputStream;

This query performs reordering based on the 'eventtt' attribute values. In this example, 20 represents the batch size.

kslack (Stream Processor)

This stream processor extension performs reordering of an out-of-order event stream.
 It implements the K-Slack based out-of-order handling algorithm which is originally described in
'https://www2.informatik.uni-erlangen.de/publication/download/IPDPS2013.pdf'.)

Syntax

reorder:kslack(<LONG> timestamp, <LONG> timer.timeout, <LONG> max.k, <BOOL> discard.flag)

QUERY PARAMETERS

Name Description Default Value Possible Data Types Optional Dynamic
timestamp This is the attribute used for ordering the events. LONG No No
timer.timeout This corresponds to a fixed time-out value in milliseconds, which is set at the beginning of the process. Once the time-out value expires, the extension drains out all the events that are buffered within the reorder extension. The time-out has been implemented internally using a timer. The events buffered within the extension are released each time the timer ticks. -1 (timeout is infinite) LONG Yes No
max.k The maximum threshold value for 'K' parameter in the K-Slack algorithm. 9,223,372,036,854,775,807 (The maximum Long value) LONG Yes No
discard.flag This indicates whether the out-of-order events which appear after the expiration of the K-slack window should be discarded or not. When this value is set to 'true', the events would get discarded. false BOOL Yes No

Examples EXAMPLE 1

define stream InputStream (eventtt long, price long, volume long);
@info(name = 'query1')
from InputStream#reorder:kslack(eventtt, 1000)
select eventtt, price, volume
insert into OutputStream;

This query performs reordering based on the 'eventtt' attribute values. In this example, the timeout value is set to 1000 milliseconds