-
Notifications
You must be signed in to change notification settings - Fork 3
/
aisdata-schema.cql
79 lines (72 loc) · 3.09 KB
/
aisdata-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
DROP KEYSPACE aisdata;
CREATE KEYSPACE aisdata WITH replication = { 'class': 'NetworkTopologyStrategy', 'datacenter1': 3 };
USE aisdata;
CREATE TABLE packets_time (
timeblock int, -- 10 minute time block since Epoch
time timestamp, -- Message receive time
digest blob, -- Murmur3 digest of aisdata
aisdata ascii, -- Raw AisPacket
PRIMARY KEY (timeblock, time, digest)
)
WITH
compression = {'sstable_compression':'LZ4Compressor', 'chunk_length_kb':1024}
AND comment = 'AIS data ordered by receive time.'
AND speculative_retry = '99percentile'
AND compaction = {'class': 'SizeTieredCompactionStrategy'}
AND caching = 'keys_only';
CREATE TABLE packets_mmsi (
mmsi int, -- MMSI no.
timeblock int, -- 30 day time block since Epoch (~10 MB per partition)
time timestamp, -- Message receive time
digest blob, -- Murmur3 digest of aisdata
aisdata ascii, -- Raw AisPacket
PRIMARY KEY ((mmsi, timeblock), time, digest)
)
WITH
compression = {'sstable_compression':'LZ4Compressor', 'chunk_length_kb':1024}
AND comment = 'AIS data ordered by mmsi number.'
AND speculative_retry = '99percentile'
AND compaction = {'class': 'SizeTieredCompactionStrategy'}
AND caching = 'keys_only';
CREATE TABLE packets_area_cell1 (
cellid int, -- Geographical cell id from DMA Grid
timeblock int, -- 10 minute time period since Epoch
time timestamp, -- Message receive time
digest blob, -- Murmur3 digest of aisdata
aisdata ascii, -- Raw AisPacket
PRIMARY KEY ((cellid, timeblock), time, digest)
)
WITH
compression = {'sstable_compression':'LZ4Compressor', 'chunk_length_kb':1024}
AND comment = 'AIS data ordered by cells of size 1 degree.'
AND speculative_retry = '99percentile'
AND compaction = {'class': 'SizeTieredCompactionStrategy'}
AND caching = 'keys_only';
CREATE TABLE packets_area_cell10 (
cellid int, -- Geographical cell id from DMA Grid
timeblock int, -- 10 minute time period since Epoch
time timestamp, -- Message receive time
digest blob, -- Murmur3 digest of aisdata
aisdata ascii, -- Raw AisPacket
PRIMARY KEY ((cellid, timeblock), time, digest)
)
WITH
compression = {'sstable_compression':'LZ4Compressor', 'chunk_length_kb':1024}
AND comment = 'AIS data ordered by cells of size 10 degree.'
AND speculative_retry = '99percentile'
AND compaction = {'class': 'SizeTieredCompactionStrategy'}
AND caching = 'keys_only';
CREATE TABLE packets_area_unknown (
mmsi int, -- MMSI no.
timeblock int, -- 30 day time block since Epoch (~10 MB per partition)
time timestamp, -- Message receive time
digest blob, -- Murmur3 digest of aisdata
aisdata ascii, -- Raw AisPacket
PRIMARY KEY ((mmsi, timeblock), time, digest)
)
WITH
compression = {'sstable_compression':'LZ4Compressor', 'chunk_length_kb':64}
AND comment = 'AIS data where the area has not yet been determined.'
AND speculative_retry = '99percentile'
AND compaction = {'class': 'SizeTieredCompactionStrategy'}
AND caching = 'keys_only';