This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package hessian.ambien; | |
import com.datastax.oss.driver.api.core.ConsistencyLevel; | |
import com.datastax.oss.driver.api.core.CqlIdentifier; | |
import com.datastax.oss.driver.api.core.CqlSession; | |
import com.datastax.oss.driver.api.core.config.DefaultDriverOption; | |
import com.datastax.oss.driver.api.core.config.DriverExecutionProfile; | |
import com.datastax.oss.driver.api.core.metadata.*; | |
import com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata; | |
import com.datastax.oss.driver.api.core.metadata.token.TokenRange; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
javac -cp "/home/digger/dse/resources/cassandra/lib/*" -d target/ src/hessian/invest/DeleteInsert.java | |
jar cf DeleteInsert.jar -C target/ hessian | |
cp DeleteInsert.jar ~/dse/resources/cassandra/conf/triggers/ | |
nodetool reloadtriggers | |
CREATE TRIGGER deleteInsert ON ks.tbl USING 'hessian.invest.DeleteInsert'; | |
*/ | |
package hessian.invest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE KEYSPACE lab WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'}; | |
use lab; | |
CREATE OR REPLACE FUNCTION lww_accumulate(state MAP<INT,INT>, mutid INT, val INT) | |
CALLED ON NULL INPUT | |
RETURNS MAP<INT,INT> | |
LANGUAGE java | |
AS ' | |
state.put(mutid, val); | |
return state; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here are some data samples for demonstrating loading. | |
CQL for tables: | |
cqlsh -e "CREATE KEYSPACE dsbulkblog WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};" | |
cqlsh -e "CREATE TABLE dsbulkblog.iris_with_id (id int PRIMARY KEY, petal_length double, petal_width double, sepal_length double, sepal_width double, species text)" | |
cqlsh -e "CREATE TABLE dsbulkblog.categories_set(category TEXT PRIMARY KEY, examples SET<TEXT>);" | |
cqlsh -e "CREATE TABLE dsbulkblog.categories_list(category TEXT PRIMARY KEY, examples LIST<TEXT>);" | |
cqlsh -e "CREATE TABLE dsbulkblog.president_birthdates(president TEXT PRIMARY KEY, birthdate_string TEXT, birthdate DATE);" | |
Examples: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void ghettoLog(String fname, String msg) { | |
try { | |
Files.write(Paths.get("/tmp/logit"), Arrays.asList(s), StandardOpenOption.APPEND); | |
} | |
catch (Exception e) { } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setup-disks.sh | |
============== | |
#!/bin/bash | |
set -vx | |
# Execute this file dirctly (don't source it) if you want to use the `$(dirname $0)` construct | |
function maybe_skip_drive { | |
local drive=$1 | |
if ! [ -b $drive ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for i in {1..30000}; do ./survey.sh; sleep 0.2; done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5.1 | 3.5 | 1.4 | 0.2 | Iris-setosa | |
---|---|---|---|---|---|
4.9 | 3.0 | 1.4 | 0.2 | Iris-setosa | |
4.7 | 3.2 | 1.3 | 0.2 | Iris-setosa | |
4.6 | 3.1 | 1.5 | 0.2 | Iris-setosa | |
5.0 | 3.6 | 1.4 | 0.2 | Iris-setosa | |
5.4 | 3.9 | 1.7 | 0.4 | Iris-setosa | |
4.6 | 3.4 | 1.4 | 0.3 | Iris-setosa | |
5.0 | 3.4 | 1.5 | 0.2 | Iris-setosa | |
4.4 | 2.9 | 1.4 | 0.2 | Iris-setosa | |
4.9 | 3.1 | 1.5 | 0.1 | Iris-setosa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cqlsh -e "CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}" | |
cqlsh -e "CREATE TABLE test.dtest(pkey INT, info TEXT, link TEXT, dsefs_contents TEXT, PRIMARY KEY ((pkey)))" | |
echo This is a test > /tmp/test1.txt | |
echo This is another test > /tmp/test2.txt | |
echo Hello World > /tmp/test3.txt | |
echo Thank You > /tmp/test4.txt | |
dse fs "mkdir /fittest" | |
dse fs "put /tmp/test1.txt /fittest/test1.txt" | |
dse fs "put /tmp/test2.txt /fittest/test2.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
#|R|a|s|p|b|e|r|r|y|P|i|-|S|p|y|.|c|o|.|u|k| | |
#+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | |
# | |
# ultrasonic_1.py | |
# Measure distance using an ultrasonic module | |
# | |
# Author : Matt Hawkins | |
# Date : 09/01/2013 |
NewerOlder