[jbosscache-commits] JBoss Cache SVN: r6406 - benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/src/org/cachebench/cachewrappers.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Fri Jul 25 04:57:45 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-07-25 04:57:44 -0400 (Fri, 25 Jul 2008)
New Revision: 6406

Modified:
   benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/src/org/cachebench/cachewrappers/Coherence331Wrapper.java
Log:
Fixed stuff

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-07-25 08:55:20 UTC (rev 6405)
+++ benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/src/org/cachebench/cachewrappers/Coherence331Wrapper.java	2008-07-25 08:57:44 UTC (rev 6406)
@@ -2,6 +2,8 @@
 
 import com.tangosol.net.CacheFactory;
 import com.tangosol.net.NamedCache;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.cachebench.CacheWrapper;
 
 import java.util.List;
@@ -19,6 +21,7 @@
    private NamedCache cache;
    boolean localmode;
    Map parameters;
+   private Log log = LogFactory.getLog(Coherence331Wrapper.class);
 
    public void init(Map parameters) throws Exception
    {
@@ -33,35 +36,36 @@
       if (trimmedConfig.indexOf("repl") == 0)
       {
          cache = CacheFactory.getCache("repl-CacheBenchmarkFramework");
-         return;
       }
-      if (trimmedConfig.indexOf("dist") == 0)
+      else if (trimmedConfig.indexOf("dist") == 0)
       {
          cache = CacheFactory.getCache("dist-CacheBenchmarkFramework");
-         return;
       }
-      if (trimmedConfig.indexOf("local") == 0)
+      else if (trimmedConfig.indexOf("local") == 0)
       {
          cache = CacheFactory.getCache("local-CacheBenchmarkFramework");
-         return;
       }
-      if (trimmedConfig.indexOf("opt") == 0)
+      else if (trimmedConfig.indexOf("opt") == 0)
       {
          cache = CacheFactory.getCache("opt-CacheBenchmarkFramework");
-         return;
       }
-      if (trimmedConfig.indexOf("near") == 0)
+      else if (trimmedConfig.indexOf("near") == 0)
       {
          cache = CacheFactory.getCache("near-CacheBenchmarkFramework");
-         return;
       }
+      else
+         throw new RuntimeException("Invalid configuration ('" + trimmedConfig + "'). Configuration name should start with: 'dist', 'repl', 'local', 'opt' or 'near'");
 
-      throw new RuntimeException("Invalid configuration ('" + trimmedConfig + "'). Configuration name should start with: 'dist', 'repl', 'local', 'opt' or 'near'");
+      log.info("Starting Coherence cache " + cache.getCacheName());
    }
 
    public void tearDown() throws Exception
    {
-      if (cache != null) cache.release();
+      if (cache != null)
+      {
+         cache.release();
+         cache.destroy();
+      }
    }
 
    public void put(List<String> path, Object key, Object value) throws Exception
@@ -81,12 +85,12 @@
 
    public int getNumMembers()
    {
-      return cache.getCacheService().getCluster().getMemberSet().size();
+      return localmode ? 0 : cache.getCacheService().getCluster().getMemberSet().size();
    }
 
    public String getInfo()
    {
-      return null;
+      return cache.getCacheName();
    }
 
    public Object getReplicatedData(List<String> path, String key) throws Exception




More information about the jbosscache-commits mailing list