JBoss Cache SVN: r8241 - in core/tags/3.2.1.CR1: src/main/java/org/jboss/cache and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2009-09-25 08:35:43 -0400 (Fri, 25 Sep 2009)
New Revision: 8241
Modified:
core/tags/3.2.1.CR1/pom.xml
core/tags/3.2.1.CR1/src/main/java/org/jboss/cache/Version.java
Log:
JBoss Cache Release Script: Updating 3.2.1.CR1
Modified: core/tags/3.2.1.CR1/pom.xml
===================================================================
--- core/tags/3.2.1.CR1/pom.xml 2009-09-25 12:34:22 UTC (rev 8240)
+++ core/tags/3.2.1.CR1/pom.xml 2009-09-25 12:35:43 UTC (rev 8241)
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
- <jbosscache-core-version>3.2.1-SNAPSHOT</jbosscache-core-version>
+ <jbosscache-core-version>3.2.1.CR1</jbosscache-core-version>
<!-- By default only run tests in the "unit" group -->
<defaultTestGroup>unit</defaultTestGroup>
<!-- By default only generate Javadocs when we install the module. -->
@@ -485,7 +485,7 @@
<activeByDefault>false</activeByDefault>
</activation>
<properties>
- <jbosscache-core-version>3.2.1-SNAPSHOT-JBossAS</jbosscache-core-version>
+ <jbosscache-core-version>3.2.1.CR1-JBossAS</jbosscache-core-version>
<defaultTestGroup>functional,unit</defaultTestGroup>
<protocol.stack>tcp</protocol.stack>
</properties>
Modified: core/tags/3.2.1.CR1/src/main/java/org/jboss/cache/Version.java
===================================================================
--- core/tags/3.2.1.CR1/src/main/java/org/jboss/cache/Version.java 2009-09-25 12:34:22 UTC (rev 8240)
+++ core/tags/3.2.1.CR1/src/main/java/org/jboss/cache/Version.java 2009-09-25 12:35:43 UTC (rev 8241)
@@ -32,10 +32,10 @@
@Immutable
public class Version
{
- public static final String version = "3.2.1-SNAPSHOT";
+ public static final String version = "3.2.1.CR1";
public static final String codename = "Malagueta";
//public static final String cvs = "$Id$";
- static final byte[] version_id = {'0', '3', '2', '1', 'S'};
+ static final byte[] version_id = {'0','3','2','1','C','R','1'};
private static final int MAJOR_SHIFT = 11;
private static final int MINOR_SHIFT = 6;
13 years, 5 months
JBoss Cache SVN: r8240 - core/tags.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2009-09-25 08:34:22 -0400 (Fri, 25 Sep 2009)
New Revision: 8240
Added:
core/tags/3.2.1.CR1/
Log:
JBoss Cache Release Script: Tagging 3.2.1.CR1
Copied: core/tags/3.2.1.CR1 (from rev 8239, core/trunk)
13 years, 5 months
JBoss Cache SVN: r8239 - core/trunk/src/main/java/org/jboss/cache/lock.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2009-09-24 12:40:14 -0400 (Thu, 24 Sep 2009)
New Revision: 8239
Modified:
core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java
Log:
[JBCACHE-1547] (0ms lock acquisition timeout ignored when using putForExternalRead and MVCC)
Modified: core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java 2009-09-24 11:32:13 UTC (rev 8238)
+++ core/trunk/src/main/java/org/jboss/cache/lock/MVCCLockManager.java 2009-09-24 16:40:14 UTC (rev 8239)
@@ -129,7 +129,8 @@
if (lockType == READ) return true; // we don't support read locks.
if (trace) log.trace("Attempting to lock " + fqn);
- if (lockContainer.acquireLock(fqn, lockAcquisitionTimeout, MILLISECONDS))
+
+ if (lockContainer.acquireLock(fqn, ctx.getLockAcquisitionTimeout(lockAcquisitionTimeout), MILLISECONDS))
{
ctx.addLock(fqn);
return true;
13 years, 6 months
JBoss Cache SVN: r8238 - in core/branches/1.4.X: src/org/jboss/cache/interceptors and 2 other directories.
by jbosscache-commits@lists.jboss.org
Author: galder.zamarreno(a)jboss.com
Date: 2009-09-24 07:32:13 -0400 (Thu, 24 Sep 2009)
New Revision: 8238
Added:
core/branches/1.4.X/etc/META-INF/optimistic-replicated-eviction.xml
core/branches/1.4.X/tests/functional/org/jboss/cache/eviction/OptimisticReplicatedEvictionTest.java
Modified:
core/branches/1.4.X/src/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java
core/branches/1.4.X/tests/functional/org/jboss/cache/optimistic/NodeInterceptorRemoveNodeTest.java
Log:
[JBCACHE-1545] OL queues removal modifications even if the node was not present locally.
Added: core/branches/1.4.X/etc/META-INF/optimistic-replicated-eviction.xml
===================================================================
--- core/branches/1.4.X/etc/META-INF/optimistic-replicated-eviction.xml (rev 0)
+++ core/branches/1.4.X/etc/META-INF/optimistic-replicated-eviction.xml 2009-09-24 11:32:13 UTC (rev 8238)
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!-- -->
+<!-- Sample TreeCache Service Configuration -->
+<!-- -->
+<!-- ===================================================================== -->
+
+<server>
+
+ <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
+
+
+ <!-- ==================================================================== -->
+ <!-- Defines TreeCache configuration -->
+ <!-- ==================================================================== -->
+
+ <mbean code="org.jboss.cache.TreeCache"
+ name="jboss.cache:service=TreeCache">
+
+ <depends>jboss:service=Naming</depends>
+ <depends>jboss:service=TransactionManager</depends>
+
+ <!--
+ Configure the TransactionManager
+ -->
+ <attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>
+
+ <attribute name="FetchInMemoryState">false</attribute>
+ <attribute name="FetchPersistentState">false</attribute>
+ <!-- Whether each interceptor should have an mbean
+ registered to capture and display its statistics. -->
+ <attribute name="UseInterceptorMbeans">true</attribute>
+
+ <!--
+ Node locking scheme:
+ OPTIMISTIC
+ PESSIMISTIC (default)
+ -->
+ <attribute name="NodeLockingScheme">Optimistic</attribute>
+
+ <!--
+ Node locking level : SERIALIZABLE
+ REPEATABLE_READ (default)
+ READ_COMMITTED
+ READ_UNCOMMITTED
+ NONE
+ -->
+ <attribute name="IsolationLevel">READ_COMMITTED</attribute>
+
+
+ <!--
+ Valid modes are LOCAL
+ REPL_ASYNC
+ REPL_SYNC
+ -->
+ <attribute name="CacheMode">REPL_SYNC</attribute>
+
+ <!-- Name of cluster. Needs to be the same for all clusters, in order
+ to find each other
+ -->
+ <attribute name="ClusterName">Infa-Cache-Cluster</attribute>
+
+ <attribute name="ClusterConfig">
+ <config>
+ <!-- UDP: if you have a multihomed machine,
+ set the bind_addr attribute to the appropriate NIC IP address, e.g bind_addr="192.168.0.2"
+ -->
+ <!-- UDP: On Windows machines, because of the media sense feature
+ being broken with multicast (even after disabling media sense)
+ set the loopback attribute to true -->
+ <UDP mcast_addr="228.1.2.3" mcast_port="48866"
+ ip_ttl="64" ip_mcast="true"
+ mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
+ ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
+ loopback="false"/>
+ <PING timeout="2000" num_initial_members="3"
+ up_thread="false" down_thread="false"/>
+ <MERGE2 min_interval="10000" max_interval="20000"/>
+ <!-- <FD shun="true" up_thread="true" down_thread="true" />-->
+ <FD_SOCK/>
+ <VERIFY_SUSPECT timeout="1500"
+ up_thread="false" down_thread="false"/>
+ <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
+ max_xmit_size="8192" up_thread="false" down_thread="false"/>
+ <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10"
+ down_thread="false"/>
+ <pbcast.STABLE desired_avg_gossip="20000"
+ up_thread="false" down_thread="false"/>
+ <FRAG frag_size="8192"
+ down_thread="false" up_thread="false"/>
+ <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
+ shun="true" print_local_addr="true"/>
+ <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>
+ </config>
+ </attribute>
+
+ <!-- Max number of milliseconds to wait for a lock acquisition -->
+ <attribute name="LockAcquisitionTimeout">1000</attribute>
+
+ <!-- Name of the eviction policy class.-->
+ <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
+ <attribute name="EvictionPolicyConfig">
+ <config>
+ <attribute name="wakeUpIntervalSeconds">1</attribute>
+ <region name="/_default_">
+ <attribute name="maxNodes">10</attribute>
+ <attribute name="timeToLiveSeconds">0</attribute>
+ <attribute name="maxAgeSeconds">0</attribute>
+ </region>
+ <region name="/testingRegion">
+ <attribute name="maxNodes">10</attribute>
+ <attribute name="timeToLiveSeconds">0</attribute>
+ <attribute name="maxAgeSeconds">0</attribute>
+ </region>
+ <region name="/timeBased">
+ <attribute name="maxNodes">10</attribute>
+ <attribute name="timeToLiveSeconds">1</attribute>
+ <attribute name="maxAgeSeconds">1</attribute>
+ </region>
+ <region name="/timeToLiveBased">
+ <attribute name="maxNodes">10</attribute>
+ <attribute name="timeToLiveSeconds">5</attribute>
+ <attribute name="maxAgeSeconds">0</attribute>
+ </region>
+ </config>
+ </attribute>
+
+ </mbean>
+</server>
Modified: core/branches/1.4.X/src/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java
===================================================================
--- core/branches/1.4.X/src/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java 2009-09-24 10:28:05 UTC (rev 8237)
+++ core/branches/1.4.X/src/org/jboss/cache/interceptors/OptimisticNodeInterceptor.java 2009-09-24 11:32:13 UTC (rev 8238)
@@ -101,6 +101,14 @@
else
{
log.trace("Workspace node is null. Perhaps it has been deleted?");
+ // However, if a removal was requested to a node we don't have, we should still propagate it!!
+ Option opt = ctx.getOptionOverrides();
+ if ((opt == null || !opt.isCacheModeLocal()) && m.getMethodId() == MethodDeclarations.removeNodeMethodLocal_id)
+ {
+ txTable.addModification(gtx, m);
+ if (log.isDebugEnabled()) log.debug("Adding Method " + m + " to modification list");
+ }
+ if (cache.getCacheLoaderManager() != null) txTable.addCacheLoaderModification(gtx, m);
return null;
}
}
Added: core/branches/1.4.X/tests/functional/org/jboss/cache/eviction/OptimisticReplicatedEvictionTest.java
===================================================================
--- core/branches/1.4.X/tests/functional/org/jboss/cache/eviction/OptimisticReplicatedEvictionTest.java (rev 0)
+++ core/branches/1.4.X/tests/functional/org/jboss/cache/eviction/OptimisticReplicatedEvictionTest.java 2009-09-24 11:32:13 UTC (rev 8238)
@@ -0,0 +1,182 @@
+package org.jboss.cache.eviction;
+
+import junit.framework.TestCase;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.AbstractTreeCacheListener;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.ExtendedTreeCacheListener;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.PropertyConfigurator;
+import org.jboss.cache.TreeCache;
+
+import EDU.oswego.cs.dl.util.concurrent.BoundedLinkedQueue;
+import EDU.oswego.cs.dl.util.concurrent.Callable;
+import EDU.oswego.cs.dl.util.concurrent.Executor;
+import EDU.oswego.cs.dl.util.concurrent.FutureResult;
+import EDU.oswego.cs.dl.util.concurrent.ThreadedExecutor;
+
+public class OptimisticReplicatedEvictionTest extends TestCase
+{
+ private static final Log log = LogFactory.getLog(OptimisticReplicatedEvictionTest.class);
+
+ private TreeCache cache1;
+ private TreeCache cache2;
+
+ private BoundedLinkedQueue queue = new BoundedLinkedQueue();
+ private static final Fqn SHUTDOWN_FQN = new Fqn("time-to-shutdown");
+
+ protected void setUp() throws Exception
+ {
+ super.setUp();
+
+ cache1 = new TreeCache();
+ PropertyConfigurator config1 = new PropertyConfigurator();
+ config1.configure(cache1, "META-INF/optimistic-replicated-eviction.xml");
+ cache1.startService();
+
+ cache2 = new TreeCache();
+ PropertyConfigurator config2 = new PropertyConfigurator();
+ config2.configure(cache2, "META-INF/optimistic-replicated-eviction.xml");
+ RemovalThread removalThread = new RemovalThread(cache2);
+ log.trace("Starting the removal thread...");
+ removalThread.start();
+ EvictionListener listener = new EvictionListener();
+ log.trace("Listening for evictions...");
+ cache2.addTreeCacheListener(listener);
+ cache2.startService();
+ }
+
+ protected void tearDown() throws Exception
+ {
+ if (cache1 != null)
+ {
+ cache1.stopService();
+ cache1 = null;
+ }
+ super.tearDown();
+ }
+
+ public void testClusteredEvictionToClearVersionInfo() throws Exception
+ {
+ cache1.put( "/timeToLiveBased/test000", "k-allele", "v1-allele" ); // this could be from any node
+ cache1.put( "/timeToLiveBased/test000", "k-allele", "v2-allele" ); // v2
+
+ Callable c = new Callable() {
+ public Object call() throws Exception {
+ Thread.sleep(8 * 1000);
+ Object ret = cache2.put("/timeToLiveBased/test000", "k-allele", "v3-allele" ); // will always fail during replication to A:
+ if (ret instanceof Exception) throw (Exception) ret;
+ return null;
+ }
+ };
+
+ Executor executor = new ThreadedExecutor();
+ FutureResult f = new FutureResult();
+ Runnable command = f.setter(c);
+ executor.execute(command);
+
+ for (;;)
+ {
+ if (f.isReady())
+ {
+ f.get();
+ break;
+ }
+ else
+ {
+ Thread.sleep(2 * 1000);
+ }
+ cache1.get("/timeToLiveBased/test000", "k-allele"); // refresh the eviction timer so the node will never be evicted on A
+ }
+
+ assertEquals(cache1.get("/timeToLiveBased/test000", "k-allele"), "v3-allele");
+ assertEquals(cache2.get("/timeToLiveBased/test000", "k-allele"), "v3-allele");
+ }
+
+ // Jimmy's cluster wide removal workaround
+ /**
+ * An inner class that serves as a listener for cache eviction events.
+ */
+ private class EvictionListener extends AbstractTreeCacheListener implements ExtendedTreeCacheListener
+ {
+ public void nodeEvict(Fqn fqn, boolean pre)
+ {
+ // make sure we act *after* eviction takes place
+ if (!pre)
+ {
+ if (log.isTraceEnabled())
+ {
+ StringBuilder builder = new StringBuilder("Adding ");
+ builder.append(fqn);
+ builder.append(" for removal...");
+ log.trace(builder);
+ }
+ try {
+ queue.put(fqn);
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ }
+ }
+ }
+ }
+
+ /**
+ * An inner class that serves as the thread that calls the cluster-wide
+ * remove operation as cache listener event message threads are cache
+ * blocking.
+ */
+ private class RemovalThread extends Thread
+ {
+ private final TreeCache cache;
+
+ public RemovalThread(TreeCache cache)
+ {
+ setName("Cache Eviction Remover");
+ this.cache = cache;
+ }
+
+ public void run()
+ {
+ log.trace("The cache eviction remover thread is starting...");
+
+ while (! isInterrupted())
+ {
+ Fqn fqn = null;
+
+ try
+ {
+ fqn = (Fqn) queue.take();
+
+ // if we're shutting down, do nothing...
+ if (fqn != SHUTDOWN_FQN)
+ {
+ if (log.isTraceEnabled())
+ {
+ log.trace("Removing " + fqn);
+ }
+
+ cache.remove(fqn);
+ }
+ }
+ catch (CacheException ce)
+ {
+ // if this happens, data will remain in remote caches so
+ // indicate it as WARN or even ERROR
+ StringBuilder builder = new StringBuilder("Failed to remove ");
+ builder.append(fqn);
+ builder.append(" from remote caches:");
+ log.warn(builder, ce);
+ }
+ catch (InterruptedException ie)
+ {
+ Thread.currentThread().interrupt();
+ // we were interrupted in queue.take() so stop
+ break;
+ }
+ }
+ log.trace("The cache eviction remover thread is stopping...");
+ }
+ }
+}
Modified: core/branches/1.4.X/tests/functional/org/jboss/cache/optimistic/NodeInterceptorRemoveNodeTest.java
===================================================================
--- core/branches/1.4.X/tests/functional/org/jboss/cache/optimistic/NodeInterceptorRemoveNodeTest.java 2009-09-24 10:28:05 UTC (rev 8237)
+++ core/branches/1.4.X/tests/functional/org/jboss/cache/optimistic/NodeInterceptorRemoveNodeTest.java 2009-09-24 11:32:13 UTC (rev 8238)
@@ -77,7 +77,8 @@
assertEquals(0, workspace.getNodes().size());
assertTrue(entry.getLocks().isEmpty());
- assertEquals(0, entry.getModifications().size());
+ // JBCACHE-1545 modifications are still queued even though removed node does not exist
+ assertEquals(1, entry.getModifications().size());
assertTrue(!cache.exists("/one/two"));
assertEquals(null, dummy.getCalled());
13 years, 6 months
JBoss Cache SVN: r8237 - in core/trunk/src: test/java/org/jboss/cache/loader and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2009-09-24 06:28:05 -0400 (Thu, 24 Sep 2009)
New Revision: 8237
Added:
core/trunk/src/test/java/org/jboss/cache/loader/ParentDataLoadedTest.java
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
Log:
[JBCACHE-1541] - When modifying evicted node, parent nodes are marked as loaded
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2009-09-23 15:28:49 UTC (rev 8236)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2009-09-24 10:28:05 UTC (rev 8237)
@@ -319,7 +319,11 @@
{
// just create a dummy node in memory
n = helper.wrapNodeForWriting(ctx, fqn, true, true, true, false, false);
- n.setDataLoaded(false);
+ for (NodeSPI node = n; node != null && node.isCreated(); node = node.getParentDirect())
+ {
+ node.setDataLoaded(false);
+ }
+
}
if (nodeData != null)
{
Added: core/trunk/src/test/java/org/jboss/cache/loader/ParentDataLoadedTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/loader/ParentDataLoadedTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/loader/ParentDataLoadedTest.java 2009-09-24 10:28:05 UTC (rev 8237)
@@ -0,0 +1,45 @@
+package org.jboss.cache.loader;
+
+import org.jboss.cache.AbstractSingleCacheTest;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.UnitTestCacheFactory;
+import org.jboss.cache.config.CacheLoaderConfig;
+import org.jboss.cache.factories.UnitTestConfigurationFactory;
+import org.jboss.cache.loader.testloaders.DummyInMemoryCacheLoader;
+import org.testng.annotations.Test;
+
+@Test(groups = "functional", testName = "loader.ParentDataLoadedTest")
+public class ParentDataLoadedTest extends AbstractSingleCacheTest
+{
+ private static final Fqn<String> FQN = Fqn.fromElements("a", "a", "a");
+ private CacheSPI<String, String> cache;
+
+ public CacheSPI createCache() throws Exception
+ {
+ UnitTestCacheFactory<String, String> cf = new UnitTestCacheFactory<String, String>();
+ cache = (CacheSPI<String, String>) cf.createCache("configs/local-tx.xml", false, getClass());
+ cache.getConfiguration().setEvictionConfig(null);
+ CacheLoaderConfig cacheLoaderConfig = UnitTestConfigurationFactory.buildSingleCacheLoaderConfig(false, "", DummyInMemoryCacheLoader.class.getName(), "", false, true, false, false, false);
+ cache.getConfiguration().setCacheLoaderConfig(cacheLoaderConfig);
+
+ cache.start();
+
+ return cache;
+ }
+
+ public void testParents()
+ {
+ cache.put(FQN.getParent().getParent(), "test", "test");
+ cache.put(FQN.getParent(), "test", "test");
+ cache.put(FQN, "test", "test");
+
+ cache.evict(FQN.ROOT, true);
+
+ cache.put(FQN, "test", "new");
+
+ assert cache.get(FQN, "test") != null;
+ assert cache.get(FQN.getParent(), "test") != null;
+ assert cache.get(FQN.getParent().getParent(), "test") != null;
+ }
+}
13 years, 6 months
JBoss Cache SVN: r8236 - in core/trunk: src/main/java/org/jboss/cache/interceptors and 2 other directories.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2009-09-23 11:28:49 -0400 (Wed, 23 Sep 2009)
New Revision: 8236
Modified:
core/trunk/pom.xml
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferIntegrator.java
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferManager.java
core/trunk/src/test/java/org/jboss/cache/statetransfer/NonBlockingStateTransferTest.java
Log:
fix NBST tests and integration with jgroups2.6.13
Modified: core/trunk/pom.xml
===================================================================
--- core/trunk/pom.xml 2009-09-17 15:16:06 UTC (rev 8235)
+++ core/trunk/pom.xml 2009-09-23 15:28:49 UTC (rev 8236)
@@ -28,7 +28,7 @@
<groupId>jgroups</groupId>
<artifactId>jgroups</artifactId>
<!--<version>2.8.0.Beta2</version>-->
- <version>2.6.9.GA</version>
+ <version>2.6.13.CR2</version>
</dependency>
<!--
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2009-09-17 15:16:06 UTC (rev 8235)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheLoaderInterceptor.java 2009-09-23 15:28:49 UTC (rev 8236)
@@ -321,9 +321,9 @@
n = helper.wrapNodeForWriting(ctx, fqn, true, true, true, false, false);
n.setDataLoaded(false);
}
- if (nodeData != null && n != null)
+ if (nodeData != null)
{
- nodeData = setNodeState(ctx, fqn, n, nodeData);
+ setNodeState(ctx, fqn, n, nodeData);
}
}
}
@@ -460,7 +460,7 @@
* If it doesn't exist on disk but in memory, clears the
* uninitialized flag, otherwise returns null.
*/
- private Map setNodeState(InvocationContext ctx, Fqn fqn, NodeSPI n, Map nodeData) throws Exception
+ private void setNodeState(InvocationContext ctx, Fqn fqn, NodeSPI n, Map nodeData) throws Exception
{
if (trace) log.trace("setNodeState node is " + n);
if (nodeData != null)
@@ -498,7 +498,6 @@
if (trace) log.trace("Setting dataLoaded to true");
n.setDataLoaded(true);
}
- return nodeData;
}
private Map loadData(InvocationContext ctx, Fqn fqn) throws Exception
Modified: core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferIntegrator.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferIntegrator.java 2009-09-17 15:16:06 UTC (rev 8235)
+++ core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferIntegrator.java 2009-09-23 15:28:49 UTC (rev 8236)
@@ -349,9 +349,11 @@
{
prepareContextOptions();
NodeSPI targetNode = cache.getNode(target);
+ if (trace) log.trace("Target node has following children: " + targetNode.getChildrenNames());
for (Object childname : targetNode.getChildrenNames())
{
prepareContextOptions();
+ if (trace) log.trace("Removing child: " + childname);
targetNode.removeChild(childname);
}
@@ -397,6 +399,7 @@
// read marker off stack
// cache.getMarshaller().objectFromObjectStream(in);
}
+ if (trace) log.trace("Finished integrating transient state");
}
@SuppressWarnings("unchecked")
@@ -412,7 +415,9 @@
throw new CacheException(cause);
}
if (obj instanceof NodeDataMarker) return null;
+ if (trace) log.trace("Data readed from stream is: " + obj);
+
return (List<NodeData>) obj;
}
@@ -427,6 +432,7 @@
while (nd != null && !nd.isMarker())
{
fqn = nd.getFqn();
+ if (trace) log.trace("Integrating state for children: " + fqn);
// If we need to integrate into the buddy backup subtree,
// change the Fqn to fit under it
if (offset > 0)
Modified: core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferManager.java 2009-09-17 15:16:06 UTC (rev 8235)
+++ core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTransferManager.java 2009-09-23 15:28:49 UTC (rev 8236)
@@ -147,6 +147,7 @@
NodeSPI target = cache.getNode(targetRoot);
if (target == null)
{
+ if(trace) log.trace("Target node not found, creating it");
// Create the integration root, but do not replicate
cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
@@ -158,6 +159,7 @@
}
Object o = marshaller.objectFromObjectStream(in);
Boolean hasState = (Boolean) o;
+ if (trace) log.trace("Do we have state to integrate? " + hasState);
if (hasState)
{
setState(in, target);
Modified: core/trunk/src/test/java/org/jboss/cache/statetransfer/NonBlockingStateTransferTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/statetransfer/NonBlockingStateTransferTest.java 2009-09-17 15:16:06 UTC (rev 8235)
+++ core/trunk/src/test/java/org/jboss/cache/statetransfer/NonBlockingStateTransferTest.java 2009-09-23 15:28:49 UTC (rev 8236)
@@ -17,6 +17,7 @@
import org.jboss.cache.config.Configuration;
import org.jboss.cache.config.Configuration.CacheMode;
import org.jboss.cache.factories.UnitTestConfigurationFactory;
+import org.jboss.cache.util.CachePrinter;
import org.jboss.cache.util.TestingUtil;
import static org.testng.AssertJUnit.assertEquals;
import org.testng.annotations.Test;
@@ -82,7 +83,9 @@
private final Cache<Object,Object> cache;
private final boolean tx;
private volatile boolean stop;
- private volatile int result;
+ private volatile int end;
+ private volatile int start = 0;
+ private int cleanupRange = 1000;
WritingRunner(Cache<Object, Object> cache, boolean tx)
{
@@ -90,29 +93,48 @@
this.tx = tx;
}
- public int result()
+ WritingRunner(Cache<Object, Object> cache, boolean tx, int cleanupRange)
{
- return result;
+ this.cache = cache;
+ this.tx = tx;
+ this.cleanupRange = cleanupRange;
}
+ public synchronized int end()
+ {
+ return end;
+ }
+
+ public synchronized int start()
+ {
+ return start;
+ }
+
public void run()
{
- int c = 0;
+ end = 0;
while (!stop)
{
try
{
- if (c == 1000)
+ if (end == cleanupRange)
{
startTxIfNeeded();
- for (int i=0; i<1000; i++) cache.removeNode("/test" + i);
- commitTxIfNeeded();
- c = 0;
+ for (int i=0; i<cleanupRange; i++) {
+ start = i + 1;
+ cache.removeNode("/test" + i);
+ commitTxIfNeeded();
+ }
+ synchronized (this)
+ {
+ start = 0;
+ end = 0;
+ }
}
else
{
startTxIfNeeded();
- cache.put("/test" + c, "test", c++);
+ cache.put("/test" + start, "test", start++);
commitTxIfNeeded();
}
}
@@ -127,7 +149,6 @@
stop = true;
}
}
- result = c;
}
private void startTxIfNeeded() throws Exception
@@ -327,9 +348,12 @@
try
{
cache1 = createCache(name);
+ writeInitialData(cache1);
+
cache3 = createCache(name);
+ TestingUtil.blockUntilViewsReceived(new CacheSPI[] { cache1, cache3 }, 10000);
+ verifyInitialData(cache3);
- writeInitialData(cache1);
// Delay the transient copy, so that we get a more thorough log test
cache1.put("/delay", "delay", new DelayTransfer());
@@ -350,9 +374,12 @@
verifyInitialData(cache2);
- int count = writer.result();
+ int end = writer.end();
+ int start = writer.start();
- for (int c = 0; c < count; c++)
+ log.trace("Cache content is: " + CachePrinter.printCacheDetails(cache2));
+
+ for (int c = start; c < end; c++)
assertEquals(c, cache2.get("/test" + c, "test"));
}
finally
@@ -389,7 +416,7 @@
// Delay the transient copy, so that we get a more thorough log test
cache1.put("/delay", "delay", new DelayTransfer());
- WritingRunner writer = new WritingRunner(cache1, tx);
+ WritingRunner writer = new WritingRunner(cache1, tx, 500);
Thread writerThread = new Thread(writer);
writerThread.setDaemon(true);
writerThread.start();
@@ -405,9 +432,10 @@
verifyInitialData(cache2);
- int count = writer.result();
+ int start = writer.start();
+ int end = writer.end();
- for (int c = 0; c < count; c++)
+ for (int c = start; c < end; c++)
assertEquals(c, cache2.get("/test" + c, "test"));
}
finally
13 years, 6 months
JBoss Cache SVN: r8235 - in core/tags/3.2.1.BETA3: src/main/java/org/jboss/cache and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2009-09-17 11:16:06 -0400 (Thu, 17 Sep 2009)
New Revision: 8235
Modified:
core/tags/3.2.1.BETA3/pom.xml
core/tags/3.2.1.BETA3/src/main/java/org/jboss/cache/Version.java
Log:
JBoss Cache Release Script: Updating 3.2.1.BETA3
Modified: core/tags/3.2.1.BETA3/pom.xml
===================================================================
--- core/tags/3.2.1.BETA3/pom.xml 2009-09-17 15:14:44 UTC (rev 8234)
+++ core/tags/3.2.1.BETA3/pom.xml 2009-09-17 15:16:06 UTC (rev 8235)
@@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<properties>
- <jbosscache-core-version>3.2.1-SNAPSHOT</jbosscache-core-version>
+ <jbosscache-core-version>3.2.1.BETA3</jbosscache-core-version>
<!-- By default only run tests in the "unit" group -->
<defaultTestGroup>unit</defaultTestGroup>
<!-- By default only generate Javadocs when we install the module. -->
@@ -485,7 +485,7 @@
<activeByDefault>false</activeByDefault>
</activation>
<properties>
- <jbosscache-core-version>3.2.1-SNAPSHOT-JBossAS</jbosscache-core-version>
+ <jbosscache-core-version>3.2.1.BETA3-JBossAS</jbosscache-core-version>
<defaultTestGroup>functional,unit</defaultTestGroup>
<protocol.stack>tcp</protocol.stack>
</properties>
Modified: core/tags/3.2.1.BETA3/src/main/java/org/jboss/cache/Version.java
===================================================================
--- core/tags/3.2.1.BETA3/src/main/java/org/jboss/cache/Version.java 2009-09-17 15:14:44 UTC (rev 8234)
+++ core/tags/3.2.1.BETA3/src/main/java/org/jboss/cache/Version.java 2009-09-17 15:16:06 UTC (rev 8235)
@@ -32,10 +32,10 @@
@Immutable
public class Version
{
- public static final String version = "3.2.1-SNAPSHOT";
+ public static final String version = "3.2.1.BETA3";
public static final String codename = "Malagueta";
//public static final String cvs = "$Id$";
- static final byte[] version_id = {'0', '3', '2', '1', 'S'};
+ static final byte[] version_id = {'0','3','2','1','B','E','T','A','3'};
private static final int MAJOR_SHIFT = 11;
private static final int MINOR_SHIFT = 6;
13 years, 6 months