-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_aerospike.sh
executable file
·48 lines (44 loc) · 1.27 KB
/
run_aerospike.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
#
SCRIPT_PATH=$(dirname "$0")
SCRIPT_ROOT=$(cd "$SCRIPT_PATH/.." && pwd)
CLASSPATH="${SCRIPT_ROOT}/conf:${SCRIPT_ROOT}/lib/*:${SCRIPT_ROOT}/aerospike-binding/lib/*"
THREADCOUNT_LOAD=32
THREADCOUNT_RUN=256
RECORDCOUNT=1000000
OPCOUNT=10000000
RUNTIME=180
PRINT_USAGE="Usage: $0 [ -T run_time -O operations -R record_count -r ]"
function print_usage {
if [ -n "$PRINT_USAGE" ]; then
echo "$PRINT_USAGE"
fi
}
while getopts "R:O:T:" opt
do
case $opt in
R)
RECORDCOUNT=$OPTARG
;;
O)
OPCOUNT=$OPTARG
;;
T)
RUNTIME=$OPTARG
;;
\?)
print_usage
exit 1
;;
esac
done
shift $((OPTIND -1))
for run_workload in {a..f}
do
workload="workloads/workload${run_workload}"
LOAD_OPTS="-db site.ycsb.db.aerospike.AerospikeClient -P conf/db.properties -P $workload -threads $THREADCOUNT_LOAD -p recordcount=$RECORDCOUNT -s -load"
RUN_OPTS="-db site.ycsb.db.aerospike.AerospikeClient -P conf/db.properties -P $workload -threads $THREADCOUNT_RUN -p recordcount=$RECORDCOUNT -p operationcount=$OPCOUNT -p maxexecutiontime=$RUNTIME -s -t"
java -cp "$CLASSPATH" site.ycsb.db.aerospike.TruncateSet -p conf/db.properties
java -cp "$CLASSPATH" site.ycsb.Client $LOAD_OPTS
java -cp "$CLASSPATH" site.ycsb.Client $RUN_OPTS
done