[jbosscache-commits] JBoss Cache SVN: r7262 - in benchmarks/benchmark-fwk/trunk: cache-products/ehcache-1.5.0/src/org/cachebench/cachewrappers and 14 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Mon Dec 8 09:13:39 EST 2008


Author: manik.surtani at jboss.com
Date: 2008-12-08 09:13:38 -0500 (Mon, 08 Dec 2008)
New Revision: 7262

Added:
   benchmarks/benchmark-fwk/trunk/lib/jta-1.1.jar
Modified:
   benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/src/org/cachebench/cachewrappers/Coherence331Wrapper.java
   benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/src/org/cachebench/cachewrappers/EHCacheWrapper.java
   benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-1.4.1/src/org/cachebench/cachewrappers/JBossCacheWrapper.java
   benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/src/org/cachebench/cachewrappers/JBossCache200Wrapper.java
   benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Wrapper.java
   benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/src/org/cachebench/cachewrappers/JBossCache220Wrapper.java
   benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/cachebench/cachewrappers/PojoCache220Wrapper.java
   benchmarks/benchmark-fwk/trunk/cache-products/starobrno/src/org/cachebench/cachewrappers/StarobrnoWrapper.java
   benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/TerracottaWrapper.java
   benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheWrapper.java
   benchmarks/benchmark-fwk/trunk/conf/cachebench-local.xml
   benchmarks/benchmark-fwk/trunk/conf/cachebench.xml
   benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheWrapper.java
   benchmarks/benchmark-fwk/trunk/src/org/cachebench/config/Configuration.java
   benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/SimpleTest.java
Log:
Now transactional too!

Modified: benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/src/org/cachebench/cachewrappers/Coherence331Wrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/src/org/cachebench/cachewrappers/Coherence331Wrapper.java	2008-12-07 18:53:38 UTC (rev 7261)
+++ benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/src/org/cachebench/cachewrappers/Coherence331Wrapper.java	2008-12-08 14:13:38 UTC (rev 7262)
@@ -7,6 +7,7 @@
 import org.apache.commons.logging.LogFactory;
 import org.cachebench.CacheWrapper;
 
+import javax.transaction.Transaction;
 import java.util.List;
 import java.util.Map;
 
@@ -122,4 +123,14 @@
       result.append(key);
       return result.toString();
    }
+
+   public Transaction startTransaction()
+   {
+      throw new UnsupportedOperationException("Does not support JTA!");
+   }
+
+   public void endTransaction(boolean successful)
+   {
+      throw new UnsupportedOperationException("Does not support JTA!");
+   }
 }

Modified: benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/src/org/cachebench/cachewrappers/EHCacheWrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/src/org/cachebench/cachewrappers/EHCacheWrapper.java	2008-12-07 18:53:38 UTC (rev 7261)
+++ benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/src/org/cachebench/cachewrappers/EHCacheWrapper.java	2008-12-08 14:13:38 UTC (rev 7262)
@@ -19,7 +19,7 @@
  * An implementation of SerializableCacheWrapper that uses EHCache as an underlying implementation.
  * <p/>
  * Pass in a -Dbind.address=IP_ADDRESS
- * ehcache propery files allows referencing system properties through syntax ${bind.address}. 
+ * ehcache propery files allows referencing system properties through syntax ${bind.address}.
  *
  * @author Manik Surtani (manik at surtani.org)
  * @version $Id: EHCacheWrapper.java,v 1.6 2007/05/21 16:17:56 msurtani Exp $
@@ -136,4 +136,14 @@
       }
       return o;
    }
+
+   public Object startTransaction()
+   {
+      throw new UnsupportedOperationException("Does not support JTA!");
+   }
+
+   public void endTransaction(boolean successful)
+   {
+      throw new UnsupportedOperationException("Does not support JTA!");
+   }
 }

Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-1.4.1/src/org/cachebench/cachewrappers/JBossCacheWrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-1.4.1/src/org/cachebench/cachewrappers/JBossCacheWrapper.java	2008-12-07 18:53:38 UTC (rev 7261)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-1.4.1/src/org/cachebench/cachewrappers/JBossCacheWrapper.java	2008-12-08 14:13:38 UTC (rev 7262)
@@ -5,7 +5,8 @@
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.PropertyConfigurator;
 import org.jboss.cache.TreeCache;
-
+import javax.transaction.*;
+import org.jboss.cache.transaction.*;
 import java.util.*;
 
 
@@ -74,4 +75,32 @@
       return null;   
    }
 
+   public Transaction startTransaction()
+   {
+      try
+      {
+         DummyTransactionManager.getInstance().begin();
+         return DummyTransactionManager.getInstance().getTransaction();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+   public void endTransaction(boolean successful)
+   {
+      try
+      {
+         if (successful)
+            DummyTransactionManager.getInstance().commit();
+         else
+            DummyTransactionManager.getInstance().rollback();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
 }

Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/src/org/cachebench/cachewrappers/JBossCache200Wrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/src/org/cachebench/cachewrappers/JBossCache200Wrapper.java	2008-12-07 18:53:38 UTC (rev 7261)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/src/org/cachebench/cachewrappers/JBossCache200Wrapper.java	2008-12-08 14:13:38 UTC (rev 7262)
@@ -9,7 +9,8 @@
 import org.jboss.cache.Fqn;
 import org.jboss.cache.buddyreplication.GravitateResult;
 import org.jboss.cache.marshall.NodeData;
-
+import javax.transaction.*;
+import org.jboss.cache.transaction.*;
 import java.net.URL;
 import java.util.List;
 import java.util.Map;
@@ -79,4 +80,34 @@
       NodeData nodeData = result.getNodeData().get(0);
       return nodeData.getAttributes().get(key);
    }
+
+   public Transaction startTransaction()
+   {
+      try
+      {
+         DummyTransactionManager.getInstance().begin();
+         return DummyTransactionManager.getInstance().getTransaction();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+   public void endTransaction(boolean successful)
+   {
+      try
+      {
+         if (successful)
+            DummyTransactionManager.getInstance().commit();
+         else
+            DummyTransactionManager.getInstance().rollback();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+
 }

Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Wrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Wrapper.java	2008-12-07 18:53:38 UTC (rev 7261)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Wrapper.java	2008-12-08 14:13:38 UTC (rev 7262)
@@ -9,7 +9,8 @@
 import org.jboss.cache.Fqn;
 import org.jboss.cache.buddyreplication.GravitateResult;
 import org.jboss.cache.marshall.NodeData;
-
+import javax.transaction.*;
+import org.jboss.cache.transaction.*;
 import java.util.List;
 import java.util.Map;
 
@@ -81,4 +82,33 @@
       NodeData nodeData = result.getNodeData().get(0);
       return nodeData.getAttributes().get(key);
    }
+
+
+   public Transaction startTransaction()
+   {
+      try
+      {
+         DummyTransactionManager.getInstance().begin();
+         return DummyTransactionManager.getInstance().getTransaction();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+   public void endTransaction(boolean successful)
+   {
+      try
+      {
+         if (successful)
+            DummyTransactionManager.getInstance().commit();
+         else
+            DummyTransactionManager.getInstance().rollback();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
 }

Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/src/org/cachebench/cachewrappers/JBossCache220Wrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/src/org/cachebench/cachewrappers/JBossCache220Wrapper.java	2008-12-07 18:53:38 UTC (rev 7261)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/src/org/cachebench/cachewrappers/JBossCache220Wrapper.java	2008-12-08 14:13:38 UTC (rev 7262)
@@ -10,7 +10,8 @@
 import org.jboss.cache.InvocationContext;
 import org.jboss.cache.buddyreplication.GravitateResult;
 import org.jboss.cache.marshall.NodeData;
-
+import javax.transaction.*;
+import org.jboss.cache.transaction.*;
 import java.util.List;
 import java.util.Map;
 
@@ -81,4 +82,33 @@
       NodeData nodeData = result.getNodeData().get(0);
       return nodeData.getAttributes().get(key);
    }
+
+
+   public Transaction startTransaction()
+   {
+      try
+      {
+         DummyTransactionManager.getInstance().begin();
+         return DummyTransactionManager.getInstance().getTransaction();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+   public void endTransaction(boolean successful)
+   {
+      try
+      {
+         if (successful)
+            DummyTransactionManager.getInstance().commit();
+         else
+            DummyTransactionManager.getInstance().rollback();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
 }

Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java	2008-12-07 18:53:38 UTC (rev 7261)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java	2008-12-08 14:13:38 UTC (rev 7262)
@@ -8,7 +8,8 @@
 import org.jboss.cache.Fqn;
 import org.jboss.cache.config.Option;
 import org.jboss.cache.util.Caches;
-
+import javax.transaction.Transaction;
+import org.jboss.cache.transaction.*;
 import java.util.List;
 import java.util.Map;
 
@@ -100,4 +101,33 @@
       option.setForceDataGravitation(true);
       return get(path, key);
    }
+
+
+   public Transaction startTransaction()
+   {
+      try
+      {
+         DummyTransactionManager.getInstance().begin();
+         return DummyTransactionManager.getInstance().getTransaction();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+   public void endTransaction(boolean successful)
+   {
+      try
+      {
+         if (successful)
+            DummyTransactionManager.getInstance().commit();
+         else
+            DummyTransactionManager.getInstance().rollback();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
 }

Modified: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/cachebench/cachewrappers/PojoCache220Wrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/cachebench/cachewrappers/PojoCache220Wrapper.java	2008-12-07 18:53:38 UTC (rev 7261)
+++ benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/cachebench/cachewrappers/PojoCache220Wrapper.java	2008-12-08 14:13:38 UTC (rev 7262)
@@ -11,7 +11,8 @@
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.buddyreplication.GravitateResult;
 import org.jboss.cache.marshall.NodeData;
-
+import javax.transaction.*;
+import org.jboss.cache.transaction.*;
 import java.net.URL;
 import java.util.List;
 import java.util.Map;
@@ -89,4 +90,34 @@
       //we assume that full replication is in use!!!
       return replicatedData.get(key);
    }
+
+
+   public Transaction startTransaction()
+   {
+      try
+      {
+         DummyTransactionManager.getInstance().begin();
+         return DummyTransactionManager.getInstance().getTransaction();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+   public void endTransaction(boolean successful)
+   {
+      try
+      {
+         if (successful)
+            DummyTransactionManager.getInstance().commit();
+         else
+            DummyTransactionManager.getInstance().rollback();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
 }

Modified: benchmarks/benchmark-fwk/trunk/cache-products/starobrno/src/org/cachebench/cachewrappers/StarobrnoWrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/starobrno/src/org/cachebench/cachewrappers/StarobrnoWrapper.java	2008-12-07 18:53:38 UTC (rev 7261)
+++ benchmarks/benchmark-fwk/trunk/cache-products/starobrno/src/org/cachebench/cachewrappers/StarobrnoWrapper.java	2008-12-08 14:13:38 UTC (rev 7262)
@@ -4,11 +4,13 @@
 import org.apache.commons.logging.LogFactory;
 import org.cachebench.CacheWrapper;
 import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.transaction.DummyTransactionManager;
 import org.jboss.starobrno.Cache;
+import org.jboss.starobrno.tree.Fqn;
 import org.jboss.starobrno.tree.TreeCache;
 import org.jboss.starobrno.tree.TreeCacheImpl;
-import org.jboss.starobrno.tree.Fqn;
 
+import javax.transaction.Transaction;
 import java.util.List;
 import java.util.Map;
 
@@ -94,4 +96,32 @@
 //      option.setForceDataGravitation(true);
 //      return get(path, key);
    }
+
+   public Transaction startTransaction()
+   {
+      try
+      {
+         DummyTransactionManager.getInstance().begin();
+         return DummyTransactionManager.getInstance().getTransaction();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+   public void endTransaction(boolean successful)
+   {
+      try
+      {
+         if (successful)
+            DummyTransactionManager.getInstance().commit();
+         else
+            DummyTransactionManager.getInstance().rollback();
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
 }
\ No newline at end of file

Modified: benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/TerracottaWrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/TerracottaWrapper.java	2008-12-07 18:53:38 UTC (rev 7261)
+++ benchmarks/benchmark-fwk/trunk/cache-products/terracotta-2.5.0/src/org/cachebench/cachewrappers/TerracottaWrapper.java	2008-12-08 14:13:38 UTC (rev 7262)
@@ -99,4 +99,13 @@
       return "There are " + sz + " objects in cache";
    }
 
+   public Object startTransaction()
+   {
+      throw new UnsupportedOperationException("Does not support JTA!");
+   }
+
+   public void endTransaction(boolean successful)
+   {
+      throw new UnsupportedOperationException("Does not support JTA!");
+   }
 }

Modified: benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheWrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheWrapper.java	2008-12-07 18:53:38 UTC (rev 7261)
+++ benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheWrapper.java	2008-12-08 14:13:38 UTC (rev 7262)
@@ -75,4 +75,14 @@
    {
       return get(path, key);
    }
+
+   public Object startTransaction()
+   {
+      throw new UnsupportedOperationException("Does not support JTA!");
+   }
+
+   public void endTransaction(boolean successful)
+   {
+      throw new UnsupportedOperationException("Does not support JTA!");
+   }
 }
\ No newline at end of file

Modified: benchmarks/benchmark-fwk/trunk/conf/cachebench-local.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/conf/cachebench-local.xml	2008-12-07 18:53:38 UTC (rev 7261)
+++ benchmarks/benchmark-fwk/trunk/conf/cachebench-local.xml	2008-12-08 14:13:38 UTC (rev 7262)
@@ -9,69 +9,69 @@
 	numThreads - the number of executor threads to use to perform the required number of operations.  
 -->
 <cachebench sampleSize="500000" gcBetweenTestsEnabled="true" sleepBetweenTests="1000" emptyCacheBetweenTests="true"
-            numThreads="25">
+            useTransactions="false" numThreads="25">
 
 
-   <!--
-         There are various steps we want to start executing at once: e.g. all the tests should start at the same time,
-      otherwise (part of) cluster operations do not replicate on all instances. We configure here one socket addresses
-      on each cluster node, so that the framework can communicate with all the nodes and barrier whenever needed.
-         - for each node instance socket address is specified. You can make sure that addresses are available by using
-         checkClusterAddresses ant target
-   -->
-   <!--<cluster>-->
-   <!--<member host="cluster01" port="17900"/>-->
-   <!--<member host="cluster02" port="17900"/>-->
-   <!--<member host="cluster03" port="17900"/>-->
-   <!--<member host="cluster04" port="17900"/>-->
-   <!--<member host="cluster05" port="17900"/>-->
-   <!--<member host="cluster06" port="17900"/>-->
-   <!--<member host="cluster07" port="17900"/>-->
-   <!--<member host="cluster08" port="17900"/>-->
-   <!--<member host="cluster09" port="17900"/>-->
-   <!--<member host="cluster10" port="17900"/>-->
-   <!--</cluster>-->
+    <!--
+          There are various steps we want to start executing at once: e.g. all the tests should start at the same time,
+       otherwise (part of) cluster operations do not replicate on all instances. We configure here one socket addresses
+       on each cluster node, so that the framework can communicate with all the nodes and barrier whenever needed.
+          - for each node instance socket address is specified. You can make sure that addresses are available by using
+          checkClusterAddresses ant target
+    -->
+    <!--<cluster>-->
+    <!--<member host="cluster01" port="17900"/>-->
+    <!--<member host="cluster02" port="17900"/>-->
+    <!--<member host="cluster03" port="17900"/>-->
+    <!--<member host="cluster04" port="17900"/>-->
+    <!--<member host="cluster05" port="17900"/>-->
+    <!--<member host="cluster06" port="17900"/>-->
+    <!--<member host="cluster07" port="17900"/>-->
+    <!--<member host="cluster08" port="17900"/>-->
+    <!--<member host="cluster09" port="17900"/>-->
+    <!--<member host="cluster10" port="17900"/>-->
+    <!--</cluster>-->
 
-   <!--
-     Locagically groups multiple tests.
-     param stopOnFailre : if true and one of the tests fails unexpectedly then the fwk will not run any other tests in
-                          testcase. By default set to true.
-   -->
+    <!--
+      Locagically groups multiple tests.
+      param stopOnFailre : if true and one of the tests fails unexpectedly then the fwk will not run any other tests in
+                           testcase. By default set to true.
+    -->
 
-   <testcase name="NonClusteredTest" stopOnFailure="true">
+    <testcase name="NonClusteredTest" stopOnFailure="true">
 
-      <!-- org.cachebench.warmup.PutGetCacheWarmup warms up the cache by doing operation on it; simulates a real-world environment.
-      If no warmup is needed use org.cachebench.warmup.NoCacheWarmup
-      -->
-      <warmup warmupClass="org.cachebench.warmup.PutGetCacheWarmup">
-         <param name="operationCount" value="50000"/>
-      </warmup>
+        <!-- org.cachebench.warmup.PutGetCacheWarmup warms up the cache by doing operation on it; simulates a real-world environment.
+        If no warmup is needed use org.cachebench.warmup.NoCacheWarmup
+        -->
+        <warmup warmupClass="org.cachebench.warmup.PutGetCacheWarmup">
+            <param name="operationCount" value="50000"/>
+        </warmup>
 
-      <!--
-        validates that replication is enabled and works. If repl does not occur and the stopOnFailure is set to true then exists.
-        Should be used to make sure that replication is enabled; see javadoc for more details
-      -->
-      <!--<test name="replicationOccurrsTest" testClass="org.cachebench.tests.ReplicationOccursTest">-->
-      <!--<param name="partialReplication" value="true"/>-->
-      <!--</test>-->
+        <!--
+          validates that replication is enabled and works. If repl does not occur and the stopOnFailure is set to true then exists.
+          Should be used to make sure that replication is enabled; see javadoc for more details
+        -->
+        <!--<test name="replicationOccurrsTest" testClass="org.cachebench.tests.ReplicationOccursTest">-->
+        <!--<param name="partialReplication" value="true"/>-->
+        <!--</test>-->
 
-      <!--
-         * The "name" attrib is just used for display in the reports.
-         * You can write your own custom testClass.
-         * weight is currently unused.
-      -->
-      <test name="Strings" testClass="org.cachebench.tests.simpletests.StringTest" weight="2.0" repeat="20">
-         <param name="writePercentage" value="20"/>
-      </test>
+        <!--
+           * The "name" attrib is just used for display in the reports.
+           * You can write your own custom testClass.
+           * weight is currently unused.
+        -->
+        <test name="Strings" testClass="org.cachebench.tests.simpletests.StringTest" weight="2.0" repeat="20">
+            <param name="writePercentage" value="20"/>
+        </test>
 
-      <!--<test name="SessionSimulator" testClass="org.cachebench.tests.SessionSimulatorTest" weight="2.0">-->
-      <!--<param name="numberOfRequest" value="100000"/>-->
-      <!--<param name="numberOfAttributes" value="100"/>-->
-      <!--<param name="writePercentage" value="20"/>-->
-      <!--<param name="sizeOfAnAttribute" value="1000"/>-->
-      <!--</test>-->
+        <!--<test name="SessionSimulator" testClass="org.cachebench.tests.SessionSimulatorTest" weight="2.0">-->
+        <!--<param name="numberOfRequest" value="100000"/>-->
+        <!--<param name="numberOfAttributes" value="100"/>-->
+        <!--<param name="writePercentage" value="20"/>-->
+        <!--<param name="sizeOfAnAttribute" value="1000"/>-->
+        <!--</test>-->
 
-      <!--
+        <!--
         <test name="Primitive Wrappers" testClass="org.cachebench.tests.simpletests.PrimitiveTest" weight="1.0" />
         <test name="Custom Class Types" testClass="org.cachebench.tests.simpletests.CustomClassTest" weight="1.0" />
         <test name="Custom Subclasses of Abstracts" testClass="org.cachebench.tests.simpletests.SubclassTest" weight="1.5" />
@@ -80,19 +80,19 @@
         <test name="Custom Types With Associations" testClass="org.cachebench.tests.simpletests.AssociationsTest" weight="2.0" />
         -->
 
-      <!-- WARNING - Configuration file name is now DEPRECATED and will be ignored.  Please pass in your cache config
+        <!-- WARNING - Configuration file name is now DEPRECATED and will be ignored.  Please pass in your cache config
 file name that you wish to use with the -DcacheBenchFwk.cacheConfigFile JVM parameter.  The runNode.sh
 and cluster.sh scripts will also do this for you.  -->
-   </testcase>
+    </testcase>
 
 
-   <!--
-      Available generators are: CSVReportGenerator and ClusterReportGenerator.
-      See javadocs for org.cachebench.reportgenerators.ReportGenerator for writing your
-      own report generators such as XML generators, graphic generators, etc
-   -->
-   <!-- The CSV report generated can be plugged in to a spreadsheet to generate graphs. If 'outputFile is set to
-   '-generic-' then the name would be generated as follows: 'data_<cache-product>_<configuration>_<cluster-size>.csv' -->
-   <report outputFile="-generic-" generator="org.cachebench.reportgenerators.CsvStatisticReportGenerator"/>
+    <!--
+       Available generators are: CSVReportGenerator and ClusterReportGenerator.
+       See javadocs for org.cachebench.reportgenerators.ReportGenerator for writing your
+       own report generators such as XML generators, graphic generators, etc
+    -->
+    <!-- The CSV report generated can be plugged in to a spreadsheet to generate graphs. If 'outputFile is set to
+'-generic-' then the name would be generated as follows: 'data_<cache-product>_<configuration>_<cluster-size>.csv' -->
+    <report outputFile="-generic-" generator="org.cachebench.reportgenerators.CsvStatisticReportGenerator"/>
 
 </cachebench>

Modified: benchmarks/benchmark-fwk/trunk/conf/cachebench.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/conf/cachebench.xml	2008-12-07 18:53:38 UTC (rev 7261)
+++ benchmarks/benchmark-fwk/trunk/conf/cachebench.xml	2008-12-08 14:13:38 UTC (rev 7262)
@@ -9,73 +9,73 @@
 	numThreads - the number of executor threads to use to perform the required number of operations.  
 -->
 <cachebench sampleSize="500000" gcBetweenTestsEnabled="true" sleepBetweenTests="1000" emptyCacheBetweenTests="true"
-            numThreads="10">
+            useTransactions="false" numThreads="10">
 
 
-   <!--
-         There are various steps we want to start executing at once: e.g. all the tests should start at the same time,
-      otherwise (part of) cluster operations do not replicate on all instances. We configure here one socket addresses
-      on each cluster node, so that the framework can communicate with all the nodes and barrier whenever needed.
-         - for each node instance socket address is specified. You can make sure that addresses are available by using
-         checkClusterAddresses ant target
-   -->
-   <cluster>
-      <member host="cluster01" port="17900"/>
-      <member host="cluster02" port="17900"/>
-      <member host="cluster03" port="17900"/>
-      <member host="cluster04" port="17900"/>
-      <member host="cluster05" port="17900"/>
-      <member host="cluster06" port="17900"/>
-      <member host="cluster07" port="17900"/>
-      <member host="cluster08" port="17900"/>
-      <member host="cluster09" port="17900"/>
-      <member host="cluster10" port="17900"/>
-   </cluster>
+    <!--
+          There are various steps we want to start executing at once: e.g. all the tests should start at the same time,
+       otherwise (part of) cluster operations do not replicate on all instances. We configure here one socket addresses
+       on each cluster node, so that the framework can communicate with all the nodes and barrier whenever needed.
+          - for each node instance socket address is specified. You can make sure that addresses are available by using
+          checkClusterAddresses ant target
+    -->
+    <cluster>
+        <member host="cluster01" port="17900"/>
+        <member host="cluster02" port="17900"/>
+        <member host="cluster03" port="17900"/>
+        <member host="cluster04" port="17900"/>
+        <member host="cluster05" port="17900"/>
+        <member host="cluster06" port="17900"/>
+        <member host="cluster07" port="17900"/>
+        <member host="cluster08" port="17900"/>
+        <member host="cluster09" port="17900"/>
+        <member host="cluster10" port="17900"/>
+    </cluster>
 
-   <!--
-     Locagically groups multiple tests.
-     param stopOnFailre : if true and one of the tests fails unexpectedly then the fwk will not run any other tests in
-                          testcase. By default set to true.
-   -->
+    <!--
+      Locagically groups multiple tests.
+      param stopOnFailre : if true and one of the tests fails unexpectedly then the fwk will not run any other tests in
+                           testcase. By default set to true.
+    -->
 
-   <testcase name="WebSessionReplicationTest" stopOnFailure="true">
+    <testcase name="WebSessionReplicationTest" stopOnFailure="true">
 
-      <!-- org.cachebench.warmup.PutGetCacheWarmup warms up the cache by doing operation on it; simulates a real-world environment.
-      If no warmup is needed use org.cachebench.warmup.NoCacheWarmup
-      -->
-      <warmup warmupClass="org.cachebench.warmup.PutGetCacheWarmup">
-         <param name="operationCount" value="10000"/>
-      </warmup>
+        <!-- org.cachebench.warmup.PutGetCacheWarmup warms up the cache by doing operation on it; simulates a real-world environment.
+        If no warmup is needed use org.cachebench.warmup.NoCacheWarmup
+        -->
+        <warmup warmupClass="org.cachebench.warmup.PutGetCacheWarmup">
+            <param name="operationCount" value="10000"/>
+        </warmup>
 
-      <!--
-        validates that replication is enabled and works. If repl does not occur and the stopOnFailure is set to true then exists.
-        Should be used to make sure that replication is enabled; see javadoc for more details
-      -->
-      <test name="replicationOccurrsTest" testClass="org.cachebench.tests.ReplicationOccursTest">
-         <param name="partialReplication" value="true"/>
-      </test>
+        <!--
+          validates that replication is enabled and works. If repl does not occur and the stopOnFailure is set to true then exists.
+          Should be used to make sure that replication is enabled; see javadoc for more details
+        -->
+        <test name="replicationOccurrsTest" testClass="org.cachebench.tests.ReplicationOccursTest">
+            <param name="partialReplication" value="true"/>
+        </test>
 
-      <!--
-         * The "name" attrib is just used for display in the reports.
-         * You can write your own custom testClass.
-         * weight is currently unused.
-         * repeat allows you to specify how many times this test is to be run.  Average results are used.
-      -->
-      <!--
-         <test name="Strings" testClass="org.cachebench.tests.simpletests.StringTest" weight="2.0" repeat="10">
-            <param name="writePercentage" value="20"/>
-         </test>
-      -->
+        <!--
+           * The "name" attrib is just used for display in the reports.
+           * You can write your own custom testClass.
+           * weight is currently unused.
+           * repeat allows you to specify how many times this test is to be run.  Average results are used.
+        -->
+        <!--
+           <test name="Strings" testClass="org.cachebench.tests.simpletests.StringTest" weight="2.0" repeat="10">
+              <param name="writePercentage" value="20"/>
+           </test>
+        -->
 
 
-      <test name="SessionSimulator" testClass="org.cachebench.tests.SessionSimulatorTest" weight="2.0">
-         <param name="numberOfRequest" value="500000"/>
-         <param name="numberOfAttributes" value="100"/>
-         <param name="writePercentage" value="10"/>
-         <param name="sizeOfAnAttribute" value="10000"/>
-      </test>
+        <test name="SessionSimulator" testClass="org.cachebench.tests.SessionSimulatorTest" weight="2.0">
+            <param name="numberOfRequest" value="500000"/>
+            <param name="numberOfAttributes" value="100"/>
+            <param name="writePercentage" value="10"/>
+            <param name="sizeOfAnAttribute" value="10000"/>
+        </test>
 
-      <!--
+        <!--
         <test name="Primitive Wrappers" testClass="org.cachebench.tests.simpletests.PrimitiveTest" weight="1.0" />
         <test name="Custom Class Types" testClass="org.cachebench.tests.simpletests.CustomClassTest" weight="1.0" />
         <test name="Custom Subclasses of Abstracts" testClass="org.cachebench.tests.simpletests.SubclassTest" weight="1.5" />
@@ -84,19 +84,19 @@
         <test name="Custom Types With Associations" testClass="org.cachebench.tests.simpletests.AssociationsTest" weight="2.0" />
         -->
 
-      <!-- WARNING - Configuration file name is now DEPRECATED and will be ignored.  Please pass in your cache config
+        <!-- WARNING - Configuration file name is now DEPRECATED and will be ignored.  Please pass in your cache config
 file name that you wish to use with the -DcacheBenchFwk.cacheConfigFile JVM parameter.  The runNode.sh
 and cluster.sh scripts will also do this for you.  -->
-   </testcase>
+    </testcase>
 
 
-   <!--
-      Available generators are: CSVReportGenerator and ClusterReportGenerator.
-      See javadocs for org.cachebench.reportgenerators.ReportGenerator for writing your
-      own report generators such as XML generators, graphic generators, etc
-   -->
-   <!-- The CSV report generated can be plugged in to a spreadsheet to generate graphs. If 'outputFile is set to
-   '-generic-' then the name would be generated as follows: 'data_<cache-product>_<configuration>_<cluster-size>.csv' -->
-   <report outputFile="-generic-" generator="org.cachebench.reportgenerators.ClusterReportGenerator"/>
+    <!--
+       Available generators are: CSVReportGenerator and ClusterReportGenerator.
+       See javadocs for org.cachebench.reportgenerators.ReportGenerator for writing your
+       own report generators such as XML generators, graphic generators, etc
+    -->
+    <!-- The CSV report generated can be plugged in to a spreadsheet to generate graphs. If 'outputFile is set to
+'-generic-' then the name would be generated as follows: 'data_<cache-product>_<configuration>_<cluster-size>.csv' -->
+    <report outputFile="-generic-" generator="org.cachebench.reportgenerators.ClusterReportGenerator"/>
 
 </cachebench>

Added: benchmarks/benchmark-fwk/trunk/lib/jta-1.1.jar
===================================================================
(Binary files differ)


Property changes on: benchmarks/benchmark-fwk/trunk/lib/jta-1.1.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheWrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheWrapper.java	2008-12-07 18:53:38 UTC (rev 7261)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheWrapper.java	2008-12-08 14:13:38 UTC (rev 7262)
@@ -78,5 +78,10 @@
     * structure, but use some additional structure to do this (replication tree, in the case of buddy replication).
     * This method is a hook for handling this situations.
     */
-   public Object getReplicatedData(List<String> path, String key) throws Exception;
+   Object getReplicatedData(List<String> path, String key) throws Exception;
+
+   Object startTransaction();
+
+   void endTransaction(boolean successful);
+
 }

Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/config/Configuration.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/config/Configuration.java	2008-12-07 18:53:38 UTC (rev 7261)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/config/Configuration.java	2008-12-08 14:13:38 UTC (rev 7262)
@@ -16,6 +16,7 @@
    private boolean gcBetweenTestsEnabled;
    private boolean emptyCacheBetweenTests;
    private boolean localOnly;
+   private boolean useTransactions;
 
    private ClusterConfig clusterConfig;
 
@@ -124,6 +125,16 @@
       this.maxTreeDepth = maxTreeDepth;
    }
 
+   public boolean isUseTransactions()
+   {
+      return useTransactions;
+   }
+
+   public void setUseTransactions(boolean useTransactions)
+   {
+      this.useTransactions = useTransactions;
+   }
+
    public TestCase getTestCase(String testCaseName)
    {
       for (TestCase testCase : getTestCases())

Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/SimpleTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/SimpleTest.java	2008-12-07 18:53:38 UTC (rev 7261)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/simpletests/SimpleTest.java	2008-12-08 14:13:38 UTC (rev 7262)
@@ -158,14 +158,18 @@
                      String attributeKey = key + cycleNumber;
 
                      // start your timer...
+                     boolean transactional = configuration.isUseTransactions();
                      long startTime = System.nanoTime();
+                     if (transactional) cache.startTransaction();
                      cache.put(path, attributeKey, value);
+                     if (transactional) cache.endTransaction(true);
                      long statValue = (System.nanoTime() - startTime);
                      putStats.addValue(statValue);
                      logOperation(cycleNumber, "PUTS", statValue);
                   }
                   catch (Exception e)
                   {
+                     if (configuration.isUseTransactions()) cache.endTransaction(false);
                      // how should we handle this?  Log for now...
                      log.error("Operation failed!", e);
                   }
@@ -186,14 +190,18 @@
                      String attributeKey = key + cycleNumber;
 
                      // start your timer...
+                     boolean transactional = configuration.isUseTransactions();
                      long startTime = System.nanoTime();
+                     if (transactional) cache.startTransaction();
                      cache.get(path, attributeKey);
+                     if (transactional) cache.endTransaction(true);
                      long statValue = (System.nanoTime() - startTime);
                      getStats.addValue(statValue);
                      logOperation(cycleNumber, "GETS", statValue);
                   }
                   catch (Exception e)
                   {
+                     if (configuration.isUseTransactions()) cache.endTransaction(false);
                      // how should we handle this?  Log for now...
                      log.error("Operation failed!", e);
                   }




More information about the jbosscache-commits mailing list