-
Notifications
You must be signed in to change notification settings - Fork 1
/
TestCompactionParametersEffect.sh
executable file
·170 lines (150 loc) · 3.24 KB
/
TestCompactionParametersEffect.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#!/bin/bash
set -x
filename="experiment"`ls results/ -ltr | wc -l`
mkdir results/$filename
RESULT_DIR=/home/hadoop/git/physical_design/results/$filename
TEN=10
#TEN=0
SLEEP_TIME=300
#SLEEP_TIME=0
YCSB_DIR=/home/hadoop/ycsb-0.1.4
number_of_operations=500000
#number_of_operations=100
number_of_threads=20
number_of_records=10000000
#number_of_records=100
output_file_suffix='.dat'
experiment_list_file=/home/hadoop/git/physical_design/experiments.list.8
clean=false
create=false
load=false
random_read=false
scan=false
all=false
for i in $@
do
if [ "$i" == "all" ]
then
all=true
elif [ "$i" == "clean" ]
then
clean=true
elif [ "$i" == "create" ]
then
create=true
elif [ "$i" == "load" ]
then
load=true
elif [ "$i" == "random_read" ]
then
random_read=true
elif [ "$i" == "scan" ]
then
scan=true
elif [ "$i" == "workloada" ]
then
workloada=true
elif [ "$i" == "workloadb" ]
then
workloadb=true
elif [ "$i" == "workloadc" ]
then
workloadc=true
fi
done
let counter=1
function create_table {
echo "creating table..."
echo $1
hbase shell $1
}
cd $YCSB_DIR
echo `pwd`
while read line
do
if $all || $clean
then
echo "droping usertable..."
hbase shell ~/git/physical_design/delete_table
echo "sleeping for $SLEEP_TIME ..."
sleep $SLEEP_TIME
fi
if $all || $create
then
echo "creating usertable..."
create_statement=$line
echo $create_statement > $RESULT_DIR/create_$counter.script
echo "exit " >> $RESULT_DIR/create_$counter.script
create_table $RESULT_DIR/create_$counter.script
echo "sleeping for 10 sec ..."
sleep $TEN
fi
if $all || $load
then
echo "loading data..."
echo "starting time: "
echo `date +%s`
./ld $number_of_records $number_of_threads `echo $RESULT_DIR/load_$counter.dat`
echo "end time:"
echo `date +%s`
echo "sleeping for 10 sec ..."
sleep $TEN
fi
if $all || $random_read
then
echo "random read..."
echo "starting time: "
echo `date +%s`
./random_read $number_of_operations $number_of_threads `echo $RESULT_DIR/random_read_$counter.dat`
echo "end time:"
echo `date +%s`
echo "sleeping for 10 sec ..."
sleep $TEN
fi
if $all || $scan
then
echo "scan..."
echo "start time: "
echo `date +%s`
./scan $number_of_operations $number_of_threads `echo $RESULT_DIR/scan_$counter.dat`
echo "end time:"
echo `date +%s`
echo "sleeping for 10 sec ..."
sleep $TEN
fi
if $all || $workloada
then
echo "workloada..."
echo "start time: "
echo `date +%s`
./workloada $number_of_operations $number_of_threads `echo $RESULT_DIR/workloada_$counter.dat`
echo "end time:"
echo `date +%s`
echo "sleeping for 10 sec ..."
sleep $TEN
fi
if $all || $workloadb
then
echo "workloadb..."
echo "start time: "
echo `date +%s`
./workloadb $number_of_operations $number_of_threads `echo $RESULT_DIR/workloadb_$counter.dat`
echo "end time:"
echo `date +%s`
echo "sleeping for 10 sec ..."
sleep $TEN
fi
if $all || $workloadc
then
echo "workloadc..."
echo "start time: "
echo `date +%s`
./workloadc $number_of_operations $number_of_threads `echo $RESULT_DIR/workloadc_$counter.dat`
echo "end time:"
echo `date +%s`
echo "sleeping for 10 sec ..."
sleep $TEN
fi
let counter=$counter+1
done < $experiment_list_file
set +x