-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep a separate stress schema cql file, as stress can't use use UDTs. (…
…#1752) For safety, create the stress schema in a different keyspace.
- Loading branch information
1 parent
136e977
commit 2e7bc7f
Showing
4 changed files
with
75 additions
and
13 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
zipkin-storage/cassandra3/src/test/resources/cassandra3-test-schema.cql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
CREATE KEYSPACE IF NOT EXISTS stress_zipkin3 WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}; | ||
|
||
//-- same schema but remove all UDTs (as cassandra-stress doesn't support them) | ||
|
||
CREATE TABLE IF NOT EXISTS stress_zipkin3.traces ( | ||
trace_id bigint, | ||
ts_uuid timeuuid, | ||
id bigint, | ||
ts bigint, | ||
span_name text, | ||
parent_id bigint, | ||
duration bigint, | ||
all_annotations text, //-- can't do SASI on set<text>: comma-joined until CASSANDRA-11182 | ||
PRIMARY KEY (trace_id, ts_uuid, id) | ||
) | ||
WITH CLUSTERING ORDER BY (ts_uuid DESC) | ||
AND compaction = {'class': 'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy'} | ||
AND default_time_to_live = 604800; | ||
|
||
|
||
CREATE TABLE IF NOT EXISTS stress_zipkin3.trace_by_service_span ( | ||
service_name text, //-- service name | ||
span_name text, //-- span name, or blank for queries without span name | ||
bucket int, //-- time bucket, calculated as ts/interval (in microseconds), for some pre-configured interval like 1 day. | ||
ts timeuuid, //-- start timestamp of the span, truncated to millisecond precision | ||
trace_id bigint, //-- trace ID | ||
duration bigint, //-- span duration, in microseconds | ||
PRIMARY KEY ((service_name, span_name, bucket), ts) | ||
) | ||
WITH CLUSTERING ORDER BY (ts DESC) | ||
AND compaction = {'class': 'org.apache.cassandra.db.compaction.TimeWindowCompactionStrategy'} | ||
AND default_time_to_live = 259200; | ||
|
||
CREATE TABLE IF NOT EXISTS stress_zipkin3.span_name_by_service ( | ||
service_name text, | ||
span_name text, | ||
PRIMARY KEY (service_name, span_name) | ||
) | ||
WITH compaction = {'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy', 'unchecked_tombstone_compaction': 'true', 'tombstone_threshold': '0.2'} | ||
AND default_time_to_live = 259200; | ||
|
||
CREATE CUSTOM INDEX IF NOT EXISTS ON stress_zipkin3.traces (all_annotations) USING 'org.apache.cassandra.index.sasi.SASIIndex' | ||
WITH OPTIONS = { | ||
'mode': 'CONTAINS', | ||
'analyzed': 'true', | ||
'analyzer_class':'org.apache.cassandra.index.sasi.analyzer.NonTokenizingAnalyzer', | ||
'case_sensitive': 'false' | ||
}; | ||
|
||
CREATE CUSTOM INDEX IF NOT EXISTS ON stress_zipkin3.trace_by_service_span (duration) USING 'org.apache.cassandra.index.sasi.SASIIndex' | ||
WITH OPTIONS = {'mode': 'PREFIX'}; | ||
|
||
|
||
CREATE TABLE IF NOT EXISTS stress_zipkin3.dependencies ( | ||
day timestamp, | ||
links blob, | ||
PRIMARY KEY (day) | ||
) | ||
WITH compaction = {'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy', 'unchecked_tombstone_compaction': 'true', 'tombstone_threshold': '0.2'} | ||
AND default_time_to_live = 259200; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters