You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2012/01/24 22:09:28 UTC

svn commit: r1235499 - in /incubator/accumulo/branches/1.4/test/system/randomwalk/bin: copy-config.sh kill-all.sh reset-cluster.sh start-all.sh start-local.sh

Author: ecn
Date: Tue Jan 24 21:09:27 2012
New Revision: 1235499

URL: http://svn.apache.org/viewvc?rev=1235499&view=rev
Log:
ACCUMULO-345

Modified:
    incubator/accumulo/branches/1.4/test/system/randomwalk/bin/copy-config.sh
    incubator/accumulo/branches/1.4/test/system/randomwalk/bin/kill-all.sh
    incubator/accumulo/branches/1.4/test/system/randomwalk/bin/reset-cluster.sh
    incubator/accumulo/branches/1.4/test/system/randomwalk/bin/start-all.sh
    incubator/accumulo/branches/1.4/test/system/randomwalk/bin/start-local.sh

Modified: incubator/accumulo/branches/1.4/test/system/randomwalk/bin/copy-config.sh
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/test/system/randomwalk/bin/copy-config.sh?rev=1235499&r1=1235498&r2=1235499&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/test/system/randomwalk/bin/copy-config.sh (original)
+++ incubator/accumulo/branches/1.4/test/system/randomwalk/bin/copy-config.sh Tue Jan 24 21:09:27 2012
@@ -31,7 +31,7 @@ RW_HOME=$ACCUMULO_HOME/test/system/rando
 cd $RW_HOME
 
 tar czf config.tgz conf
-$HADOOP_HOME/bin/hadoop fs -rmr /randomwalk
+$HADOOP_HOME/bin/hadoop fs -rmr /randomwalk 2>/dev/null
 $HADOOP_HOME/bin/hadoop fs -mkdir /randomwalk
 $HADOOP_HOME/bin/hadoop fs -put config.tgz /randomwalk
 $HADOOP_HOME/bin/hadoop fs -setrep 3 /randomwalk/config.tgz

Modified: incubator/accumulo/branches/1.4/test/system/randomwalk/bin/kill-all.sh
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/test/system/randomwalk/bin/kill-all.sh?rev=1235499&r1=1235498&r2=1235499&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/test/system/randomwalk/bin/kill-all.sh (original)
+++ incubator/accumulo/branches/1.4/test/system/randomwalk/bin/kill-all.sh Tue Jan 24 21:09:27 2012
@@ -15,16 +15,24 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
-bin=`dirname "$0"`
+#copied below from hadoop-config.sh
+this="$0"
+while [ -h "$this" ]; do
+    ls=`ls -ld "$this"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '.*/.*' > /dev/null; then
+        this="$link"
+    else
+        this=`dirname "$this"`/"$link"
+    fi
+done
+bin=`dirname "$this"`
+script=`basename "$this"`
 bin=`cd "$bin"; pwd`
+this="$bin/$script"
 
-. "$bin"/../../../../conf/accumulo-env.sh
-
-if [ -z $ACCUMULO_HOME ] ; then
-    echo "ACCUMULO_HOME is not set.  Please make sure it's set globally."
-    exit 1
-fi
+ACCUMULO_HOME=`dirname "$this"`/../../../..
+export ACCUMULO_HOME=`cd $ACCUMULO_HOME; pwd`
 
 RW_HOME=$ACCUMULO_HOME/test/system/randomwalk
 

Modified: incubator/accumulo/branches/1.4/test/system/randomwalk/bin/reset-cluster.sh
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/test/system/randomwalk/bin/reset-cluster.sh?rev=1235499&r1=1235498&r2=1235499&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/test/system/randomwalk/bin/reset-cluster.sh (original)
+++ incubator/accumulo/branches/1.4/test/system/randomwalk/bin/reset-cluster.sh Tue Jan 24 21:09:27 2012
@@ -15,14 +15,31 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+#copied below from hadoop-config.sh
+this="$0"
+while [ -h "$this" ]; do
+    ls=`ls -ld "$this"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '.*/.*' > /dev/null; then
+        this="$link"
+    else
+        this=`dirname "$this"`/"$link"
+    fi
+done
+bin=`dirname "$this"`
+script=`basename "$this"`
+bin=`cd "$bin"; pwd`
+this="$bin/$script"
 
-if [ -z $HADOOP_HOME ] ; then
-    echo "HADOOP_HOME is not set.  Please make sure it's set globally."
-    exit 1
+ACCUMULO_HOME=`dirname "$this"`/../../../..
+export ACCUMULO_HOME=`cd $ACCUMULO_HOME; pwd`
+
+if [ -f $ACCUMULO_HOME/conf/accumulo-env.sh ] ; then
+. $ACCUMULO_HOME/conf/accumulo-env.sh
 fi
 
-if [ -z $ACCUMULO_HOME ] ; then
-    echo "ACCUMULO_HOME is not set.  Please make sure it's set globally."
+if [ -z $HADOOP_HOME ] ; then
+    echo "HADOOP_HOME is not set.  Please make sure it's set globally."
     exit 1
 fi
 

