Skip to content

Instantly share code, notes, and snippets.

Alex Ott alexott

Block or report user

Report or block alexott

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@alexott
alexott / 1.cql
Created Aug 16, 2019
example of counter deletion
View 1.cql
cqlsh:test> describe test.abc6
CREATE TABLE test.abc6 (
id int PRIMARY KEY,
c counter
);
cqlsh:test> select * from test.abc6;
id | c
@alexott
alexott / list.txt
Created Aug 8, 2019
tlp-stress answer........
View list.txt
>curl -L -O "https://dl.bintray.com/thelastpickle/tlp-tools-tarball/tlp-stress-1.0.0.tar"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:01 --:--:-- 0
100 22.5M 100 22.5M 0 0 3641k 0 0:00:06 0:00:06 --:--:-- 4985k
>tar xvf tlp-stress-1.0.0.tar
x tlp-stress-1.0.0/
x tlp-stress-1.0.0/lib/
...
>cd tlp-stress-1.0.0
View emojis-test.txt
test ♈ up ☝️ light skin ☝🏻 Zimbabwe 🇿🇼 England 🏴 keycap0 0️⃣end 0
@alexott
alexott / Dockerfile
Created Jan 11, 2019
Docker image for Zeppelin + DSE
View Dockerfile
ARG DSE_VERSION=6.7.0
FROM datastax/dse-server:${DSE_VERSION}
ARG Z_VERSION="0.8.0"
ENV Z_HOME="/zeppelin"
ARG Z_URL_PREFIX=http://archive.apache.org/dist/zeppelin/zeppelin-${Z_VERSION}
ARG Z_TARBALL=zeppelin-${Z_VERSION}-bin-all.tgz
ARG Z_DOWNLOAD_URL=${Z_URL_PREFIX}/${Z_TARBALL}
@alexott
alexott / generate-dse-topology.py
Last active Jan 7, 2019
Scripts for generation DSE service discovery JSON files for Prometheus
View generate-dse-topology.py
from dse.cluster import Cluster
import sys
import json
if (len(sys.argv) < 3):
print("Usage: generate.py contact_point file_name")
exit(1)
cluster = Cluster([sys.argv[1]])
session = cluster.connect()
@alexott
alexott / index.md
Last active Jun 14, 2018
Draft of documentation about Java driver's Built statements
View index.md

Built statements

Built statements are generated via [QueryBuilder]'s Fluent API. Use of Fluent API allows easier build of the complex queries, comparing with hardcoding the CQL statements into the source code.

Note: The provider builders perform very little validation of the built query. There is thus no guarantee that a built query is valid, and it is definitively possible to create invalid queries.

@alexott
alexott / find-corrupted-jar.sh
Last active Mar 13, 2018
Snippet to find corrupted JAR in Maven repository
View find-corrupted-jar.sh
for i in `find ~/.m2/repository/ -name \*.jar`; do unzip -l $i 2> /dev/null > /dev/null ; RES=$?; if [ $RES -ne 0 ]; then echo "$i: $RES" ; fi ; done
@alexott
alexott / App.java
Last active Mar 10, 2018
UDT + Object mapper in DataStax Java Driver
View App.java
package com.datastax.demos.alexott.product;
import com.datastax.driver.core.Cluster;
import com.datastax.driver.core.CodecRegistry;
import com.datastax.driver.core.Session;
import com.datastax.driver.mapping.Mapper;
import com.datastax.driver.mapping.MappingManager;
public class App {
View cqlsh.txt
cqlsh:test> DESCRIBE table log;
CREATE TABLE test.log (
module text,
yyyymmdd text,
created timeuuid,
logmessage text,
PRIMARY KEY ((module, yyyymmdd), created)
) WITH CLUSTERING ORDER BY (created ASC)
AND bloom_filter_fp_chance = 0.01
@alexott
alexott / ResultSetSerializer.java
Created Feb 3, 2018
JSON serialization of Java's ResultSet returned by DataStax Java Driver
View ResultSetSerializer.java
package com.datastax.alexott.demos.jdtest1;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.datastax.driver.core.ColumnDefinitions;
import com.datastax.driver.core.DataType;
import com.datastax.driver.core.ResultSet;
import com.datastax.driver.core.Row;
You can’t perform that action at this time.