[jbosscache-commits] JBoss Cache SVN: r5811 - in benchmarks/benchmark-fwk/trunk: cache-products/ehcache-1.4.1/conf and 8 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Thu May 8 07:24:35 EDT 2008


Author: manik.surtani at jboss.com
Date: 2008-05-08 07:24:35 -0400 (Thu, 08 May 2008)
New Revision: 5811

Added:
   benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/conf/ehcache-local.xml
   benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/conf/pess-local.xml
   benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/conf/pess-local.xml
   benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pess-local.xml
   benchmarks/benchmark-fwk/trunk/runLocalNode.sh
   benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ClusterAwareReportGenerator.java
   benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/ClusteredCacheTest.java
Modified:
   benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/src/org/cachebench/cachewrappers/EHCacheWrapper.java
   benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java
   benchmarks/benchmark-fwk/trunk/src/org/cachebench/config/Configuration.java
   benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ClusterReportGenerator.java
   benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java
   benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/SessionSimulatorTest.java
Log:
Added the ability to run in LOCAL mode as well.

Copied: benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/conf/ehcache-local.xml (from rev 5799, benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/conf/ehcache-repl-sync.xml)
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/conf/ehcache-local.xml	                        (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/conf/ehcache-local.xml	2008-05-08 11:24:35 UTC (rev 5811)
@@ -0,0 +1,325 @@
+<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ehcache.xsd">
+
+   <!--
+   DiskStore configuration
+
+   Sets the path to the directory where cache files are created.
+
+   If the path is a Java System Property it is replaced by its value in the
+   running VM.
+
+   The following properties are translated:
+   * user.home - User's home directory
+   * user.dir - User's current working directory
+   * java.io.tmpdir - Default temp file path
+
+   Subdirectories can be specified below the property e.g. java.io.tmpdir/one
+   -->
+   <diskStore path="java.io.tmpdir"/>
+
+   <!--
+   Specifies a CacheManagerEventListenerFactory, be used to create a CacheManagerPeerProvider,
+   which is notified when Caches are added or removed from the CacheManager.
+
+   The attributes of CacheManagerEventListenerFactory are:
+   * class - a fully qualified factory class name
+   * properties - comma separated properties having meaning only to the factory.
+
+   Sets the fully qualified class name to be registered as the CacheManager event listener.
+
+   The events include:
+   * adding a Cache
+   * removing a Cache
+
+   Callbacks to listener methods are synchronous and unsynchronized. It is the responsibility
+   of the implementer to safely handle the potential performance and thread safety issues
+   depending on what their listener is doing.
+
+   If no class is specified, no listener is created. There is no default.
+   -->
+   <cacheManagerEventListenerFactory class="" properties=""/>
+
+
+   <!--
+   (Enable for distributed operation)
+
+   Specifies a CacheManagerPeerProviderFactory which will be used to create a
+   CacheManagerPeerProvider, which discovers other CacheManagers in the cluster.
+
+   The attributes of cacheManagerPeerProviderFactory are:
+   * class - a fully qualified factory class name
+   * properties - comma separated properties having meaning only to the factory.
+
+   Ehcache comes with a built-in RMI-based distribution system with two means of discovery of
+   CacheManager peers participating in the cluster:
+   * automatic, using a multicast group. This one automatically discovers peers and detects
+     changes such as peers entering and leaving the group
+   * manual, using manual rmiURL configuration. A hardcoded list of peers is provided at
+     configuration time.
+
+   Configuring Automatic Discovery:
+   Automatic discovery is configured as per the following example:
+   <cacheManagerPeerProviderFactory
+                       class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
+                       properties="peerDiscovery=automatic, multicastGroupAddress=230.0.0.1,
+                                   multicastGroupPort=4446, timeToLive=32"/>
+
+   Valid properties are:
+   * peerDiscovery (mandatory) - specify "automatic"
+   * multicastGroupAddress (mandatory) - specify a valid multicast group address
+   * multicastGroupPort (mandatory) - specify a dedicated port for the multicast heartbeat
+     traffic
+   * timeToLive - specify a value between 0 and 255 which determines how far the packets will propagate.
+     By convention, the restrictions are:
+     0   - the same host
+     1   - the same subnet
+     32  - the same site
+     64  - the same region
+     128 - the same continent
+     255 - unrestricted
+
+   Configuring Manual Discovery:
+   Manual discovery is configured as per the following example:
+   <cacheManagerPeerProviderFactory class=
+                         "net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
+                         properties="peerDiscovery=manual,
+                         rmiUrls=//server1:40000/sampleCache1|//server2:40000/sampleCache1
+                         | //server1:40000/sampleCache2|//server2:40000/sampleCache2"/>
+
+   Valid properties are:
+   * peerDiscovery (mandatory) - specify "manual"
+   * rmiUrls (mandatory) - specify a pipe separated list of rmiUrls, in the form
+                           //hostname:port
+
+   The hostname is the hostname of the remote CacheManager peer. The port is the listening
+   port of the RMICacheManagerPeerListener of the remote CacheManager peer.
+
+   An alternate CacheManagerPeerProviderFactory can be used for JNDI discovery of other
+   CacheManagers in the cluster. Only manual discovery is supported.
+
+   For cacheManagerPeerProviderFactory specify class
+   net.sf.ehcache.distribution.JNDIManualRMICacheManagerPeerProviderFactoryerFactory.
+
+   Correspondingly for cacheManagerPeerListenerFactory specify class
+   net.sf.ehcache.distribution.JNDIRMICacheManagerPeerListenerFactoryory.
+
+   Configuring JNDI Manual Discovery:
+   Manual JNDI discovery is configured as per the following example:
+   <cacheManagerPeerProviderFactory class=
+       "net.sf.ehcache.distribution.JNDIManualRMICacheManagerPeerProviderFactoryerFactory"
+       properties="peerDiscovery=manual, stashContexts=true, stashRemoteCachePeers=true,
+             jndiUrls=t3//server1:40000/sampleCache1|t3//server2:40000/sampleCache1
+             |t3//server1:40000/sampleCache2|t3//server2:40000/sampleCache2"/>
+
+   Valid properties are:
+   * peerDiscovery (mandatory) - specify "manual"
+   * stashContexts (optional) - specify "true" or "false".  Defaults to true.
+     java.naming.Context objects are stashed for performance.
+   * stashRemoteCachePeers (optional) - specify "true" or "false".  Defaults to true.
+     CachePeer objects are stashed for performance.
+   * jndiUrls (mandatory) - specify a pipe separated list of jndiUrls,
+     in the form protocol//hostname:port
+   -->
+   <cacheManagerPeerProviderFactory
+         class="net.sf.ehcache.distribution.RMICacheManagerPeerProviderFactory"
+         properties="peerDiscovery=automatic,
+                        multicastGroupAddress=228.1.2.3,
+                        multicastGroupPort=48866, timeToLive=64"/>
+
+
+   <!--
+   (Enable for distributed operation)
+
+   Specifies a CacheManagerPeerListenerFactory which will be used to create a
+   CacheManagerPeerListener, which
+   listens for messages from cache replicators participating in the cluster.
+
+   The attributes of cacheManagerPeerListenerFactory are:
+   class - a fully qualified factory class name
+   properties - comma separated properties having meaning only to the factory.
+
+   Ehcache comes with a built-in RMI-based distribution system. The listener component is
+   RMICacheManagerPeerListener which is configured using
+   RMICacheManagerPeerListenerFactory. It is configured as per the following example:
+
+   <cacheManagerPeerListenerFactory
+       class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
+       properties="hostName=fully_qualified_hostname_or_ip,
+                   port=40001,
+                   socketTimeoutMillis=120000"/>
+
+   All properties are optional. They are:
+   * hostName - the hostName of the host the listener is running on. Specify
+     where the host is multihomed and you want to control the interface over which cluster
+     messages are received. Defaults to the host name of the default interface if not
+     specified.
+   * port - the port the listener listens on. This defaults to a free port if not specified.
+   * socketTimeoutMillis - the number of ms client sockets will stay open when sending
+     messages to the listener. This should be long enough for the slowest message.
+     If not specified it defaults 120000ms.
+
+
+   An alternate CacheManagerPeerListenerFactory can be also be used for JNDI binding of
+   listeners for messages from cache replicators participating in the cluster. For
+   cacheManagerPeerListenerFactory specify
+   class net.sf.ehcache.distribution.JNDIRMICacheManagerPeerListenerFactory.
+   Correspondingly for cacheManagerPeerProviderFactory specify class
+   net.sf.ehcache.distribution.JNDIManualRMICacheManagerPeerProviderFactoryerFactory.
+   Properties for JNDIRMICacheManagerPeerListenerFactory are the same as
+   RMICacheManagerPeerListenerFactory.
+
+   -->
+   <cacheManagerPeerListenerFactory
+         class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory"
+         properties="hostName=127.0.0.1, socketTimeoutMillis=120000"/>
+
+
+   <!-- Cache configuration.
+
+   The following attributes are required.
+
+   name:
+   Sets the name of the cache. This is used to identify the cache. It must be unique.
+
+   maxElementsInMemory:
+   Sets the maximum number of objects that will be created in memory
+
+  maxElementsOnDisk:
+   Sets the maximum number of objects that will be maintained in the DiskStore
+  The default value is zero, meaning unlimited.
+
+   eternal:
+   Sets whether elements are eternal. If eternal,  timeouts are ignored and the
+   element is never expired.
+
+   overflowToDisk:
+   Sets whether elements can overflow to disk when the memory store
+   has reached the maxInMemory limit.
+
+   The following attributes are optional.
+
+   timeToIdleSeconds:
+   Sets the time to idle for an element before it expires.
+   i.e. The maximum amount of time between accesses before an element expires
+   Is only used if the element is not eternal.
+   Optional attribute. A value of 0 means that an Element can idle for infinity.
+   The default value is 0.
+
+   timeToLiveSeconds:
+   Sets the time to live for an element before it expires.
+   i.e. The maximum time between creation time and when an element expires.
+   Is only used if the element is not eternal.
+   Optional attribute. A value of 0 means that and Element can live for infinity.
+   The default value is 0.
+
+   diskPersistent:
+   Whether the disk store persists between restarts of the Virtual Machine.
+   The default value is false.
+
+   diskExpiryThreadIntervalSeconds:
+   The number of seconds between runs of the disk expiry thread. The default value
+   is 120 seconds.
+
+   memoryStoreEvictionPolicy:
+   Policy would be enforced upon reaching the maxElementsInMemory limit. Default
+   policy is Least Recently Used (specified as LRU). Other policies available -
+   First In First Out (specified as FIFO) and Less Frequently Used
+   (specified as LFU)
+
+   Cache elements can also contain sub elements which take the same format of a factory class
+   and properties. Defined sub-elements are:
+
+   * cacheEventListenerFactory - Enables registration of listeners for cache events, such as
+     put, remove, update, and expire.
+
+   * bootstrapCacheLoaderFactory - Specifies a BootstrapCacheLoader, which is called by a
+     cache on initialisation to prepopulate itself.
+
+   Each cache that will be distributed needs to set a cache event listener which replicates
+   messages to the other CacheManager peers. For the built-in RMI implementation this is done
+   by adding a cacheEventListenerFactory element of type RMICacheReplicatorFactory to each
+   distributed cache's configuration as per the following example:
+
+   <cacheEventListenerFactory class="net.sf.ehcache.distribution.RMICacheReplicatorFactory"
+        properties="replicateAsynchronously=true,
+        replicatePuts=true,
+        replicateUpdates=true,
+        replicateUpdatesViaCopy=true,
+        replicateRemovals=true "/>
+
+   The RMICacheReplicatorFactory recognises the following properties:
+
+   * replicatePuts=true|false - whether new elements placed in a cache are
+     replicated to others. Defaults to true.
+
+   * replicateUpdates=true|false - whether new elements which override an
+     element already existing with the same key are replicated. Defaults to true.
+
+   * replicateRemovals=true - whether element removals are replicated. Defaults to true.
+
+   * replicateAsynchronously=true | false - whether replications are
+     asynchronous (true) or synchronous (false). Defaults to true.
+
+   * replicateUpdatesViaCopy=true | false - whether the new elements are
+     copied to other caches (true), or whether a remove message is sent. Defaults to true.
+
+   * asynchronousReplicationIntervalMillis=<number of milliseconds> - The asynchronous
+     replicator runs at a set interval of milliseconds. The default is 1000. The minimum
+     is 10. This property is only applicable if replicateAsynchronously=true
+
+   The RMIBootstrapCacheLoader bootstraps caches in clusters where RMICacheReplicators are
+   used. It is configured as per the following example:
+
+   <bootstrapCacheLoaderFactory
+       class="net.sf.ehcache.distribution.RMIBootstrapCacheLoaderFactory"
+       properties="bootstrapAsynchronously=true, maximumChunkSizeBytes=5000000"/>
+
+   The RMIBootstrapCacheLoaderFactory recognises the following optional properties:
+
+   * bootstrapAsynchronously=true|false - whether the bootstrap happens in the background
+     after the cache has started. If false, bootstrapping must complete before the cache is
+     made available. The default value is true.
+
+   * maximumChunkSizeBytes=<integer> - Caches can potentially be very large, larger than the
+     memory limits of the VM. This property allows the bootstraper to fetched elements in
+     chunks. The default chunk size is 5000000 (5MB).
+
+   -->
+
+   <!--
+   Mandatory Default Cache configuration. These settings will be applied to caches
+   created programmtically using CacheManager.add(String cacheName)
+   -->
+   <defaultCache
+         maxElementsInMemory="10000"
+         eternal="false"
+         timeToIdleSeconds="120"
+         timeToLiveSeconds="120"
+         overflowToDisk="false"
+         maxElementsOnDisk="10000000"
+         diskPersistent="false"
+         diskExpiryThreadIntervalSeconds="120"
+         memoryStoreEvictionPolicy="LRU"
+         />
+
+   <!--
+   Sample caches. Following are some example caches. Remove these before use.
+   -->
+
+   <!--
+      NOTE that the cache benchmarking fwk looks for a cache named "cache".
+    -->
+
+   <!--
+   Sample distributed cache named sampleDistributedCache2.
+   This cache replicates using specific properties.
+   It only replicates updates and does so synchronously via copy
+   -->
+   <cache name="cache"
+          maxElementsInMemory="10000"
+          eternal="false"
+          timeToIdleSeconds="100"
+          timeToLiveSeconds="100"
+          overflowToDisk="false">
+   </cache>
+</ehcache>

Modified: benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/src/org/cachebench/cachewrappers/EHCacheWrapper.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/src/org/cachebench/cachewrappers/EHCacheWrapper.java	2008-05-08 11:23:24 UTC (rev 5810)
+++ benchmarks/benchmark-fwk/trunk/cache-products/ehcache-1.4.1/src/org/cachebench/cachewrappers/EHCacheWrapper.java	2008-05-08 11:24:35 UTC (rev 5811)
@@ -51,7 +51,7 @@
       }
 
       manager = new CacheManager(c);
