system-test.cql
3.04 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
CREATE TABLE IF NOT EXISTS thingsboard.msg_queue (
node_id timeuuid,
clustered_hash bigint,
partition bigint,
ts bigint,
msg blob,
PRIMARY KEY ((node_id, clustered_hash, partition), ts))
WITH CLUSTERING ORDER BY (ts DESC)
AND compaction = {
'class': 'org.apache.cassandra.db.compaction.DateTieredCompactionStrategy',
'min_threshold': '5',
'base_time_seconds': '43200',
'max_window_size_seconds': '43200',
'tombstone_threshold': '0.9',
'unchecked_tombstone_compaction': 'true'
};
CREATE TABLE IF NOT EXISTS thingsboard.msg_ack_queue (
node_id timeuuid,
clustered_hash bigint,
partition bigint,
msg_id timeuuid,
PRIMARY KEY ((node_id, clustered_hash, partition), msg_id))
WITH CLUSTERING ORDER BY (msg_id DESC)
AND compaction = {
'class': 'org.apache.cassandra.db.compaction.DateTieredCompactionStrategy',
'min_threshold': '5',
'base_time_seconds': '43200',
'max_window_size_seconds': '43200',
'tombstone_threshold': '0.9',
'unchecked_tombstone_compaction': 'true'
};
CREATE TABLE IF NOT EXISTS thingsboard.processed_msg_partitions (
node_id timeuuid,
clustered_hash bigint,
partition bigint,
PRIMARY KEY ((node_id, clustered_hash), partition))
WITH CLUSTERING ORDER BY (partition DESC)
AND compaction = {
'class': 'org.apache.cassandra.db.compaction.DateTieredCompactionStrategy',
'min_threshold': '5',
'base_time_seconds': '43200',
'max_window_size_seconds': '43200',
'tombstone_threshold': '0.9',
'unchecked_tombstone_compaction': 'true'
};
-- msg_queue dataset
INSERT INTO thingsboard.msg_queue (node_id, clustered_hash, partition, ts, msg)
VALUES (055eee50-1883-11e8-b380-65b5d5335ba9, 101, 200, 201, null);
INSERT INTO thingsboard.msg_queue (node_id, clustered_hash, partition, ts, msg)
VALUES (055eee50-1883-11e8-b380-65b5d5335ba9, 101, 200, 202, null);
INSERT INTO thingsboard.msg_queue (node_id, clustered_hash, partition, ts, msg)
VALUES (055eee50-1883-11e8-b380-65b5d5335ba9, 101, 300, 301, null);
-- ack_queue dataset
INSERT INTO msg_ack_queue (node_id, clustered_hash, partition, msg_id)
VALUES (055eee50-1883-11e8-b380-65b5d5335ba9, 101, 300, bebaeb60-1888-11e8-bf21-65b5d5335ba9);
INSERT INTO msg_ack_queue (node_id, clustered_hash, partition, msg_id)
VALUES (055eee50-1883-11e8-b380-65b5d5335ba9, 101, 300, 12baeb60-1888-11e8-bf21-65b5d5335ba9);
INSERT INTO msg_ack_queue (node_id, clustered_hash, partition, msg_id)
VALUES (055eee50-1883-11e8-b380-65b5d5335ba9, 101, 200, 32baeb60-1888-11e8-bf21-65b5d5335ba9);
-- processed partition dataset
INSERT INTO processed_msg_partitions (node_id, clustered_hash, partition)
VALUES (055eee50-1883-11e8-b380-65b5d5335ba9, 101, 100);
INSERT INTO processed_msg_partitions (node_id, clustered_hash, partition)
VALUES (055eee50-1883-11e8-b380-65b5d5335ba9, 101, 777);
INSERT INTO processed_msg_partitions (node_id, clustered_hash, partition)
VALUES (055eee50-1883-11e8-b380-65b5d5335ba9, 202, 200);