Author: manik.surtani(a)jboss.com
Date: 2008-05-08 07:23:24 -0400 (Thu, 08 May 2008)
New Revision: 5810
Added:
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/config.sh
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/lib/
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/lib/commons-collections-3.1.jar
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/lib/commons-logging.jar
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/lib/concurrent-1.3.4.jar
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/lib/whirlycache-1.0.1.jar
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheTest.java
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheWrapper.java
Modified:
benchmarks/benchmark-fwk/trunk/build.xml
Log:
Added WhirlyCache 1.0.1
Modified: benchmarks/benchmark-fwk/trunk/build.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/build.xml 2008-05-08 11:22:33 UTC (rev 5809)
+++ benchmarks/benchmark-fwk/trunk/build.xml 2008-05-08 11:23:24 UTC (rev 5810)
@@ -359,6 +359,73 @@
</target>
+ <!-- Module whirlycache-1.0.1 -->
+
+ <dirname property="module.whirlycache101-plugin.basedir"
file="${ant.file}"/>
+
+
+ <property name="compiler.args.whirlycache101-plugin"
value="${compiler.args}"/>
+
+ <property name="whirlycache101-plugin.output.dir"
+
value="${module.whirlycache101-plugin.basedir}/classes/production/whirlycache-1.0.1"/>
+ <property name="whirlycache101-plugin.testoutput.dir"
+
value="${module.whirlycache101-plugin.basedir}/classes/test/whirlycache-1.0.1"/>
+
+ <path id="whirlycache101-plugin.module.bootclasspath">
+ <!-- Paths to be included in compilation bootclasspath -->
+ </path>
+
+ <path id="whirlycache101-plugin.module.classpath">
+ <fileset
dir="${module.whirlycache101-plugin.basedir}/cache-products/whirlycache-1.0.1/lib"
includes="**/*.jar"/>
+ <pathelement location="${framework.output.dir}"/>
+ <pathelement location="${framework.testoutput.dir}"/>
+ <pathelement location="${whirlycache101-plugin.output.dir}"/>
+ <pathelement
location="${module.whirlycache101-plugin.basedir}/cache-products/whirlycache-1.0.1/conf"/>
+ </path>
+
+
+ <patternset id="excluded.from.module.whirlycache101-plugin">
+ <patternset refid="ignored.files"/>
+ </patternset>
+
+ <patternset id="excluded.from.compilation.whirlycache101-plugin">
+ <patternset refid="excluded.from.module.whirlycache101-plugin"/>
+ </patternset>
+
+ <path id="whirlycache101-plugin.module.sourcepath">
+ <dirset
dir="${module.whirlycache101-plugin.basedir}/cache-products/whirlycache-1.0.1">
+ <include name="src"/>
+ </dirset>
+ </path>
+
+
+ <target name="compile.module.whirlycache101-plugin"
+
depends="compile.module.whirlycache101-plugin.production,compile.module.whirlycache101-plugin.tests"
+ description="Compile module whirlycache-1.0.1"/>
+
+ <target name="compile.module.whirlycache101-plugin.production"
depends="compile.module.framework"
+ description="Compile module whirlycache-1.0.1; production
classes">
+ <mkdir dir="${whirlycache101-plugin.output.dir}"/>
+ <javac destdir="${whirlycache101-plugin.output.dir}"
debug="${compiler.debug}"
+ nowarn="${compiler.generate.no.warnings}"
memorymaximumsize="${compiler.max.memory}" fork="true">
+ <compilerarg line="${compiler.args.whirlycache101-plugin}"/>
+ <bootclasspath
refid="whirlycache101-plugin.module.bootclasspath"/>
+ <classpath refid="whirlycache101-plugin.module.classpath"/>
+ <src refid="whirlycache101-plugin.module.sourcepath"/>
+ <patternset
refid="excluded.from.compilation.whirlycache101-plugin"/>
+ </javac>
+
+ <copy todir="${whirlycache101-plugin.output.dir}">
+ <fileset
dir="${module.whirlycache101-plugin.basedir}/cache-products/whirlycache-1.0.1/src">
+ <patternset refid="compiler.resources"/>
+ <type type="file"/>
+ </fileset>
+ </copy>
+ </target>
+
+ <target name="compile.module.whirlycache101-plugin.tests"
depends="compile.module.whirlycache101-plugin.production"
+ description="compile module whirlycache-1.0.1; test classes"
unless="skip.tests"/>
+
<!-- Module jbosscache-1.4.1 -->
<dirname property="module.jbosscache140-plugin.basedir"
file="${ant.file}"/>
@@ -548,7 +615,7 @@
</target>
<target name="all"
- depends="init, clean, compile.module.framework,
compile.module.ehcache141-plugin.production, compile.module.jbosscache140-plugin,
compile.module.jbosscache200-plugin, compile.module.jbosscache210-plugin.production,
compile.module.jbosscache220-plugin.production, compile.module.terracotta-plugin"
+ depends="init, clean, compile.module.framework,
compile.module.whirlycache101-plugin.production,
compile.module.ehcache141-plugin.production, compile.module.jbosscache140-plugin,
compile.module.jbosscache200-plugin, compile.module.jbosscache210-plugin.production,
compile.module.jbosscache220-plugin.production, compile.module.terracotta-plugin"
description="build all"/>
<target name="checkClusterAddresses"
depends="compile.module.framework.production"
Added: benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/config.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/config.sh
(rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/config.sh 2008-05-08
11:23:24 UTC (rev 5810)
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+#see "$CACHE_ROOT/cache-products/cache.sh" for details
+
+THIS_DIR="./cache-products/whirlycache-1.0.1"
+
+#setting up classpath
+for JAR in $THIS_DIR/lib/*
+do
+ CLASSPATH=$CLASSPATH:$JAR
+done
+
+CLASSPATH="$CLASSPATH:./classes/production/whirlycache-1.0.1"
+CLASSPATH="$CLASSPATH:$THIS_DIR/conf"
+#--classpath was set
+
+#additional JVM options
+JVM_OPTIONS="$JVM_OPTIONS -Xmx1024m -Djava.net.preferIPv4Stack=true"
JVM_OPTIONS="$JVM_OPTIONS
-DcacheBenchFwk.cacheWrapperClassName=org.cachebench.cachewrappers.WhirlyCacheWrapper"
Added:
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/lib/commons-collections-3.1.jar
===================================================================
(Binary files differ)
Property changes on:
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/lib/commons-collections-3.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/lib/commons-logging.jar
===================================================================
(Binary files differ)
Property changes on:
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/lib/commons-logging.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/lib/concurrent-1.3.4.jar
===================================================================
(Binary files differ)
Property changes on:
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/lib/concurrent-1.3.4.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/lib/whirlycache-1.0.1.jar
===================================================================
(Binary files differ)
Property changes on:
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/lib/whirlycache-1.0.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheTest.java
===================================================================
---
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheTest.java
(rev 0)
+++
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheTest.java 2008-05-08
11:23:24 UTC (rev 5810)
@@ -0,0 +1,26 @@
+package org.cachebench.cachewrappers;
+
+import org.cachebench.CacheWrapper;
+
+public class WhirlyCacheTest
+{
+
+ public static void main(String[] args) throws Exception
+ {
+
+
+ CacheWrapper w = new WhirlyCacheWrapper();
+ w.init(null);
+ w.setUp();
+ String k = "k", v = "v";
+
+ w.put(k, v);
+
+ System.out.println("Value is " + w.get(k));
+
+ w.empty();
+
+ System.out.println("Value is " + w.get(k));
+
+ }
+}
\ No newline at end of file
Added:
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheWrapper.java
===================================================================
---
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheWrapper.java
(rev 0)
+++
benchmarks/benchmark-fwk/trunk/cache-products/whirlycache-1.0.1/src/org/cachebench/cachewrappers/WhirlyCacheWrapper.java 2008-05-08
11:23:24 UTC (rev 5810)
@@ -0,0 +1,77 @@
+package org.cachebench.cachewrappers;
+
+import com.whirlycott.cache.Cache;
+import com.whirlycott.cache.CacheManager;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.cachebench.CacheWrapper;
+
+import java.util.Map;
+
+
+public class WhirlyCacheWrapper implements CacheWrapper
+{
+ private Cache cache;
+ private Log logger = LogFactory.getLog(WhirlyCacheWrapper.class);
+
+ /* (non-Javadoc)
+ * @see org.cachebench.CacheWrapper#init(java.util.Properties)
+ */
+ public void init(Map parameters) throws Exception
+ {
+ setUp();
+ }
+
+ /* (non-Javadoc)
+ * @see org.cachebench.CacheWrapper#setUp()
+ */
+ public void setUp() throws Exception
+ {
+ cache = CacheManager.getInstance().getCache();
+ logger.debug("Finish Initializing the cache");
+ }
+
+ /* (non-Javadoc)
+ * @see org.cachebench.CacheWrapper#tearDown()
+ */
+ public void tearDown() throws Exception
+ {
+ CacheManager.getInstance().destroy();
+ }
+
+ public void empty() throws Exception
+ {
+ cache.clear();
+ }
+
+ /* (non-Javadoc)
+ * @see org.cachebench.CacheWrapper#put(java.lang.Object, java.lang.Object)
+ */
+ public void put(Object key, Object value) throws Exception
+ {
+ cache.store(key, value);
+ }
+
+ /* (non-Javadoc)
+ * @see org.cachebench.CacheWrapper#get(java.lang.Object)
+ */
+ public Object get(Object key) throws Exception
+ {
+ return cache.retrieve(key);
+ }
+
+ public int getNumMembers()
+ {
+ return -1;
+ }
+
+ public String getInfo()
+ {
+ return cache.toString();
+ }
+
+ public Object getReplicatedData(String key) throws Exception
+ {
+ return get(key);
+ }
+}
\ No newline at end of file
Show replies by date