-
Notifications
You must be signed in to change notification settings - Fork 3
/
recipe.sh
executable file
·70 lines (58 loc) · 2.21 KB
/
recipe.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
#!/bin/bash
if [[ $1 = no-verbosity ]]; then
verbose=false
else
verbose=true
fi
dev_lib_dir=../../tlb/target
dist_lib_dir=../../server
if [ -e $dev_lib_dir ]; then
export TLB_JAR=`ls $dev_lib_dir/tlb-server*.jar`
else
export TLB_JAR=`ls $dist_lib_dir/tlb-server*.jar`
fi
source ../messages.sh
echo "You can set(to yes) or unset 'PERFORM_CORRECTNESS_CHECK' environment variable to enable or disable correctness checking"
function run {
echo "--- EXECUTING: $* ---"
$*
ret=$?
echo "--- INVOCATION RETURNED: $ret ---"
}
echo "******************************** starting the server *********************************"
starting_tlb_server_message
export TLB_DATA_DIR='/tmp/demo_tlb_store'
mkdir -p $TLB_DATA_DIR
exec java -jar $TLB_JAR 2>/tmp/7019.err 1>/tmp/7019.out &
sleep 1
tlb_server_pid=$!
echo "******************************** started the server *********************************"
export TLB_OUT_FILE=/tmp/tlb_balancer.out
export TLB_ERR_FILE=/tmp/tlb_balancer.err
export TLB_BASE_URL='http://localhost:7019'
export TLB_JOB_VERSION=`date | sed -e 's# #-#g'`
making_partitions_message $TLB_TOTAL_PARTITIONS
if [ x$PERFORM_CORRECTNESS_CHECK != x ]; then
echo "--- Correctness check ENABLED ---"
export SPLIT_CORRECTNESS_CHECKER=tlb.splitter.correctness.AbortOnFailure
else
echo "--- Correctness check DISABLED ---"
fi
echo
for((i=1; i <= $TLB_TOTAL_PARTITIONS; i++)); do
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>> executing partition $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
export TLB_PARTITION_NUMBER=$i
this_is_partition_x_of_y_message $TLB_PARTITION_NUMBER $TLB_TOTAL_PARTITIONS
export TLB_BALANCER_PORT=300$i
running_partition_x_on_port $TLB_PARTITION_NUMBER $TLB_BALANCER_PORT
run $TEST_TASK
if [ $i -eq $TLB_TOTAL_PARTITIONS -a x$SPLIT_CORRECTNESS_CHECKER != x ]; then
run $ALL_PARTITIONS_RAN_VERIFICATION_TASK
fi
echo "==================================================================================="
done
echo "****************************** terminating the tlb server ********************************"
terminating_tlb_server $TLB_BASE_URL
kill $tlb_server_pid
wait
echo "****************************** tlb server reaped *****************************************"