Skip to content

Instantly share code, notes, and snippets.

View tjake's full-sized avatar

Jake Luciani tjake

  • DataStax
  • Stamford CT
  • X @tjake
View GitHub Profile
### DML ###
# Keyspace Name
keyspace: stresscql
# The CQL for creating a keyspace (optional if it already exists)
keyspace_definition: |
CREATE KEYSPACE stresscql WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
# Table name
### DML ###
# Keyspace Name
keyspace: stresscql
# The CQL for creating a keyspace (optional if it already exists)
keyspace_definition: |
CREATE KEYSPACE stresscql WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
# Table name
Results:
real op rate : 43973
adjusted op rate stderr : 0
key rate : 43973
latency mean : 20.5
latency median : 17.4
latency 95th percentile : 47.2
latency 99th percentile : 63.0
latency 99.9th percentile : 95.2
latency max : 365.5
WARN [RMI TCP Connection(12)-10.6.20.175] 2014-01-11 11:12:46,145 Gossiper.java (line 430) Assassinating /10.6.28.119 via gossip
INFO [RMI TCP Connection(12)-10.6.20.175] 2014-01-11 11:12:46,278 Gossiper.java (line 785) InetAddress /10.6.28.119 is now DOWN
INFO [RMI TCP Connection(12)-10.6.20.175] 2014-01-11 11:12:46,279 StorageService.java (line 1609) Removing tokens [-9024594965293584900] for /10.6.28.119
INFO [RMI TCP Connection(12)-10.6.20.175] 2014-01-11 11:12:46,281 ColumnFamilyStore.java (line 630) Enqueuing flush of Memtable-peers@1827801977(395/6948 serialized/live bytes, 25 ops)
INFO [FlushWriter:12] 2014-01-11 11:12:46,282 Memtable.java (line 461) Writing Memtable-peers@1827801977(395/6948 serialized/live bytes, 25 ops)
INFO [FlushWriter:12] 2014-01-11 11:12:46,285 Memtable.java (line 495) Completed flushing /opt/data/cassandra/disk5/data/system/peers/system-peers-ic-630-Data.db (328 bytes) for commitlog position ReplayPosition(segmentId=1389455970978, position=47611672)
WARN [RMI TCP Connec
@tjake
tjake / repair.py
Last active January 2, 2016 01:29
script to slowly repair the primary vnode ranges for a node. If it fails you can restart from last sucessfull range. It waits between ranges to avoid buildup of compactions.
#!/usr/bin/env python
import os, sys, re, subprocess, time
def usage():
print "Usage:"
print " repair hostname keyspace [offset]\n"
exit(1)
'''Grab the hostid guid from nodetool info'''
ERROR [FlushWriter:37] 2013-01-28 15:37:20,879 CassandraDaemon.java (line 139) Exception in thread Thread[FlushWriter:37,5,main]
java.lang.RuntimeException: java.io.FileNotFoundException: /opt/data/cassandra/disk4/data/prod7/tsdata/prod7-tsdata-tmp-ib-31727-Index.db (Read-only file system)
at org.apache.cassandra.io.util.SequentialWriter.<init>(SequentialWriter.java:73)
at org.apache.cassandra.io.util.SequentialWriter.open(SequentialWriter.java:108)
at org.apache.cassandra.io.util.SequentialWriter.open(SequentialWriter.java:103)
at org.apache.cassandra.io.sstable.SSTableWriter$IndexWriter.<init>(SSTableWriter.java:441)
at org.apache.cassandra.io.sstable.SSTableWriter.<init>(SSTableWriter.java:92)
at org.apache.cassandra.db.Memtable$FlushRunnable.createFlushWriter(Memtable.java:480)
at org.apache.cassandra.db.Memtable$FlushRunnable.writeSortedContents(Memtable.java:428)
at org.apache.cassandra.db.Memtable$FlushRunnable.runWith(Memtable.java:417)
#Load RJDBC
library(RJDBC)
#Load Hive JDBC driver
hivedrv <- JDBC("org.apache.hadoop.hive.jdbc.HiveDriver",
c(list.files("/Users/jake/workspace/bdp/resources/hadoop",pattern="jar$",full.names=T),
list.files("/Users/jake/workspace/bdp/resources/hive/lib",pattern="jar$",full.names=T)))
#Connect to Hive service
hivecon <- dbConnect(hivedrv, "jdbc:hive://localhost:10000/default")
#Load RJDBC
library(RJDBC)
#Load in the Cassandra-JDBC diver
cassdrv <- JDBC("org.apache.cassandra.cql.jdbc.CassandraDriver",
list.files("/Users/jake/workspace/bdp/resources/cassandra/lib/",pattern="jar$",full.names=T))
#Connect to Cassandra node and Keyspace
casscon <- dbConnect(cassdrv, "jdbc:cassandra://localhost:9160/PortfolioDemo")
@tjake
tjake / cassandra.yaml
Created January 30, 2012 17:40
Cassandra lan party config
# Cassandra storage config YAML
# NOTE:
# See http://wiki.apache.org/cassandra/StorageConfiguration for
# full explanations of configuration directives
# /NOTE
# The name of the cluster. This is mainly used to prevent machines in
# one logical cluster from joining another.
cluster_name: 'LanParty Cluster'
@tjake
tjake / git-search-file.sh
Created November 2, 2011 13:23
search all branches for a file
for branch in `git for-each-ref --format="%(refname)" refs/heads`
do
echo $branch ; echo `git ls-tree -r --name-only $branch | grep -i $1`
done