Author: galder.zamarreno(a)jboss.com
Date: 2009-04-22 15:42:02 -0400 (Wed, 22 Apr 2009)
New Revision: 7993
Added:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/.classpath
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/.project
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/conf/
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/conf/local-RC.xml
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/conf/local-RR.xml
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/conf/repl-sync-RR.xml
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/config.sh
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/commons-logging.jar
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/infinispan-core.jar
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/jboss-common-core.jar
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/jboss-logging-spi.jar
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/jcip-annotations.jar
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/jgroups.jar
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/jta.jar
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/log4j.jar
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/marshalling-api.jar
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/river.jar
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/src/
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/src/org/
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/src/org/cachebench/
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/src/org/cachebench/cachewrappers/
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/src/org/cachebench/cachewrappers/InfinispanWrapper.java
Log:
Initial import.
Added: benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/.classpath
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/.classpath
(rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/.classpath 2009-04-22
19:42:02 UTC (rev 7993)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="lib" path="lib/commons-logging.jar"/>
+ <classpathentry kind="lib" path="lib/infinispan-core.jar"/>
+ <classpathentry kind="lib" path="lib/jboss-common-core.jar"/>
+ <classpathentry kind="lib" path="lib/jcip-annotations.jar"/>
+ <classpathentry kind="lib" path="lib/jgroups.jar"/>
+ <classpathentry kind="lib" path="lib/jta.jar"/>
+ <classpathentry kind="lib" path="lib/log4j.jar"/>
+ <classpathentry kind="lib" path="lib/marshalling-api.jar"/>
+ <classpathentry kind="lib" path="lib/river.jar"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry combineaccessrules="false" kind="src"
path="/framework"/>
+ <classpathentry kind="output" path="output/eclipse"/>
+</classpath>
Added: benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/.project
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/.project
(rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/.project 2009-04-22
19:42:02 UTC (rev 7993)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>infinispan-4.0.0</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/conf/local-RC.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/conf/local-RC.xml
(rev 0)
+++
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/conf/local-RC.xml 2009-04-22
19:42:02 UTC (rev 7993)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:infinispan:config:4.0">
+ <default>
+ <locking concurrencyLevel="10000"
isolationLevel="READ_COMMITTED" />
+ </default>
+</infinispan>
Added: benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/conf/local-RR.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/conf/local-RR.xml
(rev 0)
+++
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/conf/local-RR.xml 2009-04-22
19:42:02 UTC (rev 7993)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:infinispan:config:4.0">
+ <default>
+ <locking concurrencyLevel="10000"
isolationLevel="REPEATABLE_READ" />
+ </default>
+</infinispan>
Added:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/conf/repl-sync-RR.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/conf/repl-sync-RR.xml
(rev 0)
+++
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/conf/repl-sync-RR.xml 2009-04-22
19:42:02 UTC (rev 7993)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:infinispan:config:4.0">
+
+ <!-- *************************** -->
+ <!-- System-wide global settings -->
+ <!-- *************************** -->
+
+ <global>
+
+ <!--
+ If the transport is omitted, there is no way to create distributed or clustered
caches.
+ There is no added cost to defining a transport but not creating a cache that
uses one, since the transport
+ is created and initialized lazily.
+ -->
+ <transport
transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport"
clusterName="infinispan-cluster"
+ distributedSyncTimeout="5000">
+ <!-- Note that the JGroups transport uses sensible defaults if no
configuration property is defined. -->
+ <property name="configurationFile" value="tcp.xml"/>
+ <!-- See the JGroupsTransport javadocs for more flags -->
+ </transport>
+
+ </global>
+
+ <!-- *************************** -->
+ <!-- Default "template" settings -->
+ <!-- *************************** -->
+ <!-- this is used as a "template" configuration for all caches in the
system. -->
+ <default>
+ <!--
+ isolation levels supported: READ_COMMITTED and REPEATABLE_READ
+ -->
+ <locking
+ isolationLevel="REPEATABLE_READ"
+ lockAcquisitionTimeout="20000"
+ writeSkewCheck="false"
+ concurrencyLevel="500"/>
+
+ <!--
+ Used to register a transaction manager and participate in ongoing transactions.
+ -->
+ <transaction
+
transactionManagerLookupClass="org.infinispan.transaction.GenericTransactionManagerLookup"
+ syncRollbackPhase="false"
+ syncCommitPhase="false"/>
+
+ <!--
+ This element specifies that the cache is clustered.
+ modes supported: replication (r) or invalidation (i).
+ -->
+ <clustering mode="replication">
+
+ <!--
+ Defines whether to retrieve state on startup
+ -->
+ <stateRetrieval timeout="20000"
fetchInMemoryState="false"/>
+
+ <!--
+ Network calls are synchronous.
+ -->
+ <sync replTimeout="20000"/>
+ <!--
+ Uncomment this for async replication.
+ -->
+ <!--<async useReplQueue="true"
replQueueInterval="10000" replQueueMaxElements="500"/>-->
+ </clustering>
+ </default>
+
+</infinispan>
Added: benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/config.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/config.sh
(rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/config.sh 2009-04-22
19:42:02 UTC (rev 7993)
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+#see "$CACHE_ROOT/cache-products/cache.sh" for details
+
+THIS_DIR="./cache-products/infinispan-4.0.0"
+
+#setting up classpath
+for JAR in $THIS_DIR/lib/*
+do
+ CLASSPATH=$CLASSPATH:$JAR
+done
+
+CLASSPATH="$CLASSPATH:./classes/production/infinispan"
+CLASSPATH="$CLASSPATH:$THIS_DIR/conf"
+#--classpath was set
+
+#additional JVM options
+JVM_OPTIONS="$JVM_OPTIONS -Djava.net.preferIPv4Stack=true"
+JVM_OPTIONS="$JVM_OPTIONS
-DcacheBenchFwk.cacheWrapperClassName=org.cachebench.cachewrappers.InfinispanWrapper"
Added:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/commons-logging.jar
===================================================================
(Binary files differ)
Property changes on:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/commons-logging.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/infinispan-core.jar
===================================================================
(Binary files differ)
Property changes on:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/infinispan-core.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/jboss-common-core.jar
===================================================================
(Binary files differ)
Property changes on:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/jboss-common-core.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/jboss-logging-spi.jar
===================================================================
(Binary files differ)
Property changes on:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/jboss-logging-spi.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/jcip-annotations.jar
===================================================================
(Binary files differ)
Property changes on:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/jcip-annotations.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/jgroups.jar
===================================================================
(Binary files differ)
Property changes on:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/jgroups.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/jta.jar
===================================================================
(Binary files differ)
Property changes on:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/jta.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/log4j.jar
===================================================================
(Binary files differ)
Property changes on:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/log4j.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/marshalling-api.jar
===================================================================
(Binary files differ)
Property changes on:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/marshalling-api.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/river.jar
===================================================================
(Binary files differ)
Property changes on:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/lib/river.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/src/org/cachebench/cachewrappers/InfinispanWrapper.java
===================================================================
---
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/src/org/cachebench/cachewrappers/InfinispanWrapper.java
(rev 0)
+++
benchmarks/benchmark-fwk/trunk/cache-products/infinispan-4.0.0/src/org/cachebench/cachewrappers/InfinispanWrapper.java 2009-04-22
19:42:02 UTC (rev 7993)
@@ -0,0 +1,106 @@
+package org.cachebench.cachewrappers;
+
+import org.cachebench.CacheWrapper;
+import org.infinispan.Cache;
+import org.infinispan.factories.DefaultCacheFactory;
+import org.infinispan.manager.CacheManager;
+import org.infinispan.manager.DefaultCacheManager;
+
+import javax.transaction.TransactionManager;
+import java.util.Map;
+import java.util.List;
+
+public class InfinispanWrapper implements CacheWrapper
+{
+ CacheManager cacheManager;
+ Cache cache;
+ TransactionManager tm;
+ boolean started = false;
+ String config;
+
+ public void init(Map parameters) throws Exception
+ {
+ config = (String) parameters.get("config");
+ setUp();
+ }
+
+ public void setUp() throws Exception
+ {
+ if (!started)
+ {
+ cacheManager = new DefaultCacheManager(config);
+ // use the default cache
+ cache = cacheManager.getCache();
+ started = true;
+ }
+ }
+
+ public void tearDown() throws Exception
+ {
+ if (started)
+ {
+ cacheManager.stop();
+ started = false;
+ }
+ }
+
+ 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 cacheManager.getMembers() == null ? 0 : cacheManager.getMembers().size();
+ }
+
+ public String getInfo()
+ {
+ return cache.getVersion();
+ }
+
+ public Object getReplicatedData(List<String> path, String key) throws Exception
+ {
+ return get(null, key);
+ }
+
+ public Object startTransaction()
+ {
+ if (tm == null) return null;
+ try
+ {
+ tm.begin();
+ return tm.getTransaction();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public void endTransaction(boolean successful)
+ {
+ if (tm == null) return;
+ try
+ {
+ if (successful)
+ tm.commit();
+ else
+ tm.rollback();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}