Author: manik.surtani(a)jboss.com
Date: 2008-07-23 12:02:31 -0400 (Wed, 23 Jul 2008)
New Revision: 6381
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/src/org/cachebench/cachewrappers/EHCacheWrapper.java
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java
Log:
Fixed EHCache issues
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-07-23
15:25:17 UTC (rev 6380)
+++
benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.5.0/src/org/cachebench/cachewrappers/EHCacheWrapper.java 2008-07-23
16:02:31 UTC (rev 6381)
@@ -29,12 +29,14 @@
private CacheManager manager;
private Ehcache cache;
private Log logger =
LogFactory.getLog("org.cachebench.cachewrappers.EHCacheWrapper");
+ boolean localmode;
/* (non-Javadoc)
* @see org.cachebench.CacheWrapper#init(java.util.Properties)
*/
public void init(Map parameters) throws Exception
{
+ localmode = (Boolean.parseBoolean((String)
parameters.get("localOnly")));
logger.debug("Initializing the cache with props " + parameters);
URL url = getClass().getClassLoader().getResource((String)
parameters.get("config"));
logger.debug("Config URL = " + url);
@@ -98,8 +100,11 @@
for (String s : manager.getCacheNames()) logger.info(" * " + s);
cache = manager.getCache("cache");
logger.info("Using named cache " + cache);
- logger.info("Bounded peers: " +
manager.getCachePeerListener().getBoundCachePeers());
- logger.info("Remote peers: " +
manager.getCacheManagerPeerProvider().listRemoteCachePeers(cache));
+ if (!localmode)
+ {
+ logger.info("Bounded peers: " +
manager.getCachePeerListener().getBoundCachePeers());
+ logger.info("Remote peers: " +
manager.getCacheManagerPeerProvider().listRemoteCachePeers(cache));
+ }
}
/* (non-Javadoc)
@@ -155,12 +160,13 @@
public int getNumMembers()
{
- return manager.getCacheManagerPeerProvider().listRemoteCachePeers(cache).size();
+
+ return localmode ? 0 :
manager.getCacheManagerPeerProvider().listRemoteCachePeers(cache).size();
}
public String getInfo()
{
- return cache.getKeys().toString() + " remote peers: " +
manager.getCachePeerListener().getBoundCachePeers();
+ return cache.getKeys().toString() + (localmode ? "" : (" remote
peers: " + manager.getCachePeerListener().getBoundCachePeers()));
}
public Object getReplicatedData(List<String> path, String key) throws Exception
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-07-23
15:25:17 UTC (rev 6380)
+++
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers/JBossCache300Wrapper.java 2008-07-23
16:02:31 UTC (rev 6381)
@@ -24,8 +24,8 @@
log.info("Creating cache with the following configuration: " +
parameters);
cache = new DefaultCacheFactory().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);
+ log.info("Running following JBossCacheVersion: " +
org.jboss.cache.Version.version);
+ log.info("Running following JBossCacheCodeName: " +
org.jboss.cache.Version.codename);
}
public void setUp() throws Exception