All Downloads are FREE. Search and download functionalities are using the official Maven repository.

a.zipkin-storage-cassandra.2.7.3.source-code.cassandra-schema-cql3.txt Maven / Gradle / Ivy

There is a newer version: 2.8.4
Show newest version
CREATE KEYSPACE IF NOT EXISTS zipkin WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};

CREATE TABLE IF NOT EXISTS zipkin.service_span_name_index (
    service_span_name text,      // Endpoint.serviceName + "." + Span.name
    ts                timestamp, // start timestamp of the span, truncated to millisecond precision
    trace_id          bigint,    // trace ID. Included as a clustering column to avoid clashes (however unlikely)
    PRIMARY KEY (service_span_name, ts, trace_id)
)
    WITH CLUSTERING ORDER BY (ts DESC)
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.DateTieredCompactionStrategy', 'max_window_size_seconds': '86400'}
    AND default_time_to_live =  259200;

CREATE TABLE IF NOT EXISTS zipkin.service_name_index (
    service_name      text,      // Endpoint.serviceName
    bucket            int,       // avoids hot spots by distributing writes across each bucket, usually 0-9
    ts                timestamp, // start timestamp of the span, truncated to millisecond precision
    trace_id          bigint,    // trace ID. Included as a clustering column to avoid clashes (however unlikely)
    PRIMARY KEY ((service_name, bucket), ts, trace_id)
)
    WITH CLUSTERING ORDER BY (ts DESC)
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.DateTieredCompactionStrategy', 'max_window_size_seconds': '86400'}
    AND default_time_to_live =  259200;

CREATE TABLE IF NOT EXISTS zipkin.span_names (
    service_name text,
    bucket       int,   -- no longer used. kept for compatibility
    span_name    text,
    PRIMARY KEY ((service_name, bucket), 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 TABLE IF NOT EXISTS zipkin.annotations_index (
    annotation     blob,      // Annotation.value or BinaryAnnotation.key
    bucket         int,       // avoids hot spots by distributing writes across each bucket, usually 0-9
    ts             timestamp, // start timestamp of the span, truncated to millisecond precision
    trace_id       bigint,    // trace ID. Included as a clustering column to avoid clashes (however unlikely)
    PRIMARY KEY ((annotation, bucket), ts, trace_id)
)
    WITH CLUSTERING ORDER BY (ts DESC)
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.DateTieredCompactionStrategy', 'max_window_size_seconds': '86400'}
    AND default_time_to_live =  259200;

CREATE TABLE IF NOT EXISTS zipkin.dependencies (
    day          timestamp,
    dependencies 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;

CREATE TABLE IF NOT EXISTS zipkin.service_names (
    service_name text,
    PRIMARY KEY (service_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 TABLE IF NOT EXISTS zipkin.traces (
    trace_id  bigint,
    ts        timestamp,
    span_name text,
    span      blob,
    PRIMARY KEY (trace_id, ts, span_name)
)
    WITH compaction = {'class': 'org.apache.cassandra.db.compaction.DateTieredCompactionStrategy', 'max_window_size_seconds': '86400'}
    AND default_time_to_live =  604800;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy