cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject git commit: Add stress tool to binaries patch by Vijay; reviewed by driftx for CASSANDRA-4103
Date Tue, 10 Apr 2012 00:10:49 GMT
Updated Branches:
  refs/heads/cassandra-1.0 016244785 -> 9b746daf7


Add stress tool to binaries
patch by Vijay; reviewed by driftx for CASSANDRA-4103


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

Branch: refs/heads/cassandra-1.0
Commit: 9b746daf7f2d0725b6ebe678dfbedb303b71bf57
Parents: 0162447
Author: Vijay Parthasarathy <vijay2win@gmail.com>
Authored: Mon Apr 9 17:09:53 2012 -0700
Committer: Vijay Parthasarathy <vijay2win@gmail.com>
Committed: Mon Apr 9 17:09:53 2012 -0700

----------------------------------------------------------------------
 build.xml                   |   49 +++++++++++++++++++++++++--
 tools/stress/bin/stress     |   16 +--------
 tools/stress/bin/stress.bat |    4 +--
 tools/stress/bin/stressd    |   16 +--------
 tools/stress/build.xml      |   70 --------------------------------------
 5 files changed, 49 insertions(+), 106 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/9b746daf/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index ebd80f6..5cf96cb 100644
--- a/build.xml
+++ b/build.xml
@@ -641,7 +641,7 @@
         The build target builds all the .class files
     -->
     <target name="build"
-        depends="maven-ant-tasks-retrieve-build,avro-generate,build-subprojects,build-project"
description="Compile Cassandra classes"/>
+        depends="maven-ant-tasks-retrieve-build,avro-generate,build-subprojects,build-project,stress-build"
description="Compile Cassandra classes"/>
     <target name="build-subprojects" description="Compile Cassandra contrib projects"/>
     <target name="codecoverage" depends="cobertura-instrument,test,cobertura-report" description="Create
code coverage report"/>
 
@@ -670,12 +670,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="${basedir}/tools/stress/MANIFEST.MF" />
+    <path id="cassandra.classes">
+        <pathelement location="${basedir}/build/classes/main" />
+        <pathelement location="${basedir}/build/classes/thrift" />
+    </path>
+    <target name="stress-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" />
@@ -737,6 +759,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/stress" />
+      <jar destfile="${build.dir}/tools/stress/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>
 
     <!--
@@ -848,7 +884,14 @@
           <include name="*.txt" />
         </fileset>
       </copy>
-
+      <copy todir="${dist.dir}/tools/stress">
+        <fileset dir="${basedir}/tools/stress">
+            <include name="bin/**" />
+        </fileset>
+      	<fileset dir="${build.dir}/tools/stress/">
+      	    <include name="*.jar" />
+      	</fileset>
+      </copy>
       <artifact:writepom pomRefId="dist-pom" 
             file="${build.dir}/${final.name}-dist.pom"/>
       <tar compression="gzip" longfile="gnu"

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9b746daf/tools/stress/bin/stress
----------------------------------------------------------------------
diff --git a/tools/stress/bin/stress b/tools/stress/bin/stress
index 4e60686..811e3d7 100755
--- a/tools/stress/bin/stress
+++ b/tools/stress/bin/stress
@@ -17,21 +17,7 @@
 # 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
+    CLASSPATH=`dirname $0`/../stress.jar
     for jar in `dirname $0`/../../../lib/*.jar; do
         CLASSPATH=$CLASSPATH:$jar
     done

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9b746daf/tools/stress/bin/stress.bat
----------------------------------------------------------------------
diff --git a/tools/stress/bin/stress.bat b/tools/stress/bin/stress.bat
index f7b0421..0373125 100644
--- a/tools/stress/bin/stress.bat
+++ b/tools/stress/bin/stress.bat
@@ -18,9 +18,7 @@
 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"
+set CLASSPATH="%STRESS_HOME%\..\*.jar"
 for %%i in ("%CASSANDRA_HOME%\lib\*.jar") do call :append "%%i"
     set CLASSPATH=%CLASSPATH%;"%%i"
 goto start

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9b746daf/tools/stress/bin/stressd
----------------------------------------------------------------------
diff --git a/tools/stress/bin/stressd b/tools/stress/bin/stressd
index 5cc3ff2..b7ff6f5 100755
--- a/tools/stress/bin/stressd
+++ b/tools/stress/bin/stressd
@@ -19,21 +19,7 @@
 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
+    CLASSPATH=`dirname $0`/../stress.jar
     for jar in `dirname $0`/../../../lib/*.jar; do
         CLASSPATH=$CLASSPATH:$jar
     done

http://git-wip-us.apache.org/repos/asf/cassandra/blob/9b746daf/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>


Mime
View raw message