-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.sh
executable file
·58 lines (49 loc) · 1.49 KB
/
run.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
#!/usr/bin/env bash
APPNAME="trendingtopics"
CLASSPATH="`ls -x ../../voltdb/voltdb-*.jar | tr '[:space:]' ':'``ls -x ../../lib/*.jar | tr '[:space:]' ':'`"
VOLTDB="../../bin/voltdb"
VOLTCOMPILER="../../bin/voltcompiler"
LOG4J="`pwd`/../../voltdb/log4j.xml"
LICENSE="../../voltdb/license.xml"
LEADER="localhost"
# remove build artifacts
function clean() {
rm -rf obj debugoutput $APPNAME.jar voltdbroot voltdbroot
}
# compile the source code for procedures and the client
function srccompile() {
mkdir -p obj
javac -classpath $CLASSPATH -d obj \
src/trendingtopics/*.java \
src/trendingtopics/procedures/*.java
# stop if compilation fails
if [ $? != 0 ]; then exit; fi
}
# build an application catalog
function catalog() {
srccompile
echo "Done"
$VOLTCOMPILER obj project.xml $APPNAME.jar
# stop if compilation fails
if [ $? != 0 ]; then exit; fi
echo "NOt AGAIN"
}
# run the voltdb server locally
function server() {
# if a catalog doesn't exist, build one
if [ ! -f $APPNAME.jar ]; then catalog; fi
# run the server
$VOLTDB create catalog $APPNAME.jar deployment deployment.xml \
license $LICENSE leader $LEADER
}
# run the client that drives the example
function client() {
trendingtopics
}
function trendingtopics(){
srccompile
java -classpath obj:$CLASSPATH:obj trendingtopics.trendingtopics
}
# Run the target passed as the first arg on the command line
# If no first arg, run server
if [ $# = 1 ]; then $1; else server; fi