Skip to content

Instantly share code, notes, and snippets.

================================
================================
for i in range(0,10000000):
id = uuid.uuid1()
query = """INSERT INTO test(test_id, test_value) VALUES(%(tid)s, %(tval)s)"""
params = dict()
params['tid'] = id
params['tval'] = str(i)
### Keybase proof
I hereby claim:
* I am jeffjirsa on github.
* I am jeffjirsa (https://keybase.io/jeffjirsa) on keybase.
* I have a public key whose fingerprint is 8770 96E3 4F03 CB77 245C 6E1D D555 CF2D AB63 D916
To claim this, I am signing this object:
@jeffjirsa
jeffjirsa / gist:2b5d1882bef42a0ea9a2
Last active August 6, 2018 17:28
Example of cassandra verify ( #8703 ) for cassandra-8703
# Data actively being written - 100,000 counter updates
bash-3.2# ./bin/nodetool flush
bash-3.2# ./bin/sstableverify test metrics
WARN 09:43:52 JNA link failure, one or more native method will be unavailable.
Verifying BigTableReader(path='/Users/jeff/.ccm/snapshot/node1/data/test/metrics-963efb90a92d11e48cd58ff7b1eb6f10/la-1-big-Data.db') (1987623 bytes)
Verify of BigTableReader(path='/Users/jeff/.ccm/snapshot/node1/data/test/metrics-963efb90a92d11e48cd58ff7b1eb6f10/la-1-big-Data.db') succeeded. All 20077 rows read successfully
bash-3.2# ./bin/nodetool flush
bash-3.2# ./bin/sstableverify test metrics
WARN 09:44:02 JNA link failure, one or more native method will be unavailable.
Verifying BigTableReader(path='/Users/jeff/.ccm/snapshot/node1/data/test/metrics-963efb90a92d11e48cd58ff7b1eb6f10/la-2-big-Data.db') (1315710 bytes)
@jeffjirsa
jeffjirsa / gist:87e2b95113e3366bc00b
Last active August 29, 2015 14:19
Testing CASSANDRA-9181 with 3.0
#!/usr/bin/python
import cql
import time
host = "localhost"
port = 9160
con = cql.connect(host, port, cql_version='3.0.0')
cursor = con.cursor()
@jeffjirsa
jeffjirsa / gist:5c0f63395269a85cdcb2
Created April 17, 2015 22:48
Testing cassandra-9181 with 2.0.14
bash-3.2# ccm node1 cqlsh
Connected to snapshot at 127.0.0.1:9160.
[cqlsh 4.1.1 | Cassandra 2.0.14-SNAPSHOT | CQL spec 3.1.1 | Thrift protocol 19.39.0]
Use HELP for help.
cqlsh> tracing on
Now tracing requests.
cqlsh> select * from test2.text_table where p='1634' and value=1634;
(0 rows)
cqlsh> list variables;
variable | value
------------------------------------------+---------------------------------------------
authenticator | AllowAllAuthenticator
authorizer | AllowAllAuthorizer
auto_snapshot | true
batch_size_fail_threshold_in_kb | 50
batch_size_warn_threshold_in_kb | 5
batchlog_replay_throttle_in_kb | 1024
CREATE TYPE form_option (
left int,
operator text,
right int,
);
CREATE TABLE forms (
page_id int,
form_id int,
form_option_id timeuuid,
diff --git a/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java b/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
index 15287bd..9d0b086 100644
--- a/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
+++ b/src/java/org/apache/cassandra/db/compaction/DateTieredCompactionStrategy.java
@@ -123,7 +123,7 @@ public class DateTieredCompactionStrategy extends AbstractCompactionStrategy
private List<SSTableReader> getCompactionCandidates(Iterable<SSTableReader> candidateSSTables, long now, int base)
{
- Iterable<SSTableReader> candidates = filterOldSSTables(Lists.newArrayList(candidateSSTables), options.maxSSTableAge, now);
+ Iterable<SSTableReader> candidates = filterOldSSTables(Lists.newArrayList(candidateSSTables), options.maxSSTableAge, now, options.useMinTimestamp);
@jeffjirsa
jeffjirsa / Change from hub spoke to full mesh
Last active November 22, 2015 08:06
7306 WIP & experiments
echo 'include_datacenters=datacenter1,datacenter2,datacenter3' > ~/.ccm/test/node3/conf/cassandra-dctopology.properties
echo 'include_datacenters=datacenter1,datacenter2,datacenter3' > ~/.ccm/test/node2/conf/cassandra-dctopology.properties
cqlsh> create keyspace test with replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
cqlsh> use test;
cqlsh:test> drop table if exists test0;
cqlsh:test> CREATE TABLE test0 (
... pk int,
... a int,
... b text,
... s text static,
... PRIMARY KEY (pk, a)
... );