Skip to content

Instantly share code, notes, and snippets.

@tzach
Last active June 14, 2019 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tzach/c9782543170fefd479ed1f466c820b70 to your computer and use it in GitHub Desktop.
Save tzach/c9782543170fefd479ed1f466c820b70 to your computer and use it in GitHub Desktop.
create a large cell in Scylla using Clojure alia
(ns cassandra-project.core
(:require [qbits.alia :as alia]))
(def cluster (alia/cluster {:contact-points ["172.17.0.2"]}))
(def session (alia/connect cluster))
(alia/execute session "USE mykeyspace;")
(dotimes [n 2000000]
(alia/execute session (str "UPDATE mykeyspace.gr SET link = link + {" n " : 'ABC'} WHERE id=1 AND r=1;")))
@tzach
Copy link
Author

tzach commented Jun 14, 2019

Create table and keyspace

CREATE KEYSPACE mykeyspace WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}  AND durable_writes = true;
CREATE TABLE mykeyspace.gr (
    id int,
    r int,
    link map<int, text>,
    PRIMARY KEY (id, r)
) WITH CLUSTERING ORDER BY (r ASC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'ALL'}
    AND comment = ''
    AND compaction = {'class': 'SizeTieredCompactionStrategy'}
    AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99.0PERCENTILE';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment