asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mb...@apache.org
Subject asterixdb git commit: Handle Spaces in Path For Sample Cluster
Date Mon, 15 May 2017 15:22:07 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 79416558d -> d0324c201


Handle Spaces in Path For Sample Cluster

Fixes ASTERIXDB-1842- start-sample-cluster.sh with user name ending with
space.

Change-Id: Id4b17698762e3cb2959152e6f957dad175d0f99b
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1747
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/d0324c20
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/d0324c20
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/d0324c20

Branch: refs/heads/master
Commit: d0324c201c919067a904cb1000bb8cbca1f7bf0a
Parents: 7941655
Author: Michael Blow <mblow@apache.org>
Authored: Fri May 12 21:43:02 2017 -0400
Committer: Michael Blow <mblow@apache.org>
Committed: Mon May 15 08:21:32 2017 -0700

----------------------------------------------------------------------
 .../main/opt/local/bin/start-sample-cluster.sh  | 22 ++++++++++----------
 .../main/opt/local/bin/stop-sample-cluster.sh   | 11 +++++-----
 .../server/test/SampleLocalClusterIT.java       |  2 +-
 3 files changed, 18 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/d0324c20/asterixdb/asterix-server/src/main/opt/local/bin/start-sample-cluster.sh
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/opt/local/bin/start-sample-cluster.sh b/asterixdb/asterix-server/src/main/opt/local/bin/start-sample-cluster.sh
index 4db0770..f7e0e34 100755
--- a/asterixdb/asterix-server/src/main/opt/local/bin/start-sample-cluster.sh
+++ b/asterixdb/asterix-server/src/main/opt/local/bin/start-sample-cluster.sh
@@ -48,23 +48,23 @@ fi
   "$JAVA_HOME/bin/java" -version
   exit 2
 }
-DIRNAME=$(dirname $0)
+DIRNAME=$(dirname "$0")
 [ $(echo $DIRNAME | wc -l) -ne 1 ] && {
   echo "Paths with spaces are not supported"
   exit 3
 }
 
-CLUSTERDIR=$(cd $DIRNAME/..; echo $PWD)
-INSTALLDIR=$(cd $CLUSTERDIR/../..; echo $PWD)
+CLUSTERDIR=$(cd "$DIRNAME/.."; echo $PWD)
+INSTALLDIR=$(cd "$CLUSTERDIR/../.."; echo $PWD)
 LOGSDIR=$CLUSTERDIR/logs
 
 echo "CLUSTERDIR=$CLUSTERDIR"
 echo "INSTALLDIR=$INSTALLDIR"
 echo "LOGSDIR=$LOGSDIR"
 echo
-cd $CLUSTERDIR
-mkdir -p $LOGSDIR
-$INSTALLDIR/bin/${HELPER_COMMAND} get_cluster_state -quiet \
+cd "$CLUSTERDIR"
+mkdir -p "$LOGSDIR"
+"$INSTALLDIR/bin/${HELPER_COMMAND}" get_cluster_state -quiet \
     && echo "ERROR: sample cluster address (localhost:${LISTEN_PORT}) already in
use" && exit 1
 
 if ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.\([CN]CDriver\|service\.NCService\)'
> /tmp/$$_pids; then
@@ -91,10 +91,10 @@ rm /tmp/$$_pids
   echo "--------------------------"
   date
   echo "--------------------------"
-) | tee -a $LOGSDIR/blue-service.log | tee -a $LOGSDIR/red-service.log >> $LOGSDIR/cc.log
+) | tee -a "$LOGSDIR/blue-service.log" | tee -a "$LOGSDIR/red-service.log" >> "$LOGSDIR/cc.log"
 echo "INFO: Starting sample cluster..."
-$INSTALLDIR/bin/${NC_SERVICE_COMMAND} -logdir - -config-file $CLUSTERDIR/conf/blue.conf >>
$LOGSDIR/blue-service.log 2>&1 &
-$INSTALLDIR/bin/${NC_SERVICE_COMMAND} -logdir - >> $LOGSDIR/red-service.log 2>&1
&
-$INSTALLDIR/bin/${CC_COMMAND} -config-file $CLUSTERDIR/conf/cc.conf >> $LOGSDIR/cc.log
2>&1 &
-$INSTALLDIR/bin/${HELPER_COMMAND} wait_for_cluster -timeout 30
+"$INSTALLDIR/bin/${NC_SERVICE_COMMAND}" -logdir - -config-file "$CLUSTERDIR/conf/blue.conf"
>> "$LOGSDIR/blue-service.log" 2>&1 &
+"$INSTALLDIR/bin/${NC_SERVICE_COMMAND}" -logdir - >> "$LOGSDIR/red-service.log" 2>&1
&
+"$INSTALLDIR/bin/${CC_COMMAND}" -config-file "$CLUSTERDIR/conf/cc.conf" >> "$LOGSDIR/cc.log"
2>&1 &
+"$INSTALLDIR/bin/${HELPER_COMMAND}" wait_for_cluster -timeout 30
 exit $?

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/d0324c20/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh b/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh
index 4ba5789..dbce377 100755
--- a/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh
+++ b/asterixdb/asterix-server/src/main/opt/local/bin/stop-sample-cluster.sh
@@ -48,17 +48,17 @@ fi
   "$JAVA_HOME/bin/java" -version
   exit 2
 }
-DIRNAME=$(dirname $0)
+DIRNAME=$(dirname "$0")
 [ $(echo $DIRNAME | wc -l) -ne 1 ] && {
   echo "Paths with spaces are not supported"
   exit 3
 }
 
-CLUSTERDIR=$(cd $DIRNAME/..; echo $PWD)
-INSTALLDIR=$(cd $CLUSTERDIR/../..; echo $PWD)
-$INSTALLDIR/bin/${HELPER_COMMAND} get_cluster_state -quiet
+CLUSTERDIR=$(cd "$DIRNAME/.."; echo $PWD)
+INSTALLDIR=$(cd "$CLUSTERDIR/../.."; echo $PWD)
+"$INSTALLDIR/bin/${HELPER_COMMAND}" get_cluster_state -quiet
 if [ $? -ne 1 ]; then
-  $INSTALLDIR/bin/${HELPER_COMMAND} shutdown_cluster_all
+  "$INSTALLDIR/bin/${HELPER_COMMAND}" shutdown_cluster_all
   first=1
   tries=0
   echo -n "INFO: Waiting up to 60s for cluster to shutdown"
@@ -91,3 +91,4 @@ if ps -ef | grep 'java.*org\.apache\.hyracks\.control\.[cn]c\.\([CN]CDriver\|ser
   fi
 fi
 rm /tmp/$$_pids
+

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/d0324c20/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/SampleLocalClusterIT.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/SampleLocalClusterIT.java
b/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/SampleLocalClusterIT.java
index 61128c5..496d4cf 100644
--- a/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/SampleLocalClusterIT.java
+++ b/asterixdb/asterix-server/src/test/java/org/apache/asterix/server/test/SampleLocalClusterIT.java
@@ -52,7 +52,7 @@ public class SampleLocalClusterIT {
 
     // Directory where the NCs create and store all data, as configured by
     // src/test/resources/NCServiceExecutionIT/cc.conf.
-    private static final String OUTPUT_DIR = FileUtil.joinPath(TARGET_DIR, "sample-local-cluster");
+    private static final String OUTPUT_DIR = FileUtil.joinPath(TARGET_DIR, "sample local
cluster");
 
     private static final String LOCAL_SAMPLES_DIR = FileUtil.joinPath(OUTPUT_DIR, "opt",
"local");
 


Mime
View raw message