|
Algorithm 2 Bounded Out-of-Order Event Handling with Single-Emission Windows |
-
Require:
Event e with event timestamp
-
Require:
Maximum out-of-orderness bound B
-
Require:
Maximum observed event time M, active windows
-
Ensure:
The event is inserted into applicable non-finalized windows or discarded
-
1:
procedure ProcessEvent()
-
2:
-
3:
-
4:
if then
-
5:
DiscardAsTooLate(e)
-
6:
return
-
7:
end if
-
8:
CreateRequiredActiveWindows()
-
9:
for all do
-
10:
if then
-
11:
AddEvent()
-
12:
end if
-
13:
end for
-
14:
for all ordered by do
-
15:
if then
-
16:
EvaluateWindow(w)
-
17:
EmitResult()
-
18:
-
19:
end if
-
20:
end for
-
21:
end procedure
|