Page MenuHomePhabricator
Paste P8798

pcs.sh
ActivePublic

Authored by Eevans on Jul 24 2019, 3:06 PM.
#!/bin/bash
set -e
KEYSPACES=(
enwiki_T_mediaEKhjXRLvi0_47tdHyL7nahpjtY4
enwiki_T_metadata
enwiki_T_mobileVuV78NVnWlTWLhDwwr5v2FMH2wA
enwiki_T_references
others_T_mediaEKhjXRLvi0_47tdHyL7nahpjtY4
others_T_metadata
others_T_mobileVuV78NVnWlTWLhDwwr5v2FMH2wA
others_T_references
wikipedia_T_mediaEKhjXRLvi0_47tdHyL7nahpjtY4
wikipedia_T_metadata
wikipedia_T_mobileVuV78NVnWlTWLhDwwr5v2FMH2wA
wikipedia_T_references
# others_T_mediaEKhjXRLvi0_47tdHyL7nahpjtY4
# others_T_metadata
# others_T_mobileVuV78NVnWlTWLhDwwr5v2FMH2wA
# others_T_references
)
for i in ${KEYSPACES[@]}; do
cat <<EOF
create_$i:
statement: |
CREATE KEYSPACE IF NOT EXISTS "$i"
WITH replication = {'class': 'NetworkTopologyStrategy', 'codfw': '3', 'eqiad': '3'} AND durable_writes = true;
create_$i-meta:
statement: |
CREATE TABLE IF NOT EXISTS "$i".meta (
key text PRIMARY KEY,
value text
) WITH bloom_filter_fp_chance = 0.1
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.LeveledCompactionStrategy'}
AND compression = {'chunk_length_in_kb': '32', 'class': '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 = '99PERCENTILE';
create_$i-data:
statement: |
CREATE TABLE IF NOT EXISTS "$i".data (
"_domain" text,
key text,
headers text,
tid timeuuid,
value blob,
PRIMARY KEY (("_domain", key))
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '32', 'class': '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 = '99PERCENTILE';
EOF
done

Event Timeline

Eevans edited the content of this paste. (Show Details)Jul 24 2019, 3:06 PM
Eevans changed the title of this paste from untitled to Masterwork From Distant Lands.
Eevans changed the title of this paste from Masterwork From Distant Lands to pcs.sh.Jul 24 2019, 3:07 PM
Eevans updated the paste's language from autodetect to shell.