Skip to content

Instantly share code, notes, and snippets.

View PeterCorless's full-sized avatar

Peter Corless PeterCorless

View GitHub Profile
@PeterCorless
PeterCorless / 01-create-table.cql
Created May 6, 2020 19:32
Introducing-Scylla-Open-Source-4.0
> CREATE TABLE base_table (
pk text,
ck text,
val1 text,
val2 text,
PRIMARY KEY (pk, ck)
) WITH cdc = { ‘enabled’ = ‘true’, preimage = ‘true’ };
@PeterCorless
PeterCorless / newstack-01-file-descriptors.c
Last active January 6, 2024 16:40
newstack-io_uring-ebpf-examples
ssize_t read(int fd, void *buf, size_t count);
ssize_t write(int fd, const void *buf, size_t count);
@PeterCorless
PeterCorless / 01-system.large_rows.cql
Created April 8, 2020 15:58
Large Rows and Cells
> SELECT * FROM system.large_rows;
keyspace_name | table_name | sstable_name | row_size | partition_key | clustering_key | compaction_time
--------------+------------+--------------------------------------------------------------------------------------+----------+---------------+----------------+---------------------------------
mykeyspace | gr | /var/lib/scylla/data/mykeyspace/gr-67d502908ea211e98d05000000000000/mc-1-big-Data.db | 1206130 | 1 | 1 | 2019-06-14 13:03:24.039000+0000
@PeterCorless
PeterCorless / 01-config.dynamodb.yaml
Last active September 12, 2019 15:33
Scylla Alternator Gists
source:
hostURL: http://dynamodb.us-east-1.amazonaws.com
region: us-east-1
port: 8000
credentials:
accessKey: <user>
secretKey: <pass>
target:
hostURL: http://scylla-ip
port: 8000
@PeterCorless
PeterCorless / 01-create-table.cql
Last active September 3, 2019 20:07
cache-antipatterns
CREATE TABLE ks.tbl (
uuid int,
time timestamp,
property text,
PRIMARY KEY (uuid, time))
@PeterCorless
PeterCorless / 01-tar-confluent.sh
Last active May 16, 2019 23:45
Scylla + Confluent IoT Examples - Updated 16 May 2019
$ tar -xzf confluent-5.2.0-2.12.tar.gz
$ cd confluent-5.2.0/
val connector =
new CassandraConnector(CassandraConnectorConf(sparkContext.getConf))
cqlsh> desc SCHEMA
CREATE KEYSPACE catalog WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '3'} AND durable_writes = true;
CREATE TABLE catalog.apparel (
sku text,
color text,
size text,
brand text,
gender text,
group text,
@PeterCorless
PeterCorless / 01-hello-world.py
Last active April 8, 2020 15:48
Scylla's Portable Python Interpreter, or Snakes on a Data Plane
#!/usr/bin/python3
import yaml
a = yaml.load("string: hello world!")
print(a['string'])
@PeterCorless
PeterCorless / 1-deploying-spark.sh
Created February 7, 2019 09:39
Scylla Migrator
# On one node, start the master:
spark-2.4.0-bin-hadoop2.7 $ ./sbin/start-master.sh
# On the same node, and on the other nodes, start the Spark workers:
spark-2.4.0-bin-hadoop2.7 $ SPARK_WORKER_INSTANCES=8 SPARK_WORKER_CORES=2 ./sbin/start-slave.sh spark://<spark-master-ip>:7077