Revert "allow running stress from build classes" and "Add stress tool to binaries"
This reverts commits cb7a931ffcda61392d59c995c6733c20e47c98f0 and 9b746daf7f2d0725b6ebe678dfbedb303b71bf57. Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/8c9d0fb7 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/8c9d0fb7 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/8c9d0fb7 Branch: refs/heads/cassandra-1.0 Commit: 8c9d0fb72a941a2e3153e96143a219fa25d182b0 Parents: 03ad8cd Author: Jonathan Ellis <[email protected]> Authored: Wed Apr 18 11:10:23 2012 -0500 Committer: Jonathan Ellis <[email protected]> Committed: Wed Apr 18 11:12:29 2012 -0500 ---------------------------------------------------------------------- build.xml | 48 +-------------------- tools/bin/stress | 48 --------------------- tools/bin/stress.bat | 31 ------------- tools/bin/stressd | 84 ------------------------------------ tools/stress/bin/stress | 51 ++++++++++++++++++++++ tools/stress/bin/stress.bat | 33 ++++++++++++++ tools/stress/bin/stressd | 87 ++++++++++++++++++++++++++++++++++++++ tools/stress/build.xml | 70 ++++++++++++++++++++++++++++++ 8 files changed, 243 insertions(+), 209 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c9d0fb7/build.xml ---------------------------------------------------------------------- diff --git a/build.xml b/build.xml index 885b948..ebd80f6 100644 --- a/build.xml +++ b/build.xml @@ -670,34 +670,12 @@ <antcall target="createVersionPropFile"/> </target> - <!-- Stress build file --> - <property name="stress.build.src" value="${basedir}/tools/stress/src" /> - <property name="stress.build.classes" value="${build.classes}/stress" /> - <property name="stress.manifest" value="${stress.build.classes}/MANIFEST.MF" /> - <path id="cassandra.classes"> - <pathelement location="${basedir}/build/classes/main" /> - <pathelement location="${basedir}/build/classes/thrift" /> - </path> - <target name="stress-build" depends="build"> - <mkdir dir="${stress.build.classes}" /> - <javac destdir="${stress.build.classes}" includeantruntime="true"> - <src path="${stress.build.src}" /> - <classpath> - <path refid="cassandra.classes" /> - <path> - <fileset dir="${build.lib}"> - <include name="**/*.jar" /> - </fileset> - </path> - </classpath> - </javac> - </target> <!-- The jar target makes cassandra.jar output. --> <target name="jar" - depends="maven-declare-dependencies,build, build-test, stress-build" + depends="maven-declare-dependencies,build, build-test" description="Assemble Cassandra JAR files"> <mkdir dir="${build.classes.main}/META-INF" /> <mkdir dir="${build.classes.thrift}/META-INF" /> @@ -759,20 +737,6 @@ <attribute name="Implementation-Vendor" value="Apache"/> </manifest> </jar> - - <!-- Stress jar --> - <manifest file="${stress.manifest}"> - <attribute name="Built-By" value="Pavel Yaskevich"/> - <attribute name="Main-Class" value="org.apache.cassandra.stress.Stress"/> - </manifest> - <mkdir dir="${stress.build.classes}/META-INF" /> - <mkdir dir="${build.dir}/tools/lib/" /> - <jar destfile="${build.dir}/tools/lib/stress.jar" manifest="${stress.manifest}"> - <fileset dir="${stress.build.classes}"/> - <fileset dir="${basedir}/build/classes/main" /> - <fileset dir="${basedir}/build/classes/thrift" /> - <zipgroupfileset dir="${build.lib}" includes="*.jar" /> - </jar> </target> <!-- @@ -884,14 +848,7 @@ <include name="*.txt" /> </fileset> </copy> - <copy todir="${dist.dir}/tools/bin"> - <fileset dir="${basedir}/tools/bin"/> - </copy> - <copy todir="${dist.dir}/tools/lib"> - <fileset dir="${build.dir}/tools/lib/"> - <include name="*.jar" /> - </fileset> - </copy> + <artifact:writepom pomRefId="dist-pom" file="${build.dir}/${final.name}-dist.pom"/> <tar compression="gzip" longfile="gnu" @@ -909,7 +866,6 @@ <!-- Executable scripts in bin/ --> <tarfileset dir="${dist.dir}" prefix="${final.name}" mode="755"> <include name="bin/*"/> - <include name="tools/bin/*"/> <not> <filename name="bin/*.in.sh" /> </not> http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c9d0fb7/tools/bin/stress ---------------------------------------------------------------------- diff --git a/tools/bin/stress b/tools/bin/stress deleted file mode 100755 index 8c8d22f..0000000 --- a/tools/bin/stress +++ /dev/null @@ -1,48 +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 - - # 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/8c9d0fb7/tools/bin/stress.bat ---------------------------------------------------------------------- diff --git a/tools/bin/stress.bat b/tools/bin/stress.bat deleted file mode 100755 index 78e8dbb..0000000 --- a/tools/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%\..\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/8c9d0fb7/tools/bin/stressd ---------------------------------------------------------------------- diff --git a/tools/bin/stressd b/tools/bin/stressd deleted file mode 100755 index 400ebb0..0000000 --- a/tools/bin/stressd +++ /dev/null @@ -1,84 +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 - - # 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 <host>]" - ;; -esac - http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c9d0fb7/tools/stress/bin/stress ---------------------------------------------------------------------- diff --git a/tools/stress/bin/stress b/tools/stress/bin/stress new file mode 100755 index 0000000..4e60686 --- /dev/null +++ b/tools/stress/bin/stress @@ -0,0 +1,51 @@ +#!/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 + # Cassandra class files. + if [ ! -d `dirname $0`/../../../build/classes/main ]; then + echo "Unable to locate cassandra class files" >&2 + exit 1 + fi + + # Stress class files. + if [ ! -d `dirname $0`/../build/classes ]; then + echo "Unable to locate stress class files" >&2 + exit 1 + fi + + CLASSPATH=`dirname $0`/../../../build/classes/main + CLASSPATH=$CLASSPATH:`dirname $0`/../../../build/classes/thrift + CLASSPATH=$CLASSPATH:`dirname $0`/../build/classes + 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/8c9d0fb7/tools/stress/bin/stress.bat ---------------------------------------------------------------------- diff --git a/tools/stress/bin/stress.bat b/tools/stress/bin/stress.bat new file mode 100644 index 0000000..f7b0421 --- /dev/null +++ b/tools/stress/bin/stress.bat @@ -0,0 +1,33 @@ +@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%\build\classes" +set CLASSPATH=%CLASSPATH%;"%CASSANDRA_HOME%\build\classes\main" +set CLASSPATH=%CLASSPATH%;"%CASSANDRA_HOME%\build\classes\thrift" +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/8c9d0fb7/tools/stress/bin/stressd ---------------------------------------------------------------------- diff --git a/tools/stress/bin/stressd b/tools/stress/bin/stressd new file mode 100755 index 0000000..5cc3ff2 --- /dev/null +++ b/tools/stress/bin/stressd @@ -0,0 +1,87 @@ +#!/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 + # Cassandra class files. + if [ ! -d `dirname $0`/../../../build/classes/main ]; then + echo "Unable to locate cassandra class files" >&2 + exit 1 + fi + + # Stress class files. + if [ ! -d `dirname $0`/../build/classes ]; then + echo "Unable to locate stress class files" >&2 + exit 1 + fi + + CLASSPATH=`dirname $0`/../../../build/classes/main + CLASSPATH=$CLASSPATH:`dirname $0`/../../../build/classes/thrift + CLASSPATH=$CLASSPATH:`dirname $0`/../build/classes + 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 <host>]" + ;; +esac + http://git-wip-us.apache.org/repos/asf/cassandra/blob/8c9d0fb7/tools/stress/build.xml ---------------------------------------------------------------------- diff --git a/tools/stress/build.xml b/tools/stress/build.xml new file mode 100644 index 0000000..a186ecf --- /dev/null +++ b/tools/stress/build.xml @@ -0,0 +1,70 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + ~ 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. + --> +<project basedir="." default="jar" name="stress"> + <property name="cassandra.dir" value="../.." /> + <property name="cassandra.lib" value="${cassandra.dir}/lib" /> + <property name="build.src" value="${basedir}/src" /> + <property name="build.out" value="${basedir}/build" /> + <property name="build.classes" value="${build.out}/classes" /> + <property name="final.name" value="stress" /> + + <path id="cassandra.classes"> + <pathelement location="${cassandra.dir}/build/classes/main" /> + <pathelement location="${cassandra.dir}/build/classes/thrift" /> + </path> + + <target name="init"> + <mkdir dir="${build.classes}" /> + </target> + + <target depends="init" name="build"> + <javac destdir="${build.classes}"> + <src path="${build.src}" /> + <classpath> + <path refid="cassandra.classes" /> + <path> + <fileset dir="${cassandra.lib}"> + <include name="**/*.jar" /> + </fileset> + </path> + </classpath> + </javac> + </target> + + <target name="jar" depends="build"> + <manifest file="MANIFEST.MF"> + <attribute name="Built-By" value="Pavel Yaskevich"/> + <attribute name="Main-Class" value="org.apache.cassandra.stress.Stress"/> + </manifest> + + <mkdir dir="${build.classes}/META-INF" /> + + <jar destfile="${build.out}/${final.name}.jar" manifest="MANIFEST.MF"> + <fileset dir="${build.classes}"/> + <fileset dir="${cassandra.dir}/build/classes/main" /> + <fileset dir="${cassandra.dir}/build/classes/thrift" /> + <zipgroupfileset dir="${cassandra.lib}" includes="*.jar" /> + </jar> + </target> + + <target name="clean"> + <delete dir="${build.out}" /> + </target> +</project>
