Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AWS] support the public/private ip #220

Merged
merged 1 commit into from
Oct 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions test.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
# copy the following command lines into test.sh
set -xe

kill $(jps | grep 'NameNode' | awk '{print $1}') || true
kill $(jps | grep 'DataNode' | awk '{print $1}') || true
./sbin/stop-dfs.sh

export DATABASE="VOLT"

if [ -z "$1" ]
then
IP="localhost"
else
IP=$1
fi

# compile stored procedures
cd ~/hadoop/voltdb && bash clean_procedures.sh
cd ~/hadoop/voltdb && bash clean_procedures.sh $IP
cd .. && javac HdfsMetaInfoSchema.java && java HdfsMetaInfoSchema
cd ~/hadoop/voltdb && bash create_procedures.sh
cd ~/hadoop/voltdb && bash create_procedures.sh $IP

# restart hadoop hdfs
cd $HADOOP_HOME
Expand Down
4 changes: 2 additions & 2 deletions voltdb/clean_procedures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Removing the Exist Stored Procedures ...
EOF


EXISTS_PRCEDURES=$(echo "show procedures" | sqlcmd | sed '1,/^--- User Procedures ------------------------------------------$/d' | awk '{print $1}')
EXISTS_PRCEDURES=$(echo "show procedures" | sqlcmd --servers=$1 | sed '1,/^--- User Procedures ------------------------------------------$/d' | awk '{print $1}')

for procedure in $VOLTDB_PROCEDURES
do
if [[ $EXISTS_PRCEDURES == *"$procedure"* ]];
then
echo "DROP PROCEDURE $procedure;" | sqlcmd;
echo "DROP PROCEDURE $procedure;" | sqlcmd --servers=$1;
fi
done

8 changes: 4 additions & 4 deletions voltdb/create_procedures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Removing the Exist Stored Procedures ...
EOF


EXISTS_PRCEDURES=$(echo "show procedures" | sqlcmd | sed '1,/^--- User Procedures ------------------------------------------$/d' | awk '{print $1}')
EXISTS_PRCEDURES=$(echo "show procedures" | sqlcmd --servers=$1 | sed '1,/^--- User Procedures ------------------------------------------$/d' | awk '{print $1}')

for procedure in $VOLTDB_PROCEDURES
do
if [[ $EXISTS_PRCEDURES == *"$procedure"* ]];
then
echo "DROP PROCEDURE $procedure;" | sqlcmd;
echo "DROP PROCEDURE $procedure;" | sqlcmd --servers=$1;
fi
done

Expand All @@ -30,7 +30,7 @@ EOF
rm -rf *.class
javac *.java
jar cvf storedprocs.jar *.class
echo "LOAD CLASSES storedprocs.jar;" | sqlcmd
echo "LOAD CLASSES storedprocs.jar;" | sqlcmd --servers=$1

cat <<EOF
============================================
Expand All @@ -42,5 +42,5 @@ EOF

for procedure in $VOLTDB_PROCEDURES
do
echo "CREATE PROCEDURE FROM CLASS $procedure;" | sqlcmd;
echo "CREATE PROCEDURE FROM CLASS $procedure;" | sqlcmd --servers=$1;
done