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

kin2.zipkin-storage-cassandra-v1.2.22.2.source-code.cassandra-schema.cql Maven / Gradle / Ivy

The newest version!
CREATE KEYSPACE IF NOT EXISTS zipkin WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};

CREATE TABLE IF NOT EXISTS zipkin.service_remote_service_name_index (
    service_remote_service_name text,      // Span.localServiceName + "." + Span.remoteServiceName
    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_remote_service_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_span_name_index (
    service_span_name text,      // Span.localServiceName + "." + 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,      // Span.localServiceName
    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;

CREATE TABLE IF NOT EXISTS zipkin.autocomplete_tags (
    key     text,
    value    text,
    PRIMARY KEY (key, value)
)
    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.remote_service_names (
    service_name text,
    remote_service_name text,
    PRIMARY KEY (service_name, remote_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;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy