add back tools/bin after merging revert from 1.0
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/ec242b7f Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/ec242b7f Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/ec242b7f Branch: refs/heads/trunk Commit: ec242b7fc56f9d83c2e64520608e922906e6804e Parents: 5716c2f Author: Jonathan Ellis <jbel...@apache.org> Authored: Wed Apr 18 11:21:42 2012 -0500 Committer: Jonathan Ellis <jbel...@apache.org> Committed: Wed Apr 18 11:26:50 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, 209 insertions(+), 243 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/ec242b7f/build.xml ---------------------------------------------------------------------- diff --git a/build.xml b/build.xml index 9d0ea3e..6ec0cde 100644 --- a/build.xml +++ b/build.xml @@ -684,12 +684,34 @@ <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" + depends="maven-declare-dependencies,build, build-test, stress-build" description="Assemble Cassandra JAR files"> <mkdir dir="${build.classes.main}/META-INF" /> <mkdir dir="${build.classes.thrift}/META-INF" /> @@ -751,6 +773,20 @@ <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> <!-- @@ -862,7 +898,14 @@ <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" @@ -880,6 +923,7 @@ <!-- 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/ec242b7f/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/ec242b7f/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/ec242b7f/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 <host>]" + ;; +esac + http://git-wip-us.apache.org/repos/asf/cassandra/blob/ec242b7f/tools/stress/bin/stress ---------------------------------------------------------------------- diff --git a/tools/stress/bin/stress b/tools/stress/bin/stress deleted file mode 100755 index 4e60686..0000000 --- a/tools/stress/bin/stress +++ /dev/null @@ -1,51 +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 - # 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/ec242b7f/tools/stress/bin/stress.bat ---------------------------------------------------------------------- diff --git a/tools/stress/bin/stress.bat b/tools/stress/bin/stress.bat deleted file mode 100644 index f7b0421..0000000 --- a/tools/stress/bin/stress.bat +++ /dev/null @@ -1,33 +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%\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/ec242b7f/tools/stress/bin/stressd ---------------------------------------------------------------------- diff --git a/tools/stress/bin/stressd b/tools/stress/bin/stressd deleted file mode 100755 index 5cc3ff2..0000000 --- a/tools/stress/bin/stressd +++ /dev/null @@ -1,87 +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 - # 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/ec242b7f/tools/stress/build.xml ---------------------------------------------------------------------- diff --git a/tools/stress/build.xml b/tools/stress/build.xml deleted file mode 100644 index a186ecf..0000000 --- a/tools/stress/build.xml +++ /dev/null @@ -1,70 +0,0 @@ -<?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>