List:Commits« Previous MessageNext Message »
From:Craig L Russell Date:June 9 2011 9:14pm
Subject:bzr push into mysql-5.1-telco-7.1 branch (Craig.Russell:4239 to 4240)
View as plain text  
 4240 Craig L Russell	2011-06-09
      Added build target run.clusterjdbc which uses JdbcLoad with clusterjdbc configuration
      Added "include" property to specify which operations to run, overriding "exclude"
      Provided for java.util.logging configuration to be set up in any crund properties file

    modified:
      storage/ndb/test/crund/build.xml
      storage/ndb/test/crund/config_samples/env.properties
      storage/ndb/test/crund/src/com/mysql/cluster/crund/CrundDriver.java
      storage/ndb/test/crund/src/com/mysql/cluster/crund/Driver.java
 4239 Martin Zaun	2011-06-07 [merge]
      crund - merge from ndb-7.1-dbg64

    modified:
      storage/ndb/test/crund/config_samples/crundClusterj.properties
      storage/ndb/test/crund/config_samples/crundDerby.properties
      storage/ndb/test/crund/config_samples/crundMysql.properties
      storage/ndb/test/crund/config_samples/crundNdbapi.properties
      storage/ndb/test/crund/config_samples/crundNdbj.properties
      storage/ndb/test/crund/config_samples/crundNdbjtie.properties
      storage/ndb/test/crund/config_samples/crundOpenjpaClusterj.properties
      storage/ndb/test/crund/config_samples/crundOpenjpaDerby.properties
      storage/ndb/test/crund/config_samples/crundOpenjpaMysql.properties
      storage/ndb/test/crund/config_samples/crundRun.properties
      storage/ndb/test/crund/config_samples/env.properties
      storage/ndb/test/crund/src/com/mysql/cluster/crund/ClusterjLoad.java
      storage/ndb/test/crund/src/com/mysql/cluster/crund/CrundDriver.java
      storage/ndb/test/crund/src/com/mysql/cluster/crund/Driver.java
      storage/ndb/test/crund/src/com/mysql/cluster/crund/JdbcLoad.java
      storage/ndb/test/crund/src/com/mysql/cluster/crund/JpaLoad.java
      storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbApiLoad.java
      storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbJTieLoad.java
      storage/ndb/test/crund/src/com/mysql/cluster/crund/NdbjLoad.java
      storage/ndb/test/crund/src/com/mysql/cluster/crund/ResultProcessor.java
      storage/ndb/test/crund/src/crundndb/Driver.cpp
      storage/ndb/test/crund/src/crundndb/Driver.hpp
=== modified file 'storage/ndb/test/crund/build.xml'
--- a/storage/ndb/test/crund/build.xml	2011-01-31 09:07:01 +0000
+++ b/storage/ndb/test/crund/build.xml	2011-06-09 21:09:40 +0000
@@ -181,6 +181,7 @@
     <echo message="  run.ndbjtie"/>
     <echo message="  run.ndbj"/>
     <echo message="  run.clusterj"/>
+    <echo message="  run.clusterjdbc"/>
     <echo message="  run.mysql"/>
     <echo message="  run.derby"/>
     <echo message="  run.openjpa.clusterj"/>
@@ -750,7 +751,7 @@
   <target name="compile.mysql.opt" depends="set.compile.opt,compile.mysql"/>
 
   <!-- runs the benchmark against MySQL JDBC -->
-  <target name="run.mysql" depends="set.run,set.paths.mysql.run">
+  <target name="run.mysql" depends="compile.mysql,set.run,set.paths.mysql.run">
     <echo message="using:" />
     <echo message="  classpath.mysql.run: ${toString:classpath.mysql.run}" />
     <echo message="" />
@@ -767,6 +768,60 @@
   <target name="run.mysql.opt" depends="set.compile.opt,set.run.opt,run.mysql"/>
 
   <!-- #################################################################
+       # CLUSTERJDBC
+       ################################################################# -->
+
+  <!-- sets the paths for running against CLUSTERJDBC -->
+  <target name="set.paths.clusterjdbc.run" depends="set.paths.jdbc.compile,set.paths.clusterj.run">
+    <!-- check path to the Clusterjdbc jar -->
+    <condition property="clusterjdbc.jar" value="${CLUSTERJDBC_JAR}">
+      <not>
+	<equals arg1="${CLUSTERJDBC_JAR}" arg2="$${CLUSTERJDBC_JAR}"/>
+      </not>
+    </condition>
+    <fail message="property CLUSTERJDBC_JAR not set!" unless="clusterjdbc.jar" />
+
+    <!-- check path to the antlr32 jar -->
+    <condition property="antlr32.jar" value="${ANTLR32_JAR}">
+      <not>
+	<equals arg1="${ANTLR32_JAR}" arg2="$${ANTLR32_JAR}"/>
+      </not>
+    </condition>
+    <fail message="property ANTLR32_JAR not set!" unless="antlr32.jar" />
+
+    <!-- check path to the antlrruntime jar -->
+    <condition property="antlrruntime.jar" value="${ANTLRRUNTIME_JAR}">
+      <not>
+	<equals arg1="${ANTLRRUNTIME_JAR}" arg2="$${ANTLRRUNTIME_JAR}"/>
+      </not>
+    </condition>
+    <fail message="property ANTLRRUNTIME_JAR not set!" unless="antlrruntime.jar" />
+
+    <path id="classpath.clusterjdbc.run">
+      <path refid="classpath.jdbc.compile"/>
+      <pathelement location="${MYSQL_JDBC_JAR}"/>
+      <pathelement location="${clusterj.jar}"/>
+      <pathelement location="${clusterjdbc.jar}"/>
+      <pathelement location="${antlr32.jar}"/>
+      <pathelement location="${antlrruntime.jar}"/>
+    </path>
+  </target>
+
+  <!-- runs the benchmark against MySQL CLUSTERJDBC -->
+  <target name="run.clusterjdbc" depends="compile.mysql,compile.clusterj,set.run,set.paths.clusterjdbc.run">
+    <echo message="using:" />
+    <echo message="  classpath.clusterjdbc.run: ${toString:classpath.clusterjdbc.run}" />
+    <echo message="" />
+
+    <java classname="com.mysql.cluster.crund.JdbcLoad"
+     fork="true" failonerror="true" classpathref="classpath.clusterjdbc.run">
+      <jvmarg line="${jvmflags}"/>
+      <arg line="-p crundRun.properties"/>
+      <arg line="-p crundClusterjdbc.properties"/>
+    </java>
+  </target>
+
+  <!-- #################################################################
        # Derby JDBC
        ################################################################# -->
 

=== modified file 'storage/ndb/test/crund/config_samples/env.properties'
--- a/storage/ndb/test/crund/config_samples/env.properties	2011-06-07 14:12:24 +0000
+++ b/storage/ndb/test/crund/config_samples/env.properties	2011-06-09 21:09:40 +0000
@@ -146,6 +146,16 @@ CLUSTERJ_JAR=${MYSQL_CLUSTERJ}/share/mys
 # ----------------------------------------------------------------------
 
 #
+# The Clusterj-jdbc jar files
+#
+
+CLUSTERJDBC_JAR=${MYSQL_CLUSTERJ}/share/mysql/java/clusterj.jar
+ANTLR32_JAR=${HOME}/.m2/repository/org/antlr/antlr/3.2/antlr-3.2.jar
+ANTLRRUNTIME_JAR=${HOME}/.m2/repository/org/antlr/antlr-runtime/3.2/antlr-runtime-3.2.jar
+
+# ----------------------------------------------------------------------
+
+#
 # The Cluster/JPA Jar Files
 #
 

=== modified file 'storage/ndb/test/crund/src/com/mysql/cluster/crund/CrundDriver.java'
--- a/storage/ndb/test/crund/src/com/mysql/cluster/crund/CrundDriver.java	2011-06-07 17:37:44 +0000
+++ b/storage/ndb/test/crund/src/com/mysql/cluster/crund/CrundDriver.java	2011-06-09 21:09:40 +0000
@@ -19,20 +19,11 @@
 
 package com.mysql.cluster.crund;
 
-import java.util.Properties;
-import java.util.List;
-import java.util.Set;
+import java.util.ArrayList;
 import java.util.EnumSet;
 import java.util.HashSet;
