Author: mircea.markus
Date: 2008-07-23 20:24:57 -0400 (Wed, 23 Jul 2008)
New Revision: 6386
Added:
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/config.sh
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/src/org/cachebench/cachewrappers/Coherence331Wrapper.java
Removed:
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/src/org/cachebench/cachewrappers/CoherenceWrapper.java
Modified:
benchmarks/benchmark-fwk/trunk/build.xml
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/conf/cache-config.xml
Log:
updated TC config and added both replicated and distributed tests
Modified: benchmarks/benchmark-fwk/trunk/build.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/build.xml 2008-07-23 20:41:02 UTC (rev 6385)
+++ benchmarks/benchmark-fwk/trunk/build.xml 2008-07-24 00:24:57 UTC (rev 6386)
@@ -94,18 +94,18 @@
</javac>
</target>
- <target name="compile.module.coherence322"
depends="compile.module.framework"
- description="Compile module coherence322; production classes">
- <mkdir dir="./classes/production/coherence-3.2.2"/>
- <javac destdir="./classes/production/coherence-3.2.2"
debug="${compiler.debug}"
+ <target name="compile.module.coherence331"
depends="compile.module.framework"
+ description="Compile module coherence331; production classes">
+ <mkdir dir="./classes/production/coherence-3.3.1"/>
+ <javac destdir="./classes/production/coherence-3.3.1"
debug="${compiler.debug}"
nowarn="${compiler.generate.no.warnings}"
fork="true">
<classpath>
- <fileset dir="./cache-products/coherence-3.2.2/lib"
includes="*.jar"/>
- <pathelement
location="./cache-products/coherence-3.2.2/conf"/>
+ <fileset dir="./cache-products/coherence-3.3.1/lib"
includes="*.jar"/>
+ <pathelement
location="./cache-products/coherence-3.3.1/conf"/>
<pathelement location="${framework.output.dir}"/>
- <pathelement
location="./classes/production/coherence-3.2.2"/>
+ <pathelement
location="./classes/production/coherence-3.3.1"/>
</classpath>
- <src path="./cache-products/coherence-3.2.2"/>
+ <src path="./cache-products/coherence-3.3.1"/>
</javac>
</target>
@@ -214,7 +214,7 @@
</target>
<target name="all"
- depends="clean, compile.module.framework, compile.module.jbosscache140,
compile.module.jbosscache200, compile.module.jbosscache210, compile.module.jbosscache220,
compile.module.terracotta250, compile.module.ehcache141, compile.module.whirlycache101,
compile.module.jbosscache300"
+ depends="clean, compile.module.framework, compile.module.coherence331,
compile.module.jbosscache140, compile.module.jbosscache200, compile.module.jbosscache210,
compile.module.jbosscache220, compile.module.terracotta250, compile.module.ehcache141,
compile.module.whirlycache101, compile.module.jbosscache300"
description="build all"/>
<target name="checkClusterAddresses"
depends="compile.module.framework"
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/conf/cache-config.xml
===================================================================
---
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/conf/cache-config.xml 2008-07-23
20:41:02 UTC (rev 6385)
+++
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/conf/cache-config.xml 2008-07-24
00:24:57 UTC (rev 6386)
@@ -1,42 +1,53 @@
<?xml version="1.0"?>
+
<!DOCTYPE cache-config SYSTEM "cache-config.dtd">
<cache-config>
- <caching-scheme-mapping>
- <!--
- Caches with any name will be created as default replicated.
- -->
- <cache-mapping>
- <cache-name>*</cache-name>
- <scheme-name>default-replicated</scheme-name>
- </cache-mapping>
- </caching-scheme-mapping>
+ <caching-scheme-mapping>
+ <cache-mapping>
+ <cache-name>repl-*</cache-name>
+ <scheme-name>default-replicated</scheme-name>
+ </cache-mapping>
- <caching-schemes>
- <!--
- Default Replicated caching scheme.
- -->
- <replicated-scheme>
- <scheme-name>default-replicated</scheme-name>
- <service-name>ReplicatedCache</service-name>
+ <cache-mapping>
+ <cache-name>dist-*</cache-name>
+ <scheme-name>default-distributed</scheme-name>
+ </cache-mapping>
+ </caching-scheme-mapping>
- <backing-map-scheme>
- <class-scheme>
- <scheme-ref>default-backing-map</scheme-ref>
- </class-scheme>
- </backing-map-scheme>
- </replicated-scheme>
+ <caching-schemes>
+ <!--
+ Default Replicated caching scheme.
+ -->
+ <replicated-scheme>
+ <scheme-name>default-replicated</scheme-name>
+ <service-name>ReplicatedCache</service-name>
+ <backing-map-scheme>
+ <class-scheme>
+ <scheme-ref>default-backing-map</scheme-ref>
+ </class-scheme>
+ </backing-map-scheme>
+ </replicated-scheme>
- <!--
- Default backing map scheme definition used by all
- The caches that do not require any eviction policies
- -->
- <class-scheme>
- <scheme-name>default-backing-map</scheme-name>
+ <distributed-scheme>
+ <scheme-name>default-distributed</scheme-name>
+ <service-name>DistributedCache</service-name>
- <class-name>com.tangosol.util.SafeHashMap</class-name>
- </class-scheme>
+ <backing-map-scheme>
+ <class-scheme>
+ <scheme-ref>default-backing-map</scheme-ref>
+ </class-scheme>
+ </backing-map-scheme>
+ </distributed-scheme>
- </caching-schemes>
-</cache-config>
+ <!--
+ Default backing map scheme definition used by all
+ The caches that do not require any eviction policies
+ -->
+ <class-scheme>
+ <scheme-name>default-backing-map</scheme-name>
+ <class-name>com.tangosol.util.SafeHashMap</class-name>
+ </class-scheme>
+ </caching-schemes>
+</cache-config>
\ No newline at end of file
Added: benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/config.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/config.sh
(rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/config.sh 2008-07-24
00:24:57 UTC (rev 6386)
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+#see "$CACHE_ROOT/cache-products/cache.sh" for details
+
+THIS_DIR="./cache-products/coherence-3.3.1"
+
+#setting up classpath
+for JAR in $THIS_DIR/lib/*
+do
+ CLASSPATH=$CLASSPATH:$JAR
+done
+
+CLASSPATH="$CLASSPATH:./classes/production/coherence-3.3.1"
+CLASSPATH="$THIS_DIR/conf:$CLASSPATH"
+#--classpath was set
+
+#additional JVM options
+JVM_OPTIONS="$JVM_OPTIONS -Xmx2048m -Djava.net.preferIPv4Stack=true
-Dtangosol.coherence.localhost=${MYTESTIP_1}"
+JVM_OPTIONS="-Dtangosol.coherence.cacheconfig=cache-config.xml"
+JVM_OPTIONS="$JVM_OPTIONS
-DcacheBenchFwk.cacheWrapperClassName=org.cachebench.cachewrappers.Coherence331Wrapper"
\ No newline at end of file
Copied:
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/src/org/cachebench/cachewrappers/Coherence331Wrapper.java
(from rev 6385,
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/src/org/cachebench/cachewrappers/CoherenceWrapper.java)
===================================================================
---
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/src/org/cachebench/cachewrappers/Coherence331Wrapper.java
(rev 0)
+++
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/src/org/cachebench/cachewrappers/Coherence331Wrapper.java 2008-07-24
00:24:57 UTC (rev 6386)
@@ -0,0 +1,77 @@
+package org.cachebench.cachewrappers;
+
+import org.cachebench.CacheWrapper;
+
+import java.util.List;
+import java.util.Map;
+
+import com.tangosol.net.NamedCache;
+import com.tangosol.net.CacheFactory;
+
+/**
+ * Pass in a -Dtangosol.coherence.localhost=IP_ADDRESS
+ *
+ * @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
+ * @since 2.0.0
+ */
+public class Coherence331Wrapper implements CacheWrapper
+{
+
+ private NamedCache cache;
+
+ public void init(Map parameters) throws Exception {
+ }
+
+ public void setUp() throws Exception {
+ String configuraton =
System.getProperty("cacheBenchFwk.cacheConfigFile");
+ String trimmedConfig = configuraton.trim();
+ if (trimmedConfig.indexOf("repl") == 0)
+ {
+ cache = CacheFactory.getCache("replicatedCache");
+ }
+ if (trimmedConfig.indexOf("dist") == 0)
+ {
+ cache = CacheFactory.getCache("replicatedCache");
+ }
+ throw new RuntimeException("Invalid configuration ('" + trimmedConfig
+ "'). Configuration name should start with: 'dist' or
'repl'");
+ }
+
+ public void tearDown() throws Exception {
+ cache.release();
+ }
+
+ public void put(List<String> path, Object key, Object value) throws Exception {
+ cache.put(pathAsString(path, key), value);
+ }
+
+ public Object get(List<String> path, Object key) throws Exception {
+ return cache.get( pathAsString(path, key));
+ }
+
+ public void empty() throws Exception {
+ cache.clear();
+ }
+
+ public int getNumMembers() {
+ return cache.getCacheService().getCluster().getMemberSet().size();
+ }
+
+ public String getInfo() {
+ return null;
+ }
+
+ public Object getReplicatedData(List<String> path, String key) throws Exception
{
+ return get(path, key);
+ }
+
+ private String pathAsString(List<String> path, Object key)
+ {
+ StringBuilder result = new StringBuilder();
+ for (String element : path)
+ {
+ result.append(element);
+ }
+ result.append(key);
+ return result.toString();
+ }
+}
Deleted:
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/src/org/cachebench/cachewrappers/CoherenceWrapper.java
===================================================================
---
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/src/org/cachebench/cachewrappers/CoherenceWrapper.java 2008-07-23
20:41:02 UTC (rev 6385)
+++
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/src/org/cachebench/cachewrappers/CoherenceWrapper.java 2008-07-24
00:24:57 UTC (rev 6386)
@@ -1,63 +0,0 @@
-package org.cachebench.cachewrappers;
-
-import com.tangosol.net.CacheFactory;
-import com.tangosol.net.NamedCache;
-import org.cachebench.CacheWrapper;
-
-import java.util.Map;
-
-/**
- * Pass in a -Dtangosol.coherence.localhost=IP_ADDRESS
- *
- * @author <a href="mailto:manik@jboss.org">Manik Surtani</a>
- * @since 2.0.0
- */
-public class CoherenceWrapper implements CacheWrapper
-{
- NamedCache cache;
-
- public void init(Map parameters) throws Exception
- {
- cache = CacheFactory.getReplicatedCache();
-// cache = CacheFactory.getCache("VirtualCache");
- }
-
- public void setUp() throws Exception
- {
- }
-
- public void tearDown() throws Exception
- {
- cache.release();
- }
-
- public void put(List<String> path, Object key, Object value) throws Exception
- {
- cache.put(key, value);
- }
-
- public Object get(List<String> path, Object key) throws Exception
- {
- return cache.get(key);
- }
-
- public void empty() throws Exception
- {
- cache.clear();
- }
-
- public int getNumMembers()
- {
- return cache.getCacheService().getCluster().getMemberSet().size();
- }
-
- public String getInfo()
- {
- return cache.keySet().toString();
- }
-
- public Object getReplicatedData(List<String> path, String key) throws Exception
- {
- return get(path, key);
- }
-}