View progress-in-shell.sh
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/sh | |
# See: http://www.m-bsys.com/linux/echo-color-1 | |
TIME=10 | |
echo -n "starting server" | |
while [ $TIME -gt 0 ] | |
do | |
echo -n "." | |
sleep 1 |
View batch-insert.py
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/env python | |
from cassandra.cluster import Cluster | |
from cassandra.query import * | |
from cassandra import * | |
import hashlib | |
import sys | |
KEYSPACE = 'test' | |
TABLE = 'user' | |
BATCH_SIZE = 1000 |
View log-collection.sh
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/sh | |
endpoints=$1 | |
output=$2 | |
if [ -z $endpoints ] || [ -z $output ];then | |
echo "Usage: $0 endpoints out_dir" | |
exit 1 | |
fi |
View fio-random-read
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
[random-read] | |
ioengine=libaio | |
iodepth=1400 | |
rw=randread | |
direct=0 | |
numjobs=1 | |
blocksize=4096 | |
;size=33% | |
;filename=/dev/sdb | |
iodepth_batch=1400 |
View fio-check.sh
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/sh | |
NAME= | |
IODEPTH="1 4 8 16 32 64 128 256" | |
RUNTIME=60 | |
FILENAME_RANDREAD="/dev/sdb" | |
FILENAME_RANDRW="/mnt/resource/dummy" | |
FILENAME_SEQWRITE="/mnt/resource/dummy_write" |
View get-all-id.py
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/env python | |
# Usage: | |
# 1. install pip | |
# | |
# curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py";python get-pip.py | |
# | |
# 2. install cassandra driver via pip | |
# | |
# pip install cassandra-driver | |
# |
View Java8TimeLibraryTest.java
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 com.orb.framework; | |
import static java.time.format.DateTimeFormatter.ofPattern; | |
import static org.junit.Assert.fail; | |
import java.time.Instant; | |
import java.time.LocalDateTime; | |
import java.time.ZoneId; | |
import java.time.ZoneOffset; | |
import java.time.ZonedDateTime; |
View CassandraSample.java
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
import static java.lang.String.format; | |
import com.datastax.driver.core.Cluster; | |
import com.datastax.driver.core.ResultSet; | |
import com.datastax.driver.core.Row; | |
import com.datastax.driver.core.Session; | |
import com.datastax.driver.core.policies.DCAwareRoundRobinPolicy; | |
import com.datastax.driver.core.policies.DefaultRetryPolicy; | |
import com.datastax.driver.core.policies.TokenAwarePolicy; |
View BigDecimalTest.java
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
import java.math.BigDecimal; | |
import java.math.RoundingMode; | |
public class BigDecimalTest { | |
public static void main(String ... args) { | |
BigDecimalTest app = new BigDecimalTest(); | |
app.test(); | |
} |
View gist:705ec037ec964fbc88a723d02dc559e4
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
## Schema Question | |
### Example Schema | |
Assuming blog service. | |
``` | |
CREATE TABLE tag ( | |
id INT PRIMARY KEY, | |
value VARCHAR(32) |
OlderNewer