Modified: incubator/accumulo/branches/1.4/test/system/randomwalk/bin/start-all.sh
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/test/system/randomwalk/bin/start-all.sh?rev=1235499&r1=1235498&r2=1235499&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/test/system/randomwalk/bin/start-all.sh (original)
+++ incubator/accumulo/branches/1.4/test/system/randomwalk/bin/start-all.sh Tue Jan 24 21:09:27 2012
@@ -15,18 +15,32 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-bin=`dirname "$0"`
+#copied below from hadoop-config.sh
+this="$0"
+while [ -h "$this" ]; do
+    ls=`ls -ld "$this"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '.*/.*' > /dev/null; then
+        this="$link"
+    else
+        this=`dirname "$this"`/"$link"
+    fi
+done
+bin=`dirname "$this"`
+script=`basename "$this"`
 bin=`cd "$bin"; pwd`
+this="$bin/$script"
 
-. "$bin"/../../../../conf/accumulo-env.sh
+ACCUMULO_HOME=`dirname "$this"`/../../../..
+export ACCUMULO_HOME=`cd $ACCUMULO_HOME; pwd`
 
-if [ -z $HADOOP_HOME ] ; then
-    echo "HADOOP_HOME is not set.  Please make sure it's set globally."
-    exit 1
+if [ -f $ACCUMULO_HOME/conf/accumulo-env.sh ] ; then
+. $ACCUMULO_HOME/conf/accumulo-env.sh
 fi
 
-if [ -z $ACCUMULO_HOME ] ; then
-    echo "ACCUMULO_HOME is not set.  Please make sure it's set globally."
+
+if [ -z "$HADOOP_HOME" ] ; then
+    echo "HADOOP_HOME is not set.  Please make sure it's set globally."
     exit 1
 fi
 
@@ -35,10 +49,10 @@ if [ "$1" = "" ] ; then
      exit 1
 fi
 
-RW_HOME=$ACCUMULO_HOME/test/system/randomwalk
+RW_HOME="$ACCUMULO_HOME/test/system/randomwalk"
 
 echo 'copying randomwalk config to HDFS'
-$RW_HOME/bin/copy-config.sh
+"$RW_HOME/bin/copy-config.sh"
 
 echo 'starting walkers'
-pssh -i -h $RW_HOME/conf/walkers "$RW_HOME/bin/start-local.sh $1" < /dev/null
+pssh -i -h "$RW_HOME/conf/walkers" "$RW_HOME/bin/start-local.sh $1" < /dev/null

Modified: incubator/accumulo/branches/1.4/test/system/randomwalk/bin/start-local.sh
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/test/system/randomwalk/bin/start-local.sh?rev=1235499&r1=1235498&r2=1235499&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/test/system/randomwalk/bin/start-local.sh (original)
+++ incubator/accumulo/branches/1.4/test/system/randomwalk/bin/start-local.sh Tue Jan 24 21:09:27 2012
@@ -15,18 +15,32 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-bin=`dirname "$0"`
+
+#copied below from hadoop-config.sh
+this="$0"
+while [ -h "$this" ]; do
+    ls=`ls -ld "$this"`
+    link=`expr "$ls" : '.*-> \(.*\)$'`
+    if expr "$link" : '.*/.*' > /dev/null; then
+        this="$link"
+    else
+        this=`dirname "$this"`/"$link"
+    fi
+done
+bin=`dirname "$this"`
+script=`basename "$this"`
 bin=`cd "$bin"; pwd`
+this="$bin/$script"
 
-. "$bin"/../../../../conf/accumulo-env.sh
+ACCUMULO_HOME=`dirname "$this"`/../../../..
+export ACCUMULO_HOME=`cd $ACCUMULO_HOME; pwd`
 
-if [ -z $HADOOP_HOME ] ; then
-    echo "HADOOP_HOME is not set.  Please make sure it's set globally."
-    exit 1
+if [ -f $ACCUMULO_HOME/conf/accumulo-env.sh ] ; then
+. $ACCUMULO_HOME/conf/accumulo-env.sh
 fi
 
-if [ -z $ACCUMULO_HOME ] ; then
-    echo "ACCUMULO_HOME is not set.  Please make sure it's set globally."
+if [ -z "$HADOOP_HOME" ] ; then
+    echo "HADOOP_HOME is not set.  Please make sure it's set globally."
     exit 1
 fi
 
@@ -35,12 +49,12 @@ if [ "$1" = "" ] ; then
      exit 1
 fi
 
-RW_HOME=$ACCUMULO_HOME/test/system/randomwalk
+RW_HOME="$ACCUMULO_HOME/test/system/randomwalk"
 
-cd $RW_HOME
+cd "$RW_HOME"
 
 # grab config from HDFS
-$HADOOP_HOME/bin/hadoop fs -get /randomwalk/config.tgz config.tgz
+"$HADOOP_HOME/bin/hadoop" fs -get /randomwalk/config.tgz config.tgz
 
 # extract config to a tmp directory
 rm -rf tmp/
@@ -49,8 +63,12 @@ tar xzf config.tgz -C tmp/
 rm config.tgz
 
 # config the logging
-RW_LOGS=$RW_HOME/logs
+RW_LOGS="$RW_HOME/logs"
+if [ ! -d "$RW_LOGS" ] 
+then
+   mkdir -p "$RW_LOGS" || ( echo "cannot create $RW_LOGS" ; exit 1 )
+fi
 LOG_ID=`hostname -s`_`date +%Y%m%d_%H%M%S`
 
 # run the local walker
-$ACCUMULO_HOME/bin/accumulo org.apache.accumulo.server.test.randomwalk.Framework $RW_HOME/tmp/conf/ $RW_LOGS $LOG_ID $1 >$RW_LOGS/$LOG_ID.out 2>$RW_LOGS/$LOG_ID.err &
+"$ACCUMULO_HOME/bin/accumulo" org.apache.accumulo.server.test.randomwalk.Framework "$RW_HOME/tmp/conf/" "$RW_LOGS" "$LOG_ID" "$1" >"$RW_LOGS/$LOG_ID.out" 2>"$RW_LOGS/$LOG_ID.err" &