Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4B02299CD for ; Tue, 17 Apr 2012 07:30:11 +0000 (UTC) Received: (qmail 20415 invoked by uid 500); 17 Apr 2012 07:30:11 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 20382 invoked by uid 500); 17 Apr 2012 07:30:11 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 20127 invoked by uid 99); 17 Apr 2012 07:30:10 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Apr 2012 07:30:10 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 58046D455; Tue, 17 Apr 2012 07:30:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: slebresne@apache.org To: commits@cassandra.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [7/7] git commit: allow running stress from build classes patch by Vijay; reviewed by jbellis for CASSANDRA-4139 Message-Id: <20120417073010.58046D455@tyr.zones.apache.org> Date: Tue, 17 Apr 2012 07:30:10 +0000 (UTC) allow running stress from build classes patch by Vijay; reviewed by jbellis for CASSANDRA-4139 Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/1ef97386 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/1ef97386 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/1ef97386 Branch: refs/heads/trunk Commit: 1ef973867f555cc33ccf17a45fc5d67aef081b60 Parents: a6302d6 Author: Vijay Parthasarathy Authored: Mon Apr 16 15:43:53 2012 -0700 Committer: Vijay Parthasarathy Committed: Mon Apr 16 15:50:25 2012 -0700 ---------------------------------------------------------------------- build.xml | 23 +++++----- tools/bin/stress | 48 +++++++++++++++++++++ tools/bin/stress.bat | 31 ++++++++++++++ tools/bin/stressd | 84 ++++++++++++++++++++++++++++++++++++++ tools/stress/bin/stress | 37 ----------------- tools/stress/bin/stress.bat | 31 -------------- tools/stress/bin/stressd | 73 --------------------------------- 7 files changed, 175 insertions(+), 152 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/1ef97386/build.xml ---------------------------------------------------------------------- diff --git a/build.xml b/build.xml index ca83a0d..6ec0cde 100644 --- a/build.xml +++ b/build.xml @@ -655,7 +655,7 @@ The build target builds all the .class files --> + depends="maven-ant-tasks-retrieve-build,avro-generate,build-subprojects,build-project" description="Compile Cassandra classes"/> @@ -687,12 +687,12 @@ - + - + @@ -780,8 +780,8 @@ - - + + @@ -898,13 +898,13 @@ - - - + + + + + + - - - @@ -923,6 +923,7 @@ + http://git-wip-us.apache.org/repos/asf/cassandra/blob/1ef97386/tools/bin/stress ---------------------------------------------------------------------- diff --git a/tools/bin/stress b/tools/bin/stress new file mode 100644 index 0000000..8c8d22f --- /dev/null +++ b/tools/bin/stress @@ -0,0 +1,48 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if [ "x$CLASSPATH" = "x" ]; then + + # execute from the build dir. + if [ -d `dirname $0`/../../build/classes ]; then + for directory in `dirname $0`/../../build/classes/*; do + CLASSPATH=$CLASSPATH:$directory + done + else + if [ -f `dirname $0`/../lib/stress.jar ]; then + CLASSPATH=`dirname $0`/../lib/stress.jar + fi + fi + + for jar in `dirname $0`/../../lib/*.jar; do + CLASSPATH=$CLASSPATH:$jar + done +fi + +if [ -x $JAVA_HOME/bin/java ]; then + JAVA=$JAVA_HOME/bin/java +else + JAVA=`which java` +fi + +if [ "x$JAVA" = "x" ]; then + echo "Java executable not found (hint: set JAVA_HOME)" >&2 + exit 1 +fi + +$JAVA -server -cp $CLASSPATH org.apache.cassandra.stress.Stress $@ http://git-wip-us.apache.org/repos/asf/cassandra/blob/1ef97386/tools/bin/stress.bat ---------------------------------------------------------------------- diff --git a/tools/bin/stress.bat b/tools/bin/stress.bat new file mode 100644 index 0000000..78e8dbb --- /dev/null +++ b/tools/bin/stress.bat @@ -0,0 +1,31 @@ +@REM Licensed to the Apache Software Foundation (ASF) under one or more +@REM contributor license agreements. See the NOTICE file distributed with +@REM this work for additional information regarding copyright ownership. +@REM The ASF licenses this file to You under the Apache License, Version 2.0 +@REM (the "License"); you may not use this file except in compliance with +@REM the License. You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, software +@REM distributed under the License is distributed on an "AS IS" BASIS, +@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@REM See the License for the specific language governing permissions and +@REM limitations under the License. + +@echo off + +if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%CD%\..\.. +if NOT DEFINED STRESS_HOME set STRESS_HOME=%CD% + +set CLASSPATH="%STRESS_HOME%\..\lib\*.jar" +for %%i in ("%CASSANDRA_HOME%\lib\*.jar") do call :append "%%i" + set CLASSPATH=%CLASSPATH%;"%%i" +goto start + +:append +set CLASSPATH=%CLASSPATH%;%1 +goto :eof + +:start +"%JAVA_HOME%\bin\java" -cp %CLASSPATH% org.apache.cassandra.stress.Stress %* http://git-wip-us.apache.org/repos/asf/cassandra/blob/1ef97386/tools/bin/stressd ---------------------------------------------------------------------- diff --git a/tools/bin/stressd b/tools/bin/stressd new file mode 100644 index 0000000..400ebb0 --- /dev/null +++ b/tools/bin/stressd @@ -0,0 +1,84 @@ +#!/bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +DESC="Stress Test Daemon" + +if [ "x$CLASSPATH" = "x" ]; then + + # execute from the build dir. + if [ -d `dirname $0`/../../build/classes ]; then + for directory in `dirname $0`/../../build/classes/*; do + CLASSPATH=$CLASSPATH:$directory + done + else + if [ -f `dirname $0`/../lib/stress.jar ]; then + CLASSPATH=`dirname $0`/../lib/stress.jar + fi + fi + + for jar in `dirname $0`/../../lib/*.jar; do + CLASSPATH=$CLASSPATH:$jar + done +fi + +if [ -x $JAVA_HOME/bin/java ]; then + JAVA=$JAVA_HOME/bin/java +else + JAVA=`which java` +fi + +if [ "x$JAVA" = "x" ]; then + echo "Java executable not found (hint: set JAVA_HOME)" >&2 + exit 1 +fi + +case "$1" in + start) + echo "Starting $DESC: " + $JAVA -server -cp $CLASSPATH org.apache.cassandra.stress.StressServer $@ 1> ./stressd.out.log 2> ./stressd.err.log & + echo $! > ./stressd.pid + echo "done." + ;; + + stop) + PID=`cat ./stressd.pid 2> /dev/null` + + if [ "x$PID" = "x" ]; then + echo "$DESC is not running." + else + kill -9 $PID + rm ./stressd.pid + echo "$DESC is stopped." + fi + ;; + + status) + PID=`cat ./stressd.pid 2> /dev/null` + + if [ "x$PID" = "x" ]; then + echo "$DESC is not running." + else + echo "$DESC is running with pid $PID." + fi + ;; + + *) + echo "Usage: $0 start|stop|status [-h ]" + ;; +esac + http://git-wip-us.apache.org/repos/asf/cassandra/blob/1ef97386/tools/stress/bin/stress ---------------------------------------------------------------------- diff --git a/tools/stress/bin/stress b/tools/stress/bin/stress deleted file mode 100755 index 811e3d7..0000000 --- a/tools/stress/bin/stress +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -if [ "x$CLASSPATH" = "x" ]; then - CLASSPATH=`dirname $0`/../stress.jar - for jar in `dirname $0`/../../../lib/*.jar; do - CLASSPATH=$CLASSPATH:$jar - done -fi - -if [ -x $JAVA_HOME/bin/java ]; then - JAVA=$JAVA_HOME/bin/java -else - JAVA=`which java` -fi - -if [ "x$JAVA" = "x" ]; then - echo "Java executable not found (hint: set JAVA_HOME)" >&2 - exit 1 -fi - -$JAVA -server -cp $CLASSPATH org.apache.cassandra.stress.Stress $@ http://git-wip-us.apache.org/repos/asf/cassandra/blob/1ef97386/tools/stress/bin/stress.bat ---------------------------------------------------------------------- diff --git a/tools/stress/bin/stress.bat b/tools/stress/bin/stress.bat deleted file mode 100644 index 0373125..0000000 --- a/tools/stress/bin/stress.bat +++ /dev/null @@ -1,31 +0,0 @@ -@REM Licensed to the Apache Software Foundation (ASF) under one or more -@REM contributor license agreements. See the NOTICE file distributed with -@REM this work for additional information regarding copyright ownership. -@REM The ASF licenses this file to You under the Apache License, Version 2.0 -@REM (the "License"); you may not use this file except in compliance with -@REM the License. You may obtain a copy of the License at -@REM -@REM http://www.apache.org/licenses/LICENSE-2.0 -@REM -@REM Unless required by applicable law or agreed to in writing, software -@REM distributed under the License is distributed on an "AS IS" BASIS, -@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@REM See the License for the specific language governing permissions and -@REM limitations under the License. - -@echo off - -if NOT DEFINED CASSANDRA_HOME set CASSANDRA_HOME=%CD%\..\.. -if NOT DEFINED STRESS_HOME set STRESS_HOME=%CD% - -set CLASSPATH="%STRESS_HOME%\..\*.jar" -for %%i in ("%CASSANDRA_HOME%\lib\*.jar") do call :append "%%i" - set CLASSPATH=%CLASSPATH%;"%%i" -goto start - -:append -set CLASSPATH=%CLASSPATH%;%1 -goto :eof - -:start -"%JAVA_HOME%\bin\java" -cp %CLASSPATH% org.apache.cassandra.stress.Stress %* http://git-wip-us.apache.org/repos/asf/cassandra/blob/1ef97386/tools/stress/bin/stressd ---------------------------------------------------------------------- diff --git a/tools/stress/bin/stressd b/tools/stress/bin/stressd deleted file mode 100755 index b7ff6f5..0000000 --- a/tools/stress/bin/stressd +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh - -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -DESC="Stress Test Daemon" - -if [ "x$CLASSPATH" = "x" ]; then - CLASSPATH=`dirname $0`/../stress.jar - for jar in `dirname $0`/../../../lib/*.jar; do - CLASSPATH=$CLASSPATH:$jar - done -fi - -if [ -x $JAVA_HOME/bin/java ]; then - JAVA=$JAVA_HOME/bin/java -else - JAVA=`which java` -fi - -if [ "x$JAVA" = "x" ]; then - echo "Java executable not found (hint: set JAVA_HOME)" >&2 - exit 1 -fi - -case "$1" in - start) - echo "Starting $DESC: " - $JAVA -server -cp $CLASSPATH org.apache.cassandra.stress.StressServer $@ 1> ./stressd.out.log 2> ./stressd.err.log & - echo $! > ./stressd.pid - echo "done." - ;; - - stop) - PID=`cat ./stressd.pid 2> /dev/null` - - if [ "x$PID" = "x" ]; then - echo "$DESC is not running." - else - kill -9 $PID - rm ./stressd.pid - echo "$DESC is stopped." - fi - ;; - - status) - PID=`cat ./stressd.pid 2> /dev/null` - - if [ "x$PID" = "x" ]; then - echo "$DESC is not running." - else - echo "$DESC is running with pid $PID." - fi - ;; - - *) - echo "Usage: $0 start|stop|status [-h ]" - ;; -esac -