-
Notifications
You must be signed in to change notification settings - Fork 2
/
db_schema.cql
670 lines (600 loc) · 19.7 KB
/
db_schema.cql
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
//DROP KEYSPACE IF EXISTS monroe;
/*CREATE KEYSPACE monroe WITH REPLICATION = {
'class': 'SimpleStrategy',
'replication_factor': 1
};*/
USE monroe;
///////////////////////////////////////////////////////////////////////////////
CREATE TABLE devices (
Country text,
Site text,
NodeId int,
Address text,
DisplayName text,
HostName text,
Interfaces list<text>,
IfDetails map<text, text>,
Latitude decimal,
Longitude decimal,
Make text,
Model text,
ModemCount int,
PostCode text,
SiteNote text,
Status text,
StatusStart timestamp,
UsbWifiCount int,
ValidFrom timestamp,
ValidTo timestamp,
PRIMARY KEY ((Country, Site), NodeId)
);
CREATE CUSTOM INDEX i_devices_nodeid on devices(NodeId) using 'org.apache.cassandra.index.sasi.SASIIndex' with options={'mode':'SPARSE'};
///////////////////////////////////////////////////////////////////////////////
CREATE TABLE monroe_exp_ping (
NodeId text,
Guid text,
Timestamp decimal,
SequenceNumber bigint,
DataId text,
DataVersion int,
Operator text,
Iccid text,
Bytes int,
Host text,
Rtt double,
PRIMARY KEY ((NodeId, Iccid), Timestamp, SequenceNumber)
);
CREATE CUSTOM INDEX i_monroe_exp_ping_timestamp on monroe_exp_ping(Timestamp) using 'org.apache.cassandra.index.sasi.SASIIndex' with options={'mode':'SPARSE'};
///////////////////////////////////////////////////////////////////////////////
CREATE TABLE monroe_meta_device_modem (
NodeId text,
Timestamp decimal,
DataId text,
DataVersion int,
SequenceNumber bigint,
InterfaceName text,
InternalInterface text,
Cid int,
DeviceMode int,
DeviceSubmode int,
DeviceState int,
Ecio int,
ENodebId int,
Iccid text,
Imsi text,
ImsiMccMnc int,
Imei text,
IpAddress text,
InternalIpAddress text,
MccMnc int,
Operator text,
Lac int,
Rsrp int,
Frequency int,
Rsrq int,
Band int,
Pci int,
NwMccMnc int,
Rscp int,
Rssi int,
PRIMARY KEY ((NodeId, Iccid), Timestamp, SequenceNumber)
);
/*CREATE CUSTOM INDEX i_monroe_meta_device_modem_timestamp on monroe_meta_device_modem(Timestamp) using 'org.apache.cassandra.index.sasi.SASIIndex' with options={'mode':'SPARSE'};*/
///////////////////////////////////////////////////////////////////////////////
CREATE TABLE monroe_meta_device_gps (
NodeId text,
Timestamp decimal,
DataId text,
DataVersion int,
SequenceNumber bigint,
Longitude decimal,
Latitude decimal,
Altitude decimal,
Speed decimal,
SatelliteCount int,
Nmea text,
PRIMARY KEY (NodeId, Timestamp, SequenceNumber)
);
/*CREATE CUSTOM INDEX i_monroe_meta_device_gps_timestamp on monroe_meta_device_gps(Timestamp) using 'org.apache.cassandra.index.sasi.SASIIndex' with options={'mode':'SPARSE'};*/
///////////////////////////////////////////////////////////////////////////////
CREATE TABLE monroe_meta_node_sensor (
NodeId text,
Timestamp decimal,
DataId text,
DataVersion int,
SequenceNumber bigint,
Running text,
Cpu text,
Modems text,
Dlb text,
UsbMonitor text,
Id text,
Start text,
Current text,
Total text,
Percent text,
System text,
Steal text,
Guest text,
IoWait text,
Irq text,
Nice text,
Idle text,
User text,
SoftIrq text,
Apps text,
Free text,
Swap text,
usb0 text,
usb0charging text,
usb1 text,
usb1charging text,
usb2 text,
usb2charging text,
PRIMARY KEY (NodeId, Timestamp, SequenceNumber)
);
/*CREATE CUSTOM INDEX i_monroe_meta_node_sensor_timestamp on monroe_meta_node_sensor(Timestamp) using 'org.apache.cassandra.index.sasi.SASIIndex' with options={'mode':'SPARSE'};*/
///////////////////////////////////////////////////////////////////////////////
CREATE TABLE monroe_meta_node_event (
NodeId text,
Timestamp decimal,
DataId text,
DataVersion int,
SequenceNumber bigint,
EventType text,
Message text,
User text,
id bigint,
//WatchdogFailed text,
//WatchdogRepaired text,
//WatchdogStatus text,
//MaintenanceStart text,
//MaintenanceStop text,
//SystemHalt int,
//SchedulingStarted int,
PRIMARY KEY (NodeId, Timestamp, SequenceNumber)
);
/*CREATE CUSTOM INDEX i_monroe_meta_node_event_timestamp on monroe_meta_node_event(Timestamp) using 'org.apache.cassandra.index.sasi.SASIIndex' with options={'mode':'SPARSE'};*/
///////////////////////////////////////////////////////////////////////////////
CREATE TABLE monroe_exp_http (
NodeId text,
Guid text,
Timestamp decimal,
SequenceNumber bigint,
DataId text,
DataVersion int,
Operator text,
Iccid text,
TotalTime double,
Bytes int,
SetupTime double,
DownloadTime double,
Host text,
Speed double,
Port text,
PRIMARY KEY ((NodeId, Iccid), Timestamp, SequenceNumber)
);
/*CREATE CUSTOM INDEX i_monroe_exp_http on monroe_exp_http(Timestamp) using 'org.apache.cassandra.index.sasi.SASIIndex' with options={'mode':'SPARSE'};*/
CREATE TABLE monroe_exp_http_download (
NodeId text,
Guid text,
Timestamp decimal,
SequenceNumber bigint,
DataId text,
DataVersion int,
Operator text,
Iccid text,
TotalTime double,
Bytes int,
SetupTime double,
DownloadTime double,
Host text,
Speed double,
Port text,
ErrorCode int,
Url text,
PRIMARY KEY ((NodeId, Iccid), Timestamp, SequenceNumber)
);
///////////////////////////////////////////////////////////////////////////////
CREATE TABLE monroe_exp_tstat_udp_complete (
NodeId text,
Iccid text,
DataId text,
/* We decided to mantain the same formalism of the tstat/mPlane project */
c_ip text,
c_port int,
c_first_abs decimal, /* Timestamp, in milliseconds (e.g., 1470123456000.47) */
c_durat decimal,
c_bytes_all int,
c_pkts_all int,
c_isint int,
c_iscrypto int,
c_type int,
s_ip text,
s_port int,
s_first_abs decimal,
s_durat decimal,
s_bytes_all int,
s_pkts_all int,
s_isint int,
s_iscrypto int,
s_type int,
fqdn text,
PRIMARY KEY ((NodeId, Iccid), c_first_abs, c_ip, c_port, s_ip, s_port)
);
///////////////////////////////////////////////////////////////////////////////
CREATE TABLE monroe_exp_tstat_http_complete (
NodeId text,
Iccid text,
DataId text,
/* We decided to mantain the same formalism of the tstat/mPlane project */
c_ip text,
c_port int,
s_ip text,
s_port int,
time_abs decimal, /* Timestamp, in seconds (e.g., 1470123456.47) */
method_HTTP text,
hostname_response text,
fqdn_content_len text,
path_content_type text,
referer_server text,
user_agent_range text,
cookie_location text,
dnt_set_cookie text,
PRIMARY KEY ((NodeId, Iccid), time_abs, c_ip, c_port, s_ip, s_port)
);
///////////////////////////////////////////////////////////////////////////////
CREATE TABLE monroe_exp_tstat_tcp_complete (
NodeId text,
Iccid text,
DataId text,
/* We decided to mantain the same formalism of the tstat/mPlane project */
c_ip text,
c_port int,
c_pkts_all int,
c_rst_cnt int,
c_ack_cnt int,
c_ack_cnt_p int,
c_bytes_uniq int,
c_pkts_data int,
c_bytes_all int,
c_pkts_retx int,
c_bytes_retx int,
c_pkts_ooo int,
c_syn_cnt int,
c_fin_cnt int,
s_ip text,
s_port int,
s_pkts_all int,
s_rst_cnt int,
s_ack_cnt int,
s_ack_cnt_p int,
s_bytes_uniq int,
s_pkts_data int,
s_bytes_all int,
s_pkts_retx int,
s_bytes_retx int,
s_pkts_ooo int,
s_syn_cnt int,
s_fin_cnt int,
first decimal, /* Timestamp, in milliseconds (e.g., 1470123456000.47) */
last decimal,
durat decimal,
c_first decimal,
s_first decimal,
c_last decimal,
s_last decimal,
c_first_ack decimal,
s_first_ack decimal,
c_isint int,
s_isint int,
c_iscrypto int,
s_iscrypto int,
con_t int,
p2p_t int,
http_t int,
c_rtt_avg decimal,
c_rtt_min decimal,
c_rtt_max decimal,
c_rtt_std decimal,
c_rtt_cnt decimal,
c_ttl_min decimal,
c_ttl_max decimal,
s_rtt_avg decimal,
s_rtt_min decimal,
s_rtt_max decimal,
s_rtt_std decimal,
s_rtt_cnt decimal,
s_ttl_min decimal,
s_ttl_max decimal,
p2p_st int,
ed2k_data int,
ed2k_sig int,
ed2k_c2s int,
ed2k_c2c int,
ed2k_chat int,
c_f1323_opt int,
c_tm_opt int,
c_win_scl int,
c_sack_opt int,
c_sack_cnt int,
c_mss int,
c_mss_max decimal,
c_mss_min decimal,
c_win_max decimal,
c_win_min decimal,
c_win_0 decimal,
c_cwin_max decimal,
c_cwin_min decimal,
c_cwin_ini int,
c_pkts_rto int,
c_pkts_fs int,
c_pkts_reor int,
c_pkts_dup int,
c_pkts_unk int,
c_pkts_fc int,
c_pkts_unrto int,
c_pkts_unfs int,
c_syn_retx int,
s_f1323_opt int,
s_tm_opt int,
s_win_scl int,
s_sack_opt int,
s_sack_cnt int,
s_mss int,
s_mss_max decimal,
s_mss_min decimal,
s_win_max decimal,
s_win_min decimal,
s_win_0 decimal,
s_cwin_max decimal,
s_cwin_min decimal,
s_cwin_ini int,
s_pkts_rto int,
s_pkts_fs int,
s_pkts_reor int,
s_pkts_dup int,
s_pkts_unk int,
s_pkts_fc int,
s_pkts_unrto int,
s_pkts_unfs int,
s_syn_retx int,
http_req_cnt int,
http_res_cnt int,
http_res text,
c_pkts_push int,
s_pkts_push int,
c_tls_SNI text,
s_tls_SCN text,
c_npnalpn int,
s_npnalpn int,
c_tls_sesid int,
c_last_handshakeT decimal,
s_last_handshakeT decimal,
c_appdataT decimal,
s_appdataT decimal,
c_appdataB bigint,
s_appdataB bigint,
fqdn text,
dns_rslv text,
req_tm decimal,
res_tm decimal,
PRIMARY KEY ((NodeId, Iccid, s_ip), first, last, c_ip, c_port, s_port)
);
///////////////////////////////////////////////////////////////////////////////
CREATE TABLE monroe_exp_tstat_tcp_nocomplete (
NodeId text,
Iccid text,
DataId text,
/* We decided to mantain the same formalism of the tstat/mPlane project */
c_ip text,
c_port int,
c_pkts_all int,
c_rst_cnt int,
c_ack_cnt int,
c_ack_cnt_p int,
c_bytes_uniq int,
c_pkts_data int,
c_bytes_all int,
c_pkts_retx int,
c_bytes_retx int,
c_pkts_ooo int,
c_syn_cnt int,
c_fin_cnt int,
s_ip text,
s_port int,
s_pkts_all int,
s_rst_cnt int,
s_ack_cnt int,
s_ack_cnt_p int,
s_bytes_uniq int,
s_pkts_data int,
s_bytes_all int,
s_pkts_retx int,
s_bytes_retx int,
s_pkts_ooo int,
s_syn_cnt int,
s_fin_cnt int,
first decimal, /* Timestamp, in milliseconds (e.g., 1470123456000.47) */
last decimal,
durat decimal,
c_first decimal,
s_first decimal,
c_last decimal,
s_last decimal,
c_first_ack decimal,
s_first_ack decimal,
c_isint int,
s_isint int,
c_iscrypto int,
s_iscrypto int,
con_t int,
p2p_t int,
http_t int,
PRIMARY KEY ((NodeId, Iccid), first, last, c_ip, c_port, s_ip, s_port)
);
///////////////////////////////////////////////////////////////////////////////
CREATE TABLE monroe_exp_simple_traceroute (
NodeId int,
timestamp int,
endTime int,
DataId text,
DataVersion int,
containerTimestamp int,
hop int,
targetdomainname text,
InterfaceName text,
IpDst text,
numberOfHops int,
sizeOfProbes int,
IP text,
HopName text,
RTTSection list<int>, /* in ms */
annotationSection list<int>,
PRIMARY KEY (NodeId, InterfaceName, targetdomainname, timestamp, IpDst, hop, IP)
);
CREATE CUSTOM INDEX i_monroe_exp_simple_traceroute_timestamp on monroe_exp_simple_traceroute(timestamp) using 'org.apache.cassandra.index.sasi.SASIIndex' with options={'mode':'SPARSE'};
CREATE CUSTOM INDEX i_monroe_exp_simple_traceroute_targetdomainname on monroe_exp_simple_traceroute(targetdomainname) using 'org.apache.cassandra.index.sasi.SASIIndex';
///////////////////////////////////////////////////////////////////////////////
CREATE TABLE monroe_exp_exhaustive_paris (
NodeId int,
timestamp int,
endTime int,
DataId text,
DataVersion int,
containerTimestamp int,
hop int,
targetdomainname text,
InterfaceName text,
IpDst text,
PortDst int,
IpSrc text,
PortSrc int,
IP text,
Proto text,
Algorithm text,
duration int,
MinHopRTT int,
MedianHopRTT int,
MaxHopRTT int,
StdHopRTT int,
annotation int,
flowIds list<int>,
MPLS text,
TransmittedProbes int,
SuccessfulProbes int,
PRIMARY KEY (NodeId, InterfaceName, targetdomainname, timestamp, IpDst, hop, IP)
);
CREATE CUSTOM INDEX i_monroe_exp_exhaustive_paris_timestamp on monroe_exp_exhaustive_paris(timestamp) using 'org.apache.cassandra.index.sasi.SASIIndex' with options={'mode':'SPARSE'};
CREATE CUSTOM INDEX i_monroe_exp_exhaustive_paris_targetdomainname on monroe_exp_exhaustive_paris(targetdomainname) using 'org.apache.cassandra.index.sasi.SASIIndex';
///////////////////////////////////////////////////////////////////////////////
CREATE TABLE monroe_exp_udp_ping (
DataId text,
NodeId text,
Timestamp decimal,
SequenceNumber bigint,
DataVersion int,
Bytes int,
Host text,
InterfaceName text,
Operator text,
ICCID text,
Rtt double,
ErrorCode int, // 0 = OK, others = C++ errno
ErrorString text,
PRIMARY KEY (NodeId, Timestamp, Iccid, SequenceNumber)
) WITH CLUSTERING ORDER BY (Timestamp DESC, ICCID ASC, SequenceNumber DESC);
//CREATE CUSTOM INDEX i_monroe_exp_ping_udp_timestamp on monroe_exp_ping_udp(Timestamp) using 'org.apache.cassandra.index.sasi.SASIIndex' with options={'mode':'SPARSE'};
///////////////////////////////////////////////////////////////////////////////
CREATE TABLE monroe_exp_nettest (
Timestamp decimal,
Iccid text,
NodeId text,
DataVersion int,
DataId text,
SequenceNumber bigint,
Guid text,
Operator text,
ErrorCode int,
cnf_server_host text,
res_id_test text,
res_time_start_s decimal,
res_time_end_s decimal,
res_status text,
res_status_msg text,
res_version_client text,
res_version_server text,
res_server_ip text,
res_server_port int,
res_encrypt boolean,
res_chunksize int,
res_tcp_congestion text,
res_total_bytes_dl bigint,
res_total_bytes_ul bigint,
res_uname_sysname text,
res_uname_nodename text,
res_uname_release text,
res_uname_version text,
res_uname_machine text,
res_rtt_tcp_payload_num int,
res_rtt_tcp_payload_client_ns bigint,
res_rtt_tcp_payload_server_ns bigint,
res_dl_num_flows int,
res_dl_time_ns bigint,
res_dl_bytes bigint,
res_dl_throughput_kbps decimal,
res_ul_num_flows int,
res_ul_time_ns bigint,
res_ul_bytes bigint,
res_ul_throughput_kbps decimal,
IMSIMCCMNC int,
NWMCCMNC int,
PRIMARY KEY (NodeId, Timestamp, Iccid, SequenceNumber)
) WITH CLUSTERING ORDER BY (Timestamp DESC, ICCID ASC, SequenceNumber DESC);
//////////////////////////////////////////////////////////////////////////
CREATE TABLE monroe.monroe_exp_headless_browser (
dataid text,
dataversion int,
nodeid text,
timestamp decimal,
sequencenumber bigint,
browser text,
country text,
firstpaint double,
fullyloaded double,
iccid text,
imsimccmnc int,
info text,
interfacename text,
internalinterface text,
ipaddress text,
navigationtiming text,
nwmccmnc int,
ops text,
pageinfo text,
pageloadtime double,
pagetimings text,
ping_avg double,
ping_exp boolean,
ping_max double,
ping_min double,
protocol text,
resourcetimings text,
rumspeedindex double,
url text,
PRIMARY KEY (nodeid, timestamp, sequencenumber)
);
CREATE TABLE monroe_meta_device_wlan (
DataId text,
InterfaceName text,
SequenceNumber bigint,
DataVersion int,
Timestamp decimal,
NodeId text,
ESSID text,
Noise int,
RSSI int,
Quality int,
IPAddress text,
PRIMARY KEY (NodeId, Timestamp, SequenceNumber)
);