Skip to content

Instantly share code, notes, and snippets.

View pcmanus's full-sized avatar

Sylvain Lebresne pcmanus

View GitHub Profile
# Stress profile to test for CASSANDRA-10657
keyspace: ks
keyspace_definition: |
CREATE KEYSPACE ks WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
table: tbl
table_definition: |
@pcmanus
pcmanus / insert_bigsavings.py
Created December 9, 2015 13:44
Insertion script
"""Simple Data loader.
Usage:
insert_bigsavings.py [-c] [-n=<x>] [-p=<y>]
Options:
-c enable compression (disabled by default)
-n=<x> total number of rows to insert (default: 1M)
-p=<y> number of partitions to insert the row into (default: 100)
"""
@pcmanus
pcmanus / insert_smallsavings.py
Created December 9, 2015 13:43
Insertion script
"""Simple Data loader.
Usage:
insert_smallsavings.py [-c] [-n=<x>]
Options:
-c enable compression (disabled by default)
-n=<x> total number of rows to insert (default: 1M)
"""
from __future__ import print_function
@pcmanus
pcmanus / insert.py
Created December 9, 2015 13:38
Insertion script for blog post example
"""Simple Data loader.
Usage:
insert.py [-c] [-n=<x>] [-p=<y>]
Options:
-c enable compression (disabled by default)
-n=<x> total number of rows to insert (default: 1M)
-p=<y> number of partitions to insert the row into (default: 100)
"""
# Command line suggestions
# user
# ops(insert=100,latest=100,point=10,range=1)
# n=1B
# -rate threads=50
# -pop seq=1..1M
# contents=SORTED
# read-lookback=uniform(1..1M)
# -insert visits=fixed(100K)
# revisit=uniform(1..1M)"
MutationBuilder.create(metadata)
.newRow(4, "foo", 3.2).add("value", 0)
.newRow(4, "bar", 3.2).add("value", 0)
.apply();
/*
* Copyright (C) 2012 DataStax Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@pcmanus
pcmanus / BatchInsertTest.java
Created February 19, 2014 18:28
Simplistic benchmark for CASSANDRA-6737
package batchInsertTest;
import com.datastax.driver.core.*;
public class BatchInsertTest {
public static void main(String[] args) throws Exception {
int RUN = 20;
int PER_BATCH_INSERTS = 10000;