-
+      setUp();
       logger.debug("Finish Initializing the cache");
    }
 
@@ -144,7 +144,12 @@
    */
    public Object get(Object key) throws Exception
    {
-      return getSerializable((Serializable) key);
+      Object s = getSerializable((Serializable) key);
+      if (s instanceof Element)
+      {
+         return ((Element) s).getValue();
+      }
+      else return s;
    }
 
    public int getNumMembers()

Added: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/conf/pess-local.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/conf/pess-local.xml	                        (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.0.0/conf/pess-local.xml	2008-05-08 11:24:35 UTC (rev 5811)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Sample for total replication.                               -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<server>
+
+   <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
+
+
+   <!-- ==================================================================== -->
+   <!-- Defines TreeCache configuration                                      -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+          name="jboss.cache:service=testTreeCache">
+
+      <depends>jboss:service=Naming</depends>
+      <depends>jboss:service=TransactionManager</depends>
+
+      <!--
+          Configure the TransactionManager
+      -->
+      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+      </attribute>
+
+
+      <!--
+          Node locking 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">LOCAL</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>
+      <!--
+          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">20000</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>
+   </mbean>
+</server>

Added: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/conf/pess-local.xml
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/conf/pess-local.xml	                        (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/conf/pess-local.xml	2008-05-08 11:24:35 UTC (rev 5811)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Sample for total replication.                               -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<server>
+
+   <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
+
+
+   <!-- ==================================================================== -->
+   <!-- Defines TreeCache configuration                                      -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+          name="jboss.cache:service=testTreeCache">
+
+      <depends>jboss:service=Naming</depends>
+      <depends>jboss:service=TransactionManager</depends>
+
+      <!--
+          Configure the TransactionManager
+      -->
+      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+      </attribute>
+
+
+      <!--
+          Node locking 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">LOCAL</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>
+      <!--
+          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">20000</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>
+   </mbean>
+</server>

Copied: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pess-local.xml (from rev 5799, benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pess-repl-sync.xml)
===================================================================
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pess-local.xml	                        (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pess-local.xml	2008-05-08 11:24:35 UTC (rev 5811)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Sample for total replication.                               -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<server>
+
+   <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
+
+
+   <!-- ==================================================================== -->
+   <!-- Defines TreeCache configuration                                      -->
+   <!-- ==================================================================== -->
+
+   <mbean code="org.jboss.cache.jmx.CacheJmxWrapper"
+          name="jboss.cache:service=testTreeCache">
+
+      <depends>jboss:service=Naming</depends>
+      <depends>jboss:service=TransactionManager</depends>
+
+      <!--
+          Configure the TransactionManager
+      -->
+      <attribute name="TransactionManagerLookupClass">org.jboss.cache.transaction.GenericTransactionManagerLookup
+      </attribute>
+
+
+      <!--
+          Node locking 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">LOCAL</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>
+      <!--
+          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">20000</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>
+   </mbean>
+</server>

Copied: benchmarks/benchmark-fwk/trunk/runLocalNode.sh (from rev 5797, benchmarks/benchmark-fwk/trunk/runNode.sh)
===================================================================
--- benchmarks/benchmark-fwk/trunk/runLocalNode.sh	                        (rev 0)
+++ benchmarks/benchmark-fwk/trunk/runLocalNode.sh	2008-05-08 11:24:35 UTC (rev 5811)
@@ -0,0 +1,61 @@
+#!/bin/bash
+# author: Mircea.Markus at jboss.com
+# cygwin users: add the scripts from :pserver:anoncvs at cygwin.com:/cvs/cygwin-apps/wrappers/java to the $cygwin_home/usr/local/bin
+# those would make an automatic conversion from unix CLASSPATH to win classpath, needed when executing java -cp
+
+preferIPv4Stack=true
+DEBUG=debug
+CACHE_PRODUCT=${1}
+TEST_CFG=${2}
+hostname=`hostname`
+PIDFILE=PID.${hostname}.pid
+
+if [ -z $1 ]
+then
+   echo Usage:
+   echo 
+   echo      ./runNode.sh [cache product to test] [test config file]
+   echo param [cache product to test] : must be one of the directories names under './cache-products'
+   echo param [test config file]      : configuration file to use with the cache product.  Typically resides in './cache-products/XXX/conf/'
+   echo
+   echo Example: './runNode.sh jbosscache-2.0.0 repl_async.xml' will start the 1st node running an instance of jbc2.0.0 in standalone [LOCAL] mode using the repl_async configuration.
+   exit 1
+fi
+
+#libraries needed by the fwk, add them to the classpath
+for JAR in ./lib/*
+do
+   CLASSPATH=$CLASSPATH:$JAR
+done
+
+export CLASSPATH=$CLASSPATH:./conf:./classes/production/Framework
+
+configFile=./cache-products/${CACHE_PRODUCT}/config.sh
+
+#first check whether the config file exists and load it
+if [ -f ${configFile} ]
+then
+  . ${configFile}
+  echo Calling ${configFile} exit code is $?
+else
+  echo could not find config file ${configFile}, aborting!
+  exit 2
+fi
+
+#. ./bindAddress.sh
+#echo bind address exit code is $?
+
+JVM_OPTIONS="${JVM_OPTIONS} -DcacheBenchFwk.cachePrioductName=${CACHE_PRODUCT} -DcacheBenchFwk.cacheConfigFile=${TEST_CFG} -Djava.net.preferIPv4Stack=${preferIPv4Stack} -DlocalOnly=true"
+TO_EXECUTE="java $JVM_OPTIONS -cp $CLASSPATH org.cachebench.CacheBenchmarkRunner"
+
+if [ "$DEBUG" = "debug" ]
+then
+   echo Executing:
+   echo ${TO_EXECUTE}
+   echo
+fi
+
+${TO_EXECUTE}
+echo $!>${PIDFILE}
+echo "Return code from benchmark runner is $?"
+

Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java	2008-05-08 11:23:24 UTC (rev 5810)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/CacheBenchmarkRunner.java	2008-05-08 11:24:35 UTC (rev 5811)
@@ -4,9 +4,16 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.cachebench.cluster.ClusterBarrier;
-import org.cachebench.config.*;
+import org.cachebench.config.CacheWarmupConfig;
+import org.cachebench.config.ConfigBuilder;
+import org.cachebench.config.Configuration;
+import org.cachebench.config.Report;
+import org.cachebench.config.TestCase;
+import org.cachebench.config.TestConfig;
+import org.cachebench.reportgenerators.ClusterAwareReportGenerator;
 import org.cachebench.reportgenerators.ReportGenerator;
 import org.cachebench.tests.CacheTest;
+import org.cachebench.tests.ClusteredCacheTest;
 import org.cachebench.tests.results.BaseTestResult;
 import org.cachebench.tests.results.TestResult;
 import org.cachebench.utils.Instantiator;
@@ -15,9 +22,9 @@
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.HashMap;
 
 
 /**
@@ -37,6 +44,7 @@
    String configuraton;
    int clusterSize;
    Map<String, String> systemParams = new HashMap<String, String>();
+   boolean localOnly;
 
    public static void main(String[] args)
    {
@@ -63,10 +71,12 @@
       String configuraton = System.getProperty("cacheBenchFwk.cacheConfigFile");
       String cacheProductName = System.getProperty("cacheBenchFwk.cachePrioductName");
       String clusterSize = System.getProperty("clusterSize");
+      localOnly = Boolean.getBoolean("localOnly");
 
       if (configuraton != null) systemParams.put("config", configuraton);
       if (cacheProductName != null) systemParams.put("cacheProductName", cacheProductName);
       if (clusterSize != null) systemParams.put("clusterSize", clusterSize);
+      if (localOnly) systemParams.put("localOnly", "TRUE");
    }
 
    private CacheBenchmarkRunner()
@@ -126,19 +136,19 @@
             cache = getCacheWrapperInstance(test);
             if (cache != null)
             {
-               Map<String,String> params = test.getParams();
+               Map<String, String> params = test.getParams();
                // now add the config file, if any is passed in:
                params.putAll(systemParams);
                logger.info("Initialising cache with params " + params);
                cache.init(params);
-               barrier("BEFORE_WARMUP");
+               if (!localOnly) barrier("BEFORE_WARMUP");
                warmupCache(test, cache);
-               barrier("AFTER_WARMUP");
+               if (!localOnly) barrier("AFTER_WARMUP");
 
                //now start testing
                cache.setUp();
                List<TestResult> resultsForCache = runTestsOnCache(cache, test);
-               barrier("AFTER_TEST_RUN");
+               if (!localOnly) barrier("AFTER_TEST_RUN");
                shutdownCache(cache);
                results.addAll(resultsForCache);
             }
@@ -148,7 +158,8 @@
             try
             {
                shutdownCache(cache);
-            } catch (Exception e1)
+            }
+            catch (Exception e1)
             {
                //ignore
             }
@@ -221,17 +232,23 @@
    private List<TestResult> runTestsOnCache(CacheWrapper cache, TestCase testCase)
    {
       List<TestResult> results = new ArrayList<TestResult>();
-      for (TestConfig testConfig: testCase.getTests())
+      for (TestConfig testConfig : testCase.getTests())
       {
-         CacheTest testConfigClass = getCacheTest(testConfig);
-         if (testConfigClass != null)
+         CacheTest testInstance = getCacheTest(testConfig);
+         if (testInstance instanceof ClusteredCacheTest && localOnly)
          {
+            logger.warn("Skipping replicated tests since this is in local mode!");
+            continue;
+         }
+
+         if (testInstance != null)
+         {
             TestResult result;
             String testName = testConfig.getName();
             String testCaseName = testCase.getName();
             try
             {
-               result = testConfigClass.doTest(testName, cache, testCaseName, conf.getSampleSize(), conf.getNumThreads());
+               result = testInstance.doTest(testName, cache, testCaseName, conf.getSampleSize(), conf.getNumThreads());
             }
             catch (Exception e)
             {
@@ -246,7 +263,7 @@
                logger.warn("Test case : " + testCaseName + ", Test : " + testName + " - Failed due to", e);
                errorLogger.error("Test case : " + testCaseName + ", Test : " + testName + " - Failed : " + e.getMessage(), e);
             }
-            if (!result.isTestPassed() && testCase.isStopOnFailure()) 
+            if (!result.isTestPassed() && testCase.isStopOnFailure())
             {
                logger.warn("The test '" + testCase + "/" + testName + "' failed, exiting...");
                System.exit(1);
@@ -272,6 +289,8 @@
             generator = getReportGenerator(report);
             if (generator != null)
             {
+               if (generator instanceof ClusterAwareReportGenerator && localOnly)
+                  throw new IllegalArgumentException("Configured to run in local mode only, cannot use a clustered report generator!");
                Map<String, String> params = report.getParams();
                params.putAll(systemParams);
                generator.setConfigParams(params);
@@ -283,7 +302,7 @@
             }
             else
             {
-               logger.info("Report not Generated - See logs for reasons");
+               logger.info("Report not generated - See logs for reasons!!");
             }
          }
          catch (Exception e)
@@ -337,6 +356,7 @@
       try
       {
          cacheTestClass = (CacheTest) Instantiator.getInstance().createClass(testConfig.getTestClass());
+         conf.setLocalOnly(localOnly);
          cacheTestClass.setConfiguration(conf);
       }
       catch (Exception e)

Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/config/Configuration.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/config/Configuration.java	2008-05-08 11:23:24 UTC (rev 5810)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/config/Configuration.java	2008-05-08 11:24:35 UTC (rev 5811)
@@ -14,6 +14,7 @@
    private int sleepBetweenTests;
    private boolean gcBetweenTestsEnabled;
    private boolean emptyCacheBetweenTests;
+   private boolean localOnly;
 
    private ClusterConfig clusterConfig;
 
@@ -22,7 +23,16 @@
    private List<Report> reports = new ArrayList<Report>();
    private int numThreads;
 
+   public boolean isLocalOnly()
+   {
+      return localOnly;
+   }
 
+   public void setLocalOnly(boolean localOnly)
+   {
+      this.localOnly = localOnly;
+   }
+
    public int getSampleSize()
    {
       return sampleSize;

Added: benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ClusterAwareReportGenerator.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ClusterAwareReportGenerator.java	                        (rev 0)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ClusterAwareReportGenerator.java	2008-05-08 11:24:35 UTC (rev 5811)
@@ -0,0 +1,8 @@
+package org.cachebench.reportgenerators;
+
+/**
+ * Marker interface
+ */
+public interface ClusterAwareReportGenerator extends ReportGenerator
+{
+}

Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ClusterReportGenerator.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ClusterReportGenerator.java	2008-05-08 11:23:24 UTC (rev 5810)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/reportgenerators/ClusterReportGenerator.java	2008-05-08 11:24:35 UTC (rev 5811)
@@ -17,7 +17,7 @@
  *
  * @author Mircea.Markus at jboss.com
  */
-public class ClusterReportGenerator extends AbstractReportGenerator
+public class ClusterReportGenerator extends AbstractReportGenerator implements ClusterAwareReportGenerator
 {
    private static Log log = LogFactory.getLog(ClusterReportGenerator.class);
    private String reportGeneratorClassName;
@@ -38,6 +38,7 @@
          barrier.setConfig(this.clusterConfig);
          barrier.setAcknowledge(false);
          barrier.barrier(results);
+
          log.trace(" Starting generating. Is master? " + clusterConfig.isMaster());
          if (clusterConfig.isMaster())
          {
@@ -45,10 +46,13 @@
             log.trace("Received following results: " + results);
             generateReport(barrier.getReceivedMessages());
          }
-      } catch (Exception e)
+      }
+      catch (Exception e)
       {
          log.error("Error while generating report!", e);
-      } finally {
+      }
+      finally
+      {
          barrierUntilReportIsGenerated();
       }
    }
@@ -103,7 +107,8 @@
       {
          log.debug("Using generator class: " + genClassName);
          return (AbstractReportGenerator) Class.forName(genClassName).newInstance();
-      } catch (Exception e)
+      }
+      catch (Exception e)
       {
          log.error("Could not instantiate report generators", e);
          throw new IllegalStateException(e);

Added: benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/ClusteredCacheTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/ClusteredCacheTest.java	                        (rev 0)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/ClusteredCacheTest.java	2008-05-08 11:24:35 UTC (rev 5811)
@@ -0,0 +1,10 @@
+package org.cachebench.tests;
+
+/**
+ * Empty marker interface
+ *
+ * @author Manik Surtani (<a href="mailto:manik at jboss.org">manik at jboss.org</a>)
+ */
+public interface ClusteredCacheTest extends CacheTest
+{
+}

Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java	2008-05-08 11:23:24 UTC (rev 5810)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/ReplicationOccursTest.java	2008-05-08 11:24:35 UTC (rev 5811)
@@ -3,11 +3,11 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.cachebench.CacheWrapper;
-import org.cachebench.tests.results.StatisticTestResult;
 import org.cachebench.cluster.ClusterBarrier;
 import org.cachebench.config.Configuration;
 import org.cachebench.config.TestCase;
 import org.cachebench.config.TestConfig;
+import org.cachebench.tests.results.StatisticTestResult;
 
 import java.net.SocketAddress;
 import java.util.Collection;
@@ -19,7 +19,8 @@
  *
  * @author Mircea.Markus at jboss.com
  */
-public class ReplicationOccursTest implements CacheTest {
+public class ReplicationOccursTest implements ClusteredCacheTest
+{
    public static final Log log = LogFactory.getLog(ReplicationOccursTest.class);
 
    private Configuration conf;
@@ -27,11 +28,13 @@
    private static final int REPLICATION_TRY_COUNT = 5;
    private static final int REPLICATION_TRY_SLEEP = 2000;
 
-   public void setConfiguration(Configuration configuration) {
+   public void setConfiguration(Configuration configuration)
+   {
       this.conf = configuration;
    }
 
-   public StatisticTestResult doTest(String testName, CacheWrapper cache, String testCaseName, int sampleSize, int numThreads) throws Exception {
+   public StatisticTestResult doTest(String testName, CacheWrapper cache, String testCaseName, int sampleSize, int numThreads) throws Exception
+   {
       log.trace("TestCase = '" + testCaseName + "', TestName = " + testName);
       barrierBeforeReplicationTest();
 
@@ -39,7 +42,8 @@
       tryToPut(cache, currentNodeIndex);
       Thread.sleep(REPLICATION_TRY_SLEEP);//just to make sure that prev barrier closed its sockets etc
 
-      if (conf.getClusterConfig().getClusterSize() == 1) {
+      if (conf.getClusterConfig().getClusterSize() == 1)
+      {
          log.info("Cluster size is one, no replication expected");
          StatisticTestResult result = new StatisticTestResult();
          result.setTestPassed(true);
@@ -50,23 +54,29 @@
       boolean allNodesReplicated = checkReplicationSeveralTimes(testName, cache, testCaseName);
 
       Map<SocketAddress, Object> receivedValues = broadcastReplicationResult(allNodesReplicated);
-      try {
+      try
+      {
          cache.empty();
-      } catch (Throwable e)
+      }
+      catch (Throwable e)
       {
          log.warn("Fail to cleanup cache after replication test", e);
       }
       return allReplicatedFine(receivedValues);
    }
 
-   private void tryToPut(CacheWrapper cache, Integer currentNodeIndex) throws Exception {
+   private void tryToPut(CacheWrapper cache, Integer currentNodeIndex) throws Exception
+   {
       int tryCount = 0;
-      while (tryCount < 5) {
-         try {
+      while (tryCount < 5)
+      {
+         try
+         {
             cache.put(PREFIX + currentNodeIndex, "true");
             return;
          }
-         catch (Throwable e) {
+         catch (Throwable e)
+         {
             log.warn("Error while trying to put data: ", e);
             tryCount++;
          }
@@ -77,9 +87,12 @@
     * If caches replicate async, then try several times.
     */
    private boolean checkReplicationSeveralTimes(String testName, CacheWrapper cache, String testCaseName)
-         throws Exception {
-      for (int i = 0; i < REPLICATION_TRY_COUNT; i++) {
-         if (nodesReplicated(cache, testCaseName, testName)) {
+         throws Exception
+   {
+      for (int i = 0; i < REPLICATION_TRY_COUNT; i++)
+      {
+         if (nodesReplicated(cache, testCaseName, testName))
+         {
             return true;
          }
          log.info("Replication test failed, " + (i + 1) + " tries so far. Sleeping for  " + REPLICATION_TRY_SLEEP
@@ -90,7 +103,8 @@
    }
 
    private Map<SocketAddress, Object> broadcastReplicationResult(boolean allNodesReplicated)
-         throws Exception {
+         throws Exception
+   {
       ClusterBarrier barrier = new ClusterBarrier();
       barrier.setConfig(conf.getClusterConfig());
       barrier.barrier(String.valueOf(allNodesReplicated));
@@ -100,18 +114,22 @@
    }
 
    private void barrierBeforeReplicationTest()
-         throws Exception {
+         throws Exception
+   {
       ClusterBarrier barrier = new ClusterBarrier();
       barrier.setAcknowledge(true);
       barrier.setConfig(conf.getClusterConfig());
       barrier.barrier("BEFORE_REPLICATION_OCCURS_BARRIER");
    }
 
-   private StatisticTestResult allReplicatedFine(Map<SocketAddress, Object> receivedValues) {
+   private StatisticTestResult allReplicatedFine(Map<SocketAddress, Object> receivedValues)
+   {
       StatisticTestResult result = new StatisticTestResult();
       result.setSkipReport(true);
-      for (Object value : receivedValues.values()) {
-         if (!"true".equals(value)) {
+      for (Object value : receivedValues.values())
+      {
+         if (!"true".equals(value))
+         {
             log.info("Replication was not successful on the entire cluster!");
             result.setTestPassed(false);
             return result;
@@ -122,45 +140,57 @@
       return result;
    }
 
-   private boolean isPartialReplication(String testCaseName, String testName) {
+   private boolean isPartialReplication(String testCaseName, String testName)
+   {
       TestCase testCase = conf.getTestCase(testCaseName);
       TestConfig thisConfig = testCase.getTest(testName);
       return thisConfig.existsParam("partialReplication") &&
             "true".equalsIgnoreCase(thisConfig.getParamValue("partialReplication"));
    }
 
-   private boolean nodesReplicated(CacheWrapper cache, String testCaseName, String testName) throws Exception {
+   private boolean nodesReplicated(CacheWrapper cache, String testCaseName, String testName) throws Exception
+   {
       int clusterSize = conf.getClusterConfig().getClusterSize();
       int replicaCount = 0;
-      for (int i = 0; i < clusterSize; i++) {
+      for (int i = 0; i < clusterSize; i++)
+      {
          int currentNodeIndex = conf.getClusterConfig().getCurrentNodeIndex();
-         if (i == currentNodeIndex) {
+         if (i == currentNodeIndex)
+         {
             continue;
          }
          Object data = tryGet(cache, i);
-         if (data == null || !"true".equals(data)) {
+         if (data == null || !"true".equals(data))
+         {
             log.trace("Cache with index " + i + " did *NOT* replicate");
-         } else {
+         }
+         else
+         {
             log.trace("Cache with index " + i + " replicated here ");
             replicaCount++;
          }
       }
       log.info("Number of caches that replicated here is " + replicaCount);
-      if (isPartialReplication(testCaseName, testName)) {
+      if (isPartialReplication(testCaseName, testName))
+      {
          return verifyClusterReplication(replicaCount);
       }
       return replicaCount == conf.getClusterConfig().getClusterSize() - 1;
    }
 
-   private Object tryGet(CacheWrapper cache, int i) throws Exception {
+   private Object tryGet(CacheWrapper cache, int i) throws Exception
+   {
       int tryCont = 0;
       while (tryCont < 5)
       {
-         try {
+         try
+         {
             return cache.getReplicatedData(PREFIX + i);
-         } catch (Throwable e) {
-            tryCont ++;
          }
+         catch (Throwable e)
+         {
+            tryCont++;
+         }
       }
       return null;
    }
@@ -169,21 +199,24 @@
     * Checks whether the sum of replciations across the cluster is bigger than the number of nodes in the cluster, in
     * other words each node replicated at least once.
     */
-   private boolean verifyClusterReplication(int replicaCount) throws Exception {
+   private boolean verifyClusterReplication(int replicaCount) throws Exception
+   {
       ClusterBarrier barrier = new ClusterBarrier();
       barrier.setConfig(conf.getClusterConfig());
       barrier.barrier(replicaCount);
       Collection recievedValues = barrier.getReceivedMessages().values();
       log.trace("Recieved the following repilcation counts: " + recievedValues);
       int totalValue = 0;
-      for (Object val : recievedValues) {
+      for (Object val : recievedValues)
+      {
          totalValue += Integer.valueOf(val.toString());
       }
       log.info("********** Overall replication count is: " + totalValue);
       //this means SOME replication occurred. This does not mean, though, that all nodes replicated successfuly.
       //correct condition would be >= this.conf.getClusterConfig().getClusterSize()
       //todo/FIXME - this seem not to work with all the products, so we will accept 'some replication'
-      if (totalValue < this.conf.getClusterConfig().getClusterSize()) {
+      if (totalValue < this.conf.getClusterConfig().getClusterSize())
+      {
          log.warn("The replication was not total, but partial!!");
       }
       boolean isReplicationSuccess = totalValue > 0;

Modified: benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/SessionSimulatorTest.java
===================================================================
--- benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/SessionSimulatorTest.java	2008-05-08 11:23:24 UTC (rev 5810)
+++ benchmarks/benchmark-fwk/trunk/src/org/cachebench/tests/SessionSimulatorTest.java	2008-05-08 11:24:35 UTC (rev 5811)
@@ -8,12 +8,12 @@
 import org.cachebench.config.TestConfig;
 import org.cachebench.tests.results.TestResult;
 
+import java.util.Date;
 import java.util.Random;
-import java.util.Date;
 
 /**
  * Simulates work with a web session.
- * 
+ *
  * @author Mircea.Markus at jboss.com
  * @since 2.2
  */
@@ -76,7 +76,7 @@
       Random r = new Random();
       int randomAction;
       int randomAttribute;
-      long start=System.currentTimeMillis();
+      long start = System.currentTimeMillis();
       for (int i = 0; i < numberOfRequests; i++)
       {
          logRunCount(i);
@@ -90,11 +90,13 @@
                buf = (byte[]) cacheWrapper.get(getSessionEntry(randomAttribute));
                totalBytesRead += buf.length;
                reads++;
-            } catch (Throwable e)
+            }
+            catch (Throwable e)
             {
-               log.warn("Error appeared whilst reading from cache:" + e.getMessage());
+               log.warn("Error appeared whilst reading from cache:" + e.getMessage(), e);
             }
-         } else
+         }
+         else
          {             // write
             buf = new byte[this.sizeOfAnAttribute];
             try
@@ -102,9 +104,10 @@
                cacheWrapper.put(getSessionEntry(randomAttribute), buf);
                totalBytesWritten += buf.length;
                writes++;
-            } catch (Throwable e)
+            }
+            catch (Throwable e)
             {
-               log.warn("Error appeared whilst writing to cache:" + e.getMessage());
+               log.warn("Error appeared whilst writing to cache:" + e.getMessage(), e);
             }
          }
       }
@@ -122,7 +125,7 @@
    {
       if (i % LOG_AFTER_OPERATION_COUNT == 0)
       {
-         log.info("SessionSimulatorTest performed " + i + " oprations");
+         log.info("SessionSimulatorTest performed " + i + " operations");
       }
    }
 
@@ -130,11 +133,14 @@
    {
       for (int i = 0; i < numberOfAttributes; i++)
       {
-         try {
+         try
+         {
             cacheWrapper.put(getSessionEntry(i), new byte[sizeOfAnAttribute]);
-         } catch (Throwable e) {
-            log.warn("Error while initializing the session: " , e);
          }
+         catch (Throwable e)
+         {
+            log.warn("Error while initializing the session: ", e);
+         }
       }
    }
 
@@ -143,9 +149,9 @@
       return sessionId + i;
    }
 
-   private void readParams ()
+   private void readParams()
    {
-      sessionId = SESSION_PREFIX + configuration.getClusterConfig().getCurrentNodeIndex();
+      sessionId = SESSION_PREFIX + getNodeIndex();
       log.debug("Session id is: " + sessionId);
       numberOfRequests = thisTestConfig.getIntValue("numberOfRequest");
       numberOfAttributes = thisTestConfig.getIntValue("numberOfAttributes");
@@ -157,6 +163,6 @@
 
    public String getNodeIndex()
    {
-      return configuration.getClusterConfig().getCurrentNodeIndex() + "";
+      return configuration.isLocalOnly() ? "0" : configuration.getClusterConfig().getCurrentNodeIndex() + "";
    }
 }




More information about the jbosscache-commits mailing list