[jbosscache-commits] JBoss Cache SVN: r6814 - in benchmarks/benchmark-fwk/trunk/cache-products: pojocache-2.2.0 and 6 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Tue Sep 30 03:33:29 EDT 2008


Author: mircea.markus
Date: 2008-09-30 03:33:29 -0400 (Tue, 30 Sep 2008)
New Revision: 6814

Added:
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/pojocache-aop.xml
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/replSync-service.xml
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/config.sh
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/javassist.jar
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-aop.jar
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-common-core.jar
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-logging-spi.jar
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-mdr.jar
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-reflect.jar
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jbosscache-core.jar
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jbosscache-pojo.jar
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jcip-annotations.jar
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jgroups.jar
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jta.jar
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/trove.jar
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/cachebench/
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/cachebench/cachewrappers/
   benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/cachebench/cachewrappers/PojoCache220Wrapper.java
Log:
added pojocache data

Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/pojocache-aop.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/pojocache-aop.xml	                        (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/pojocache-aop.xml	2008-09-30 07:33:29 UTC (rev 6814)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    This is a variant of jboss-aop.xml. 
+-->
+<aop>
+   <!-- If a POJO has a Replicable annotation, it will be asepectized. -->
+   
+   <!-- 
+   Supports inheritance and polymorphism. It can either be a concrete class
+   or an interface. All sub-classes or interface implementors will be instrumeneted.
+   -->
+   <prepare expr="field(* $instanceof{@org.jboss.cache.pojo.annotation.Replicable}->*)" />
+   
+   <!--  Work around that ensures annotated classes which do not access fields are instrumented -->
+   <introduction expr="class($instanceof{@org.jboss.cache.pojo.annotation.Replicable})"/>
+
+   <!-- Array support -->
+   <!-- Comment entire section to disable -->
+   <arrayreplacement expr="class($instanceof{@org.jboss.cache.pojo.annotation.Replicable})"/>
+   <interceptor name="pojocache-array" class="org.jboss.cache.pojo.interceptors.dynamic.ArrayInterceptor"/>
+   <introduction expr="class($instanceof{@org.jboss.cache.pojo.annotation.Replicable})">
+       <interfaces>org.jboss.cache.pojo.impl.ArrayInterceptable</interfaces>
+   </introduction>
+   <arraybind name="pojocache-array" type="READ_WRITE">
+      <interceptor-ref name="pojocache-array"/>
+   </arraybind>
+</aop>

Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/replSync-service.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/replSync-service.xml	                        (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/conf/replSync-service.xml	2008-09-30 07:33:29 UTC (rev 6814)
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Sample TreeCache Service Configuration                               -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<server>
+
+   <!-- ==================================================================== -->
+   <!-- Defines TreeCache configuration                                      -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+          name="jboss.cache:service=TreeCache">
+
+      <depends>jboss:service=Naming</depends>
+      <depends>jboss:service=TransactionManager</depends>
+
+      <!--
+          Configure the TransactionManager
+      -->
+      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+      </attribute>
+
+      <!--
+          Isolation level : SERIALIZABLE
+                            REPEATABLE_READ (default)
+                            READ_COMMITTED
+                            READ_UNCOMMITTED
+                            NONE
+      -->
+      <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+      <!--
+           Valid modes are LOCAL
+                           REPL_ASYNC
+                           REPL_SYNC
+                           INVALIDATION_ASYNC
+                           INVALIDATION_SYNC
+      -->
+      <attribute name="CacheMode">REPL_SYNC</attribute>
+
+      <!--
+      Just used for async repl: use a replication queue
+      -->
+      <attribute name="UseReplQueue">false</attribute>
+
+      <!--
+          Replication interval for replication queue (in ms)
+      -->
+      <attribute name="ReplQueueInterval">0</attribute>
+
+      <!--
+          Max number of elements which trigger replication
+      -->
+      <attribute name="ReplQueueMaxElements">0</attribute>
+
+      <!-- Name of cluster. Needs to be the same for all TreeCache nodes in a
+           cluster in order to find each other.
+      -->
+      <attribute name="ClusterName">JBossCache-Cluster</attribute>
+
+      <!--Uncomment next three statements to enable JGroups multiplexer.
+This configuration is dependent on the JGroups multiplexer being
+registered in an MBean server such as JBossAS.  -->
+      <!--
+      <depends>jgroups.mux:name=Multiplexer</depends>
+      <attribute name="MultiplexerService">jgroups.mux:name=Multiplexer</attribute>
+      <attribute name="MultiplexerStack">fc-fast-minimalthreads</attribute>
+      -->
+
+      <!-- JGroups protocol stack properties.
+         ClusterConfig isn't used if the multiplexer is enabled and successfully initialized.
+      -->
+      <attribute name="ClusterConfig">
+         <config>
+            <UDP mcast_addr="228.10.10.10"
+                 mcast_port="45588"
+                 tos="8"
+                 ucast_recv_buf_size="20000000"
+                 ucast_send_buf_size="640000"
+                 mcast_recv_buf_size="25000000"
+                 mcast_send_buf_size="640000"
+                 loopback="false"
+                 discard_incompatible_packets="true"
+                 max_bundle_size="64000"
+                 max_bundle_timeout="30"
+                 use_incoming_packet_handler="true"
+                 ip_ttl="2"
+                 enable_bundling="false"
+                 enable_diagnostics="false"
+
+                 use_concurrent_stack="true"
+
+                 thread_naming_pattern="pl"
+
+                 thread_pool.enabled="true"
+                 thread_pool.min_threads="1"
+                 thread_pool.max_threads="25"
+                 thread_pool.keep_alive_time="30000"
+                 thread_pool.queue_enabled="true"
+                 thread_pool.queue_max_size="10"
+                 thread_pool.rejection_policy="Run"
+
+                 oob_thread_pool.enabled="true"
+                 oob_thread_pool.min_threads="1"
+                 oob_thread_pool.max_threads="4"
+                 oob_thread_pool.keep_alive_time="10000"
+                 oob_thread_pool.queue_enabled="true"
+                 oob_thread_pool.queue_max_size="10"
+                 oob_thread_pool.rejection_policy="Run"/>
+
+            <PING timeout="2000" num_initial_members="3"/>
+            <MERGE2 max_interval="30000" min_interval="10000"/>
+            <FD_SOCK/>
+            <FD timeout="10000" max_tries="5" shun="true"/>
+            <VERIFY_SUSPECT timeout="1500"/>
+            <pbcast.NAKACK max_xmit_size="60000"
+                           use_mcast_xmit="false" gc_lag="0"
+                           retransmit_timeout="300,600,1200,2400,4800"
+                           discard_delivered_msgs="true"/>
+            <UNICAST timeout="300,600,1200,2400,3600"/>
+            <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
+                           max_bytes="400000"/>
+            <pbcast.GMS print_local_addr="true" join_timeout="5000"
+                        join_retry_timeout="2000" shun="false"
+                        view_bundling="true" view_ack_collection_timeout="5000"/>
+            <FRAG2 frag_size="60000"/>
+            <pbcast.STREAMING_STATE_TRANSFER use_reading_thread="true"/>
+            <!-- <pbcast.STATE_TRANSFER/> -->
+            <pbcast.FLUSH timeout="0"/>
+         </config>
+      </attribute>
+
+
+      <!--
+       Whether or not to fetch state on joining a cluster
+       NOTE this used to be called FetchStateOnStartup and has been renamed to be more descriptive.
+      -->
+      <attribute name="FetchInMemoryState">true</attribute>
+
+      <!--
+          The max amount of time (in milliseconds) we wait until the
+          state (ie. the contents of the cache) are retrieved from
+          existing members in a clustered environment
+      -->
+      <attribute name="StateRetrievalTimeout">15000</attribute>
+
+      <!--
+          Number of milliseconds to wait until all responses for a
+          synchronous call have been received.
+      -->
+      <attribute name="SyncReplTimeout">15000</attribute>
+
+      <!-- Max number of milliseconds to wait for a lock acquisition -->
+      <attribute name="LockAcquisitionTimeout">10000</attribute>
+
+      <!--
+         Indicate whether to use region based marshalling or not. Set this to true if you are running under a scoped
+         class loader, e.g., inside an application server. Default is "false".
+      -->
+      <attribute name="UseRegionBasedMarshalling">true</attribute>
+   </mbean>
+
+
+   <!--  Uncomment to get a graphical view of the TreeCache MBean above -->
+   <!--   <mbean code="org.jboss.cache.TreeCacheView" name="jboss.cache:service=TreeCacheView">-->
+   <!--      <depends>jboss.cache:service=TreeCache</depends>-->
+   <!--      <attribute name="CacheService">jboss.cache:service=TreeCache</attribute>-->
+   <!--   </mbean>-->
+
+
+</server>

Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/config.sh
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/config.sh	                        (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/config.sh	2008-09-30 07:33:29 UTC (rev 6814)
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+#see "$CACHE_ROOT/cache-products/cache.sh" for details
+
+THIS_DIR="./cache-products/pojocache-2.2.0"
+
+#setting up classpath
+for JAR in $THIS_DIR/lib/*
+do   
+   CLASSPATH=$CLASSPATH:$JAR
+done
+CLASSPATH=$CLASSPATH:./classes/production/pojocache-2.2.0
+CLASSPATH=$CLASSPATH:$THIS_DIR/conf
+#--classpath was set
+
+#additional JVM options
+JVM_OPTIONS="$JVM_OPTIONS -javaagent:$THIS_DIR/lib/jboss-aop.jar -Djboss.aop.path=$THIS_DIR/conf/pojocache-aop.xml -Djava.net.preferIPv4Stack=true -DcacheBenchFwk.cacheWrapperClassName=org.cachebench.cachewrappers.PojoCache220Wrapper"
+

Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/javassist.jar
===================================================================
(Binary files differ)


Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/javassist.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-aop.jar
===================================================================
(Binary files differ)


Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-aop.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-common-core.jar
===================================================================
(Binary files differ)


Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-common-core.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-logging-spi.jar
===================================================================
(Binary files differ)


Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-logging-spi.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-mdr.jar
===================================================================
(Binary files differ)


Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-mdr.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-reflect.jar
===================================================================
(Binary files differ)


Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jboss-reflect.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jbosscache-core.jar
===================================================================
(Binary files differ)


Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jbosscache-core.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jbosscache-pojo.jar
===================================================================
(Binary files differ)


Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jbosscache-pojo.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jcip-annotations.jar
===================================================================
(Binary files differ)


Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jcip-annotations.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jgroups.jar
===================================================================
(Binary files differ)


Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jgroups.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jta.jar
===================================================================
(Binary files differ)


Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/jta.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/trove.jar
===================================================================
(Binary files differ)


Property changes on: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/lib/trove.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/cachebench/cachewrappers/PojoCache220Wrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/cachebench/cachewrappers/PojoCache220Wrapper.java	                        (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/pojocache-2.2.0/src/org/cachebench/cachewrappers/PojoCache220Wrapper.java	2008-09-30 07:33:29 UTC (rev 6814)
@@ -0,0 +1,92 @@
+package org.cachebench.cachewrappers;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.cachebench.CacheWrapper;
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.pojo.PojoCache;
+import org.jboss.cache.pojo.PojoCacheFactory;
+import org.jboss.cache.buddyreplication.GravitateResult;
+import org.jboss.cache.marshall.NodeData;
+
+import java.net.URL;
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+
+public class PojoCache220Wrapper implements CacheWrapper
+{
+   private PojoCache cache;
+   private Log log = LogFactory.getLog(PojoCache220Wrapper.class);
+   private Map replicatedData;
+
+   public void init(Map parameters) throws Exception
+   {
+      log.info("Creating pojo cache with the following configuration: " + parameters);
+      String configFile = (String) parameters.get("config");
+      URL url = Thread.currentThread().getContextClassLoader().getResource(configFile);
+      log.info("Loading cache with config file: " + url);
+      cache = PojoCacheFactory.createCache(configFile);
+      boolean isCoordinator = cache.getCache().getMembers().indexOf(cache.getCache().getLocalAddress()) == 0;
+      if (isCoordinator)
+      {
+         replicatedData = new HashMap();
+         cache.attach("/data", replicatedData);
+      }
+      else
+      {
+         for (int i = 0; i < 10; i++)
+         {
+            replicatedData = (Map) cache.find("/data");
+            if (replicatedData != null) break;
+            log.info("This is not the coordinator, sleeping for a second before trying to refetched the map.");
+            Thread.sleep(1000);
+         }
+      }
+      replicatedData = (Map) cache.find("/data");
+   }
+
+   public void setUp() throws Exception
+   {
+   }
+
+   public void tearDown() throws Exception
+   {
+      cache.stop();
+   }
+
+   public void put(List<String> path, Object key, Object value) throws Exception
+   {
+      replicatedData.put(key, value);
+   }
+
+   public Object get(List<String> path, Object key) throws Exception
+   {
+      return replicatedData.get(key);
+   }
+
+   public void empty() throws Exception
+   {
+      //not removing root because there it fails with buddy replication: http://jira.jboss.com/jira/browse/JBCACHE-1241
+      replicatedData.clear();
+   }
+
+   public int getNumMembers()
+   {
+      return cache.getCache().getMembers().size();
+   }
+
+   public String getInfo()
+   {
+      return "n/a info for pojocache";
+   }
+
+   public Object getReplicatedData(List<String> path, String key) throws Exception
+   {
+      //we assume that full replication is in use!!!
+      return replicatedData.get(key);
+   }
+}




More information about the jbosscache-commits mailing list