Author: mircea.markus
Date: 2008-01-16 05:56:33 -0500 (Wed, 16 Jan 2008)
New Revision: 5145
Added:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Wrapper.java
Removed:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Cr2Wrapper.java
Log:
Deleted:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Cr2Wrapper.java
===================================================================
---
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Cr2Wrapper.java 2008-01-16
10:42:50 UTC (rev 5144)
+++
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Cr2Wrapper.java 2008-01-16
10:56:33 UTC (rev 5145)
@@ -1,83 +0,0 @@
-package org.cachebench.cachewrappers;
-
-import org.jboss.cache.Cache;
-import org.jboss.cache.DefaultCacheFactory;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.marshall.NodeData;
-import org.jboss.cache.buddyreplication.GravitateResult;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.cachebench.CacheWrapper;
-
-import java.util.Map;
-
-/**
- * @author Mircea.Markus(a)jboss.com
- * @since 2.2
- */
-public class JBossCache210Cr2Wrapper implements CacheWrapper
-{
- private Cache cache;
- private Log log = LogFactory.getLog(JBossCache210Cr2Wrapper.class);
-
- public void init(Map parameters) throws Exception
- {
- log.info("Creating cache with the following configuration: " +
parameters);
- cache =
DefaultCacheFactory.getInstance().createCache((String)parameters.get("config"));
- log.info("Running cache with following config: " +
cache.getConfiguration());
- log.info("Running follwing JBossCacheVersion: " +
org.jboss.cache.Version.version);
- log.info("Running follwing JBossCacheCodeName: " +
org.jboss.cache.Version.codename);
- }
-
- public void setUp() throws Exception
- {
- }
-
- public void tearDown() throws Exception
- {
- cache.stop();
- }
-
- public void put(Object key, Object value) throws Exception
- {
- // make sure the threads don't conflict!
- Fqn f = new Fqn("test", key);
- cache.put(f, key, value);
- }
-
- public Object get(Object key) throws Exception
- {
- Fqn f = new Fqn("test", key);
- return cache.get(f, key);
- }
-
- public void empty() throws Exception
- {
- //not removing root because there it fails with buddy replication:
http://jira.jboss.com/jira/browse/JBCACHE-1241
- cache.removeNode(new Fqn("test"));
- }
-
- public int getNumMembers()
- {
- return cache.getMembers().size();
- }
-
- public String getInfo()
- {
- return "Num direct children: " + cache.getRoot().getChildren().size();
- }
-
- public Object getReplicatedData(String key) throws Exception
- {
- CacheSPI cacheSpi = (CacheSPI) cache;
- GravitateResult result = cacheSpi.gravitateData(new Fqn("test", key),
true);
- if (!result.isDataFound())
- {
- //totall replication?
- return get(key);
- }
- NodeData nodeData = result.getNodeData().get(0);
- return nodeData.getAttributes().get(key);
- }
-}
Copied:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Wrapper.java
(from rev 5141,
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Cr2Wrapper.java)
===================================================================
---
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Wrapper.java
(rev 0)
+++
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/src/org/cachebench/cachewrappers/JBossCache210Wrapper.java 2008-01-16
10:56:33 UTC (rev 5145)
@@ -0,0 +1,83 @@
+package org.cachebench.cachewrappers;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.marshall.NodeData;
+import org.jboss.cache.buddyreplication.GravitateResult;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.cachebench.CacheWrapper;
+
+import java.util.Map;
+
+/**
+ * @author Mircea.Markus(a)jboss.com
+ * @since 2.2
+ */
+public class JBossCache210Wrapper implements CacheWrapper
+{
+ private Cache cache;
+ private Log log = LogFactory.getLog(JBossCache210Cr2Wrapper.class);
+
+ public void init(Map parameters) throws Exception
+ {
+ log.info("Creating cache with the following configuration: " +
parameters);
+ cache =
DefaultCacheFactory.getInstance().createCache((String)parameters.get("config"));
+ log.info("Running cache with following config: " +
cache.getConfiguration());
+ log.info("Running follwing JBossCacheVersion: " +
org.jboss.cache.Version.version);
+ log.info("Running follwing JBossCacheCodeName: " +
org.jboss.cache.Version.codename);
+ }
+
+ public void setUp() throws Exception
+ {
+ }
+
+ public void tearDown() throws Exception
+ {
+ cache.stop();
+ }
+
+ public void put(Object key, Object value) throws Exception
+ {
+ // make sure the threads don't conflict!
+ Fqn f = new Fqn("test", key);
+ cache.put(f, key, value);
+ }
+
+ public Object get(Object key) throws Exception
+ {
+ Fqn f = new Fqn("test", key);
+ return cache.get(f, key);
+ }
+
+ public void empty() throws Exception
+ {
+ //not removing root because there it fails with buddy replication:
http://jira.jboss.com/jira/browse/JBCACHE-1241
+ cache.removeNode(new Fqn("test"));
+ }
+
+ public int getNumMembers()
+ {
+ return cache.getMembers().size();
+ }
+
+ public String getInfo()
+ {
+ return "Num direct children: " + cache.getRoot().getChildren().size();
+ }
+
+ public Object getReplicatedData(String key) throws Exception
+ {
+ CacheSPI cacheSpi = (CacheSPI) cache;
+ GravitateResult result = cacheSpi.gravitateData(new Fqn("test", key),
true);
+ if (!result.isDataFound())
+ {
+ //totall replication?
+ return get(key);
+ }
+ NodeData nodeData = result.getNodeData().get(0);
+ return nodeData.getAttributes().get(key);
+ }
+}