-
Notifications
You must be signed in to change notification settings - Fork 7
/
NoLostTuples.spl
51 lines (45 loc) · 1.36 KB
/
NoLostTuples.spl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Copyright (C) 2015 International Business Machines Corporation.
* All Rights Reserved.
*/
composite NoLostTuples {
param expression<uint32> $tuples: (uint32)getSubmissionTimeValue("tuples", "10000000");
expression<rstring> $init: "5";
type Data = float64 data, uint64 seqno;
graph
stream<Data> Src = Beacon() {
param iterations: $tuples;
output Src: seqno=IterationCount();
}
(stream<Data> Src0;
stream<Data> Src1;
stream<Data> Src2;
stream<Data> Src3;
stream<Data> Src4;
stream<Data> Src5;
stream<Data> Src6;
stream<Data> Src7
) = com.ibm.streamsx.plumbing.balancers::ElasticLoadBalance(Src) {
param bufferSize: 100u;
elastic: (boolean)getCompileTimeValue("elastic");
initialActivePorts: (uint32)getCompileTimeValue("initialActivePorts");
}
() as Snk = Custom(Src0, Src1, Src2, Src3, Src4, Src5, Src6, Src7 as Sources) {
logic state: {
mutable uint32 _count = 0u;
}
onTuple Sources: {
++_count;
}
onPunct Sources: {
if (currentPunct() == Sys.FinalMarker) {
if (_count == $tuples) {
printStringLn("pass");
}
else {
printStringLn("fail");
}
}
}
}
}