-import java.util.ArrayList;
-import java.util.Date;
-import java.text.SimpleDateFormat;
-
-import java.io.FileInputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.InputStream;
+import java.util.List;
+import java.util.Set;
 
 /**
  * This class benchmarks standard database operations over a series
@@ -71,6 +62,7 @@ abstract public class CrundDriver extend
     protected int maxBlobBytes;
     protected int maxTextChars;
     protected final Set<String> exclude = new HashSet<String>();
+    protected final Set<String> include = new HashSet<String>();
 
     // ----------------------------------------------------------------------
     // benchmark intializers/finalizers
@@ -198,9 +190,21 @@ abstract public class CrundDriver extend
         }
 
         // initialize exclude set
-        final String[] e = props.getProperty("exclude", "").split(",");
-        for (int i = 0; i < e.length; i++) {
-            exclude.add(e[i]);
+        final String[] excludeProperty = props.getProperty("exclude", "").split(",");
+        for (int i = 0; i < excludeProperty.length; i++) {
+            String excludeTest = excludeProperty[i];
+            if (!excludeTest.isEmpty()) {
+                exclude.add(excludeTest);
+            }
+        }
+
+        // initialize include set
+        final String[] includeProperty = props.getProperty("include", "").split(",");
+        for (int i = 0; i < includeProperty.length; ++i) {
+            String includeTest = includeProperty[i];
+            if (!includeTest.isEmpty()) {
+                include.add(includeTest);
+            }
         }
 
         if (msg.length() == 0) {
@@ -230,6 +234,7 @@ abstract public class CrundDriver extend
         out.println("maxBlobBytes:                   " + maxBlobBytes);
         out.println("maxTextChars:                   " + maxTextChars);
         out.println("exclude:                        " + exclude);
+        out.println("include:                        " + include);
     }
 
     // ----------------------------------------------------------------------
@@ -390,7 +395,10 @@ abstract public class CrundDriver extend
     // XXX move to generic load class
     protected void runOperation(Op op, int nOps) throws Exception {
         final String name = op.getName();
-        if (!exclude.contains(name)) {
+        // if there is an include list and this test is included, or
+        // there is not an include list and this test is not excluded
+        if ((include.size() != 0 && include.contains(name))
+                || (include.size() == 0 && !exclude.contains(name))) {
             begin(name);
             op.run(nOps);
             finish(name);

=== modified file 'storage/ndb/test/crund/src/com/mysql/cluster/crund/Driver.java'
--- a/storage/ndb/test/crund/src/com/mysql/cluster/crund/Driver.java	2011-06-07 14:12:24 +0000
+++ b/storage/ndb/test/crund/src/com/mysql/cluster/crund/Driver.java	2011-06-09 21:09:40 +0000
@@ -25,9 +25,13 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.text.SimpleDateFormat;
 
+import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.io.OutputStream;
 import java.io.PrintWriter;
 import java.io.InputStream;
 
@@ -207,6 +211,9 @@ abstract public class Driver {
         loadProperties();
         initProperties();
         printProperties();
+        writeProperties("logging.properties");
+        // setting this property allows implementations under test to use java.util.logging
+        System.setProperty("java.util.logging.config.file", "logging.properties");
         openLogFile();
         clearLogBuffers();
     }
@@ -296,6 +303,21 @@ abstract public class Driver {
         out.println("nRuns:                          " + nRuns);
     }
 
+    protected void writeProperties(String fileName) {
+        File logger = new File(fileName);
+        OutputStream out;
+        try {
+            if (!logger.exists()) {
+                logger.createNewFile();
+            }
+            out = new FileOutputStream(logger);
+            props.store(out, "Consolidated crund properties");
+        } catch (FileNotFoundException e) {
+            throw new RuntimeException("Unexpected exception opening file logger.properties.", e);
+        } catch (IOException e) {
+            throw new RuntimeException("Unexpected exception writing file logger.properties.", e);
+        }
+    }
     // opens the benchmark's data log file
     private void openLogFile() throws IOException {
         out.println();


Attachment: [text/bzr-bundle] bzr/craig.russell@oracle.com-20110609210940-6x0883aigoyohd18.bundle
Thread
bzr push into mysql-5.1-telco-7.1 branch (Craig.Russell:4239 to 4240)Craig L Russell10 Jun