[jbosscache-commits] JBoss Cache SVN: r7216 - in benchmarks/benchmark-fwk/trunk/cache-products: starobrno/src/org/cachebench/cachewrappers and 1 other directory.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Thu Nov 27 09:38:14 EST 2008


Author: manik.surtani at jboss.com
Date: 2008-11-27 09:38:14 -0500 (Thu, 27 Nov 2008)
New Revision: 7216

Modified:
   benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/ehcache-1.5.0.iml
   benchmarks/benchmark-fwk/trunk/cache-products/starobrno/src/org/cachebench/cachewrappers/StarobrnoWrapper.java
Log:
bench tree cache as well

Modified: benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/ehcache-1.5.0.iml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/ehcache-1.5.0.iml	2008-11-27 14:11:09 UTC (rev 7215)
+++ benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/ehcache-1.5.0.iml	2008-11-27 14:38:14 UTC (rev 7216)
@@ -1,46 +1,253 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module relativePaths="true" type="JAVA_MODULE" version="4">
-  <component name="NewModuleRootManager" inherit-compiler-output="true">
-    <exclude-output />
-    <content url="file://$MODULE_DIR$">
-      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
-    </content>
-    <orderEntry type="inheritedJdk" />
-    <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="module" module-name="CacheBenchmarkFwk" />
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/commons-logging.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/ehcache.jar!/" />
-        </CLASSES>
-        <JAVADOC>
-          <root url="file://$MODULE_DIR$/../../../products/ehcache-1.5.0/javadocs" />
-        </JAVADOC>
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/lib/backport-util-concurrent-3.0.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
-    <orderEntryProperties />
-    <javadoc-paths>
-      <root url="jar://$MODULE_DIR$/../../../products/ehcache-1.5.0/ehcache-1.5.0-javadoc.zip!/" />
-    </javadoc-paths>
-  </component>
-</module>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="CacheBenchmarkFwk" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/lib/commons-logging.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/lib/ehcache.jar!/" />
+        </CLASSES>
+        <JAVADOC>
+          <root url="file://$MODULE_DIR$/../../../products/ehcache-1.5.0/javadocs" />
+        </JAVADOC>
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/lib/backport-util-concurrent-3.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../whirlycache-1.0.1/lib/whirlycache-1.0.1.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../whirlycache-1.0.1/lib/concurrent-1.3.4.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../whirlycache-1.0.1/lib/commons-collections-3.1.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../whirlycache-1.0.1/lib/commons-logging.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/smtp.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/jcommon.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/mailapi.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/dsn.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/commons-logging.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/commons-beanutils.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/commons-math-1.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/pop3.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/log4j.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/activation.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/mail.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/imap.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/commons-digester.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/jfreechart.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/lib/ehcache.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/lib/backport-util-concurrent-3.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/lib/commons-logging.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../../lib/common/testng-5.1-jdk15.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/../coherence-3.3.1/lib/commons-logging.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module" module-name="Trunk" />
+    <javadoc-paths>
+      <root url="jar://$MODULE_DIR$/../../../products/ehcache-1.5.0/ehcache-1.5.0-javadoc.zip!/" />
+    </javadoc-paths>
+  </component>
+</module>
+

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-11-27 14:11:09 UTC (rev 7215)
+++ benchmarks/benchmark-fwk/trunk/cache-products/starobrno/src/org/cachebench/cachewrappers/StarobrnoWrapper.java	2008-11-27 14:38:14 UTC (rev 7216)
@@ -5,6 +5,9 @@
 import org.cachebench.CacheWrapper;
 import org.jboss.cache.DefaultCacheFactory;
 import org.jboss.starobrno.Cache;
+import org.jboss.starobrno.tree.TreeCache;
+import org.jboss.starobrno.tree.TreeCacheImpl;
+import org.jboss.starobrno.tree.Fqn;
 
 import java.util.List;
 import java.util.Map;
@@ -12,18 +15,27 @@
 public class StarobrnoWrapper implements CacheWrapper
 {
    private Cache flatCache;
+   private TreeCache treeCache;
    private Log log = LogFactory.getLog(StarobrnoWrapper.class);
 
+   private boolean useTree = false;
+
+
    public StarobrnoWrapper()
    {
    }
 
    public void init(Map parameters) throws Exception
    {
+      useTree = Boolean.getBoolean("starobrno.tree");
       log.info("Creating cache with the following configuration: " + parameters);
-      flatCache = new DefaultCacheFactory().createCache((String) parameters.get("config"));
+      flatCache = new DefaultCacheFactory().createCache((String) parameters.get("config"), false);
+      if (useTree) flatCache.getConfiguration().setInvocationBatchingEnabled(true);
+      flatCache.start();
       log.info("Running following JBossCacheVersion: " + org.jboss.cache.Version.version);
       log.info("Running following JBossCacheCodeName: " + org.jboss.cache.Version.codename);
+      log.info("Starobrno: Using tree API? " + useTree);
+      if (useTree) treeCache = new TreeCacheImpl(flatCache);
    }
 
    public void setUp() throws Exception
@@ -37,12 +49,18 @@
 
    public void put(List<String> path, Object key, Object value) throws Exception
    {
-      flatCache.put(key, value);
+      if (useTree)
+         treeCache.put(Fqn.fromList(path, true), key, value);
+      else
+         flatCache.put(key, value);
    }
 
    public Object get(List<String> path, Object key) throws Exception
    {
-      return flatCache.get(key);
+      if (useTree)
+         return treeCache.get(Fqn.fromList(path, true), key);
+      else
+         return flatCache.get(key);
    }
 
    public void empty() throws Exception
@@ -62,7 +80,11 @@
 
    public Object getReplicatedData(List<String> path, String key) throws Exception
    {
-      return flatCache.get(key); // todo
+      if (useTree)
+         return treeCache.get(Fqn.fromList(path, true), key);
+      else
+         return flatCache.get(key);
+//      return flatCache.get(key); // todo
 //      if (!cache.getConfiguration().getCacheMode().isSynchronous())
 //      {
 //         log.info("Sleeping 5 seconds because the cache is replicated asynchronious!");




More information about the jbosscache-commits mailing list