JBoss Cache SVN: r6740 - core/trunk/src/main/java/org/jboss/cache/marshall.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-16 14:04:06 -0400 (Tue, 16 Sep 2008)
New Revision: 6740
Modified:
core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java
Log:
Added empty ctor for testing
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java 2008-09-16 17:20:57 UTC (rev 6739)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/CommandAwareRpcDispatcher.java 2008-09-16 18:04:06 UTC (rev 6740)
@@ -37,6 +37,10 @@
protected ComponentRegistry componentRegistry;
protected boolean trace;
+ public CommandAwareRpcDispatcher()
+ {
+ }
+
public CommandAwareRpcDispatcher(Channel channel, MessageListener l, MembershipListener l2, Object serverObj,
InvocationContextContainer container, InterceptorChain interceptorChain,
ComponentRegistry componentRegistry)
17 years, 1 month
JBoss Cache SVN: r6739 - in core/branches/2.1.X/src: test/java/org/jboss/cache/transaction and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-09-16 13:20:57 -0400 (Tue, 16 Sep 2008)
New Revision: 6739
Added:
core/branches/2.1.X/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java
Modified:
core/branches/2.1.X/src/main/java/org/jboss/cache/CacheImpl.java
Log:
fixing https://jira.jboss.org/jira/browse/JBCACHE-1406
Modified: core/branches/2.1.X/src/main/java/org/jboss/cache/CacheImpl.java
===================================================================
--- core/branches/2.1.X/src/main/java/org/jboss/cache/CacheImpl.java 2008-09-16 16:58:18 UTC (rev 6738)
+++ core/branches/2.1.X/src/main/java/org/jboss/cache/CacheImpl.java 2008-09-16 17:20:57 UTC (rev 6739)
@@ -45,15 +45,7 @@
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.TransactionManager;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
/**
* The default implementation class of {@link org.jboss.cache.Cache} and {@link org.jboss.cache.CacheSPI}. This class
@@ -2226,7 +2218,7 @@
else
{
// mark the node to be removed (and all children) as invalid so anyone holding a direct reference to it will
- // be aware that it is no longer valid.
+ // be aware that it is no longer valid.
n.setValid(false, true);
return n.getParent().removeChildDirect(n.getFqn().getLastElement());
}
@@ -2234,7 +2226,16 @@
else
{
if (log.isDebugEnabled()) log.debug("Node " + f + " NOT marked for removal as expected, not removing!");
- return false;
+ //also check whether children are marked for deletion, JBCACHE-1406
+ Set<NodeSPI> children = n.getChildrenDirect(true);
+ if (children == null || children.size() == 0) {
+ return false;
+ }
+ for (NodeSPI aChild : children)
+ {
+ realRemove(aChild.getFqn(), skipMarkerCheck);
+ }
+ return true;
}
}
Added: core/branches/2.1.X/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java
===================================================================
--- core/branches/2.1.X/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java (rev 0)
+++ core/branches/2.1.X/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java 2008-09-16 17:20:57 UTC (rev 6739)
@@ -0,0 +1,163 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.cache.transaction;
+
+import javax.transaction.TransactionManager;
+import javax.transaction.Transaction;
+
+import org.jboss.cache.*;
+import org.jboss.cache.util.CachePrinter;
+import org.jboss.cache.config.Configuration;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.AfterMethod;
+import static org.testng.Assert.*;
+
+/**
+ * This is for checking issue: https://jira.jboss.org/jira/browse/JBCACHE-1406
+ * This is an issue portated from 1.4.x
+ * @author Mircea.Markus(a)jboss.com
+ */
+@Test (groups = "functional")
+public class RemoveOnTxTest
+{
+ private CacheSPI cache;
+
+ @BeforeMethod
+ protected void setUp() throws Exception
+ {
+ Configuration configuration = new Configuration();
+ configuration.setCacheMode(Configuration.CacheMode.LOCAL);
+ configuration.setTransactionManagerLookupClass("org.jboss.cache.transaction.GenericTransactionManagerLookup");
+ configuration.setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
+ cache = (CacheSPI) new DefaultCacheFactory().createCache(configuration);
+ }
+
+ @AfterMethod
+ protected void tearDown() throws Exception
+ {
+ cache.stop();
+ cache.destroy();
+ }
+
+ public void testFailure() throws Exception
+ {
+
+ TransactionManager tm = cache.getTransactionManager();
+ try
+ {
+ tm.begin();
+ print("put()");
+ cache.put("/a/b/c", "test", "test");
+ assertTrue(cache.get("/a/b/c", "test").equals("test"));
+ print("remove()");
+ cache.removeNode("/a/b");
+ assertTrue(!cache.exists("/a/b"));
+ assertTrue(!cache.exists("/a/b/c"));
+ cache.put("/a/b/d", "test1", "test1");
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ print("Exists? " + cache.exists("/a/b/c"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ tm.commit();
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c"), true, true) == null);
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ CachePrinter.printCacheLockingInfo(cache);
+ }
+ catch (Exception ex) {
+ tm.rollback();
+ throw ex;
+ }
+ CachePrinter.printCacheLockingInfo(cache);
+ System.out.println(" lock info " + CachePrinter.printCacheLockingInfo(cache));
+ try
+ {
+ tm.begin();
+ print(cache.exists("/a/b/c"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ Transaction t = tm.suspend();
+ try
+ {
+ cache.putForExternalRead(Fqn.fromString("/a/b/c"), "test", "test");
+ }
+ catch (Exception ignore) {
+ ignore.printStackTrace();
+ }
+ tm.resume(t);
+ print("get(): " + cache.get("/a/b/c", "test"));
+ print(cache.exists("/a/b/c"));
+ cache.put("/a/b/c", "test", "test");
+ print(cache.exists("/a/b/c"));
+ tm.commit();
+ }
+ catch (Exception ex) {
+ tm.rollback();
+ throw ex;
+ }
+ }
+
+ private void print(Object s)
+ {
+ System.out.println(s);
+ }
+
+ private void print(boolean s)
+ {
+ System.out.println(s);
+ }
+
+ public void testReal() throws Exception
+ {
+ TransactionManager tm = cache.getTransactionManager();
+ tm.begin();
+ print("put()");
+ cache.put("/a/b/c", "test", "test");
+ assertTrue(cache.get("/a/b/c", "test").equals("test"));
+ print("remove()");
+ cache.removeNode("/a/b");
+ assertTrue(!cache.exists("/a/b"));
+ assertTrue(!cache.exists("/a/b/c"));
+ cache.put("/a/b/d", "test1", "test1");
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ print("Exists? " + cache.exists("/a/b/c"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ tm.commit();
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ assertNull(cache.peek(Fqn.fromString("/a/b/c"), true, true));
+ }
+
+ public void testSimplified() throws Exception
+ {
+ TransactionManager tm = cache.getTransactionManager();
+ tm.begin();
+ print("put()");
+ cache.put("/a/b/c", "test", "test");
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c"), true, true) != null);
+ cache.removeNode("/a/b");
+ tm.commit();
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c"), true, true) == null);
+ }
+}
17 years, 1 month
JBoss Cache SVN: r6738 - core/branches/2.2.X/src/test/java/org/jboss/cache/transaction.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-09-16 12:58:18 -0400 (Tue, 16 Sep 2008)
New Revision: 6738
Added:
core/branches/2.2.X/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java
Log:
cannot reproduce https://jira.jboss.org/jira/browse/JBCACHE-1406 on 2.2.x
Added: core/branches/2.2.X/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java
===================================================================
--- core/branches/2.2.X/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java (rev 0)
+++ core/branches/2.2.X/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java 2008-09-16 16:58:18 UTC (rev 6738)
@@ -0,0 +1,168 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.cache.transaction;
+
+import javax.transaction.TransactionManager;
+import javax.transaction.Transaction;
+
+import org.jboss.cache.*;
+import org.jboss.cache.util.TestingUtil;
+import org.jboss.cache.config.Configuration;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.AfterMethod;
+import static org.testng.Assert.*;
+
+/**
+ * This is for checking issue: https://jira.jboss.org/jira/browse/JBCACHE-1406
+ * This was an issue on 1.4 but didn't reproduce on 2.2.x.
+ * Anyway, the tests is here just in case...
+ *
+ * @author Mircea.Markus(a)jboss.com
+ */
+@Test (groups = "functional")
+public class RemoveOnTxTest
+{
+ private CacheSPI cache;
+ private DataContainerImpl dataContainer;
+
+ @BeforeMethod
+ protected void setUp() throws Exception
+ {
+ Configuration configuration = new Configuration();
+ configuration.setCacheMode(Configuration.CacheMode.LOCAL);
+ configuration.setTransactionManagerLookupClass("org.jboss.cache.transaction.GenericTransactionManagerLookup");
+ configuration.setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
+ cache = (CacheSPI) new DefaultCacheFactory().createCache(configuration);
+ dataContainer = (DataContainerImpl) TestingUtil.extractComponentRegistry(cache).getComponent(DataContainer.class);
+ }
+
+ @AfterMethod
+ protected void tearDown() throws Exception
+ {
+ cache.stop();
+ cache.destroy();
+ }
+
+ public void testFailure() throws Exception
+ {
+
+ TransactionManager tm = cache.getTransactionManager();
+ try
+ {
+ tm.begin();
+ print("put()");
+ cache.put("/a/b/c", "test", "test");
+ assertTrue(cache.get("/a/b/c", "test").equals("test"));
+ print("remove()");
+ cache.removeNode("/a/b");
+ assertTrue(!cache.exists("/a/b"));
+ assertTrue(!cache.exists("/a/b/c"));
+ cache.put("/a/b/d", "test1", "test1");
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ print("Exists? " + cache.exists("/a/b/c"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ tm.commit();
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c"), true, true) == null);
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ dataContainer.printLockInfo();
+ }
+ catch (Exception ex) {
+ tm.rollback();
+ throw ex;
+ }
+ dataContainer.printLockInfo();
+ System.out.println(" lock info " + dataContainer.printLockInfo());
+ try
+ {
+ tm.begin();
+ print(cache.exists("/a/b/c"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ Transaction t = tm.suspend();
+ try
+ {
+ cache.putForExternalRead(Fqn.fromString("/a/b/c"), "test", "test");
+ }
+ catch (Exception ignore) {
+ ignore.printStackTrace();
+ }
+ tm.resume(t);
+ print("get(): " + cache.get("/a/b/c", "test"));
+ print(cache.exists("/a/b/c"));
+ cache.put("/a/b/c", "test", "test");
+ print(cache.exists("/a/b/c"));
+ tm.commit();
+ }
+ catch (Exception ex) {
+ tm.rollback();
+ throw ex;
+ }
+ }
+
+ private void print(Object s)
+ {
+ System.out.println(s);
+ }
+
+ private void print(boolean s)
+ {
+ System.out.println(s);
+ }
+
+ public void testReal() throws Exception
+ {
+ TransactionManager tm = cache.getTransactionManager();
+ tm.begin();
+ print("put()");
+ cache.put("/a/b/c", "test", "test");
+ assertTrue(cache.get("/a/b/c", "test").equals("test"));
+ print("remove()");
+ cache.removeNode("/a/b");
+ assertTrue(!cache.exists("/a/b"));
+ assertTrue(!cache.exists("/a/b/c"));
+ cache.put("/a/b/d", "test1", "test1");
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ print("Exists? " + cache.exists("/a/b/c"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ tm.commit();
+ assertNull(cache.peek(Fqn.fromString("/a/b/c"), true, true));
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ dataContainer.printLockInfo();
+ }
+
+ public void testSimplified() throws Exception
+ {
+ TransactionManager tm = cache.getTransactionManager();
+ tm.begin();
+ print("put()");
+ cache.put("/a/b/c", "test", "test");
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c"), true, true) != null);
+ cache.removeNode("/a/b");
+ tm.commit();
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c"), true, true) == null);
+ }
+}
17 years, 1 month
JBoss Cache SVN: r6737 - core/trunk/src/test/java/org/jboss/cache/transaction.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-09-16 12:47:29 -0400 (Tue, 16 Sep 2008)
New Revision: 6737
Added:
core/trunk/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java
Log:
cannot reproduce https://jira.jboss.org/jira/browse/JBCACHE-1406 on 3.x
Added: core/trunk/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/transaction/RemoveOnTxTest.java 2008-09-16 16:47:29 UTC (rev 6737)
@@ -0,0 +1,167 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.cache.transaction;
+
+import javax.transaction.TransactionManager;
+import javax.transaction.Transaction;
+
+import org.jboss.cache.*;
+import org.jboss.cache.config.Configuration;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.AfterMethod;
+import static org.testng.Assert.*;
+
+/**
+ * This is for checking issue: https://jira.jboss.org/jira/browse/JBCACHE-1406
+ * This was an issue on 1.4 and 2.x, but didn't reproduce on 3.x.
+ * Anyway, the tests is here just in case...
+ *
+ * @author Mircea.Markus(a)jboss.com
+ */
+@Test (groups = "functional")
+public class RemoveOnTxTest
+{
+ private CacheSPI cache;
+ private DataContainerImpl dataContainer;
+
+ @BeforeMethod
+ protected void setUp() throws Exception
+ {
+ Configuration configuration = new Configuration();
+ configuration.setCacheMode(Configuration.CacheMode.LOCAL);
+ configuration.setTransactionManagerLookupClass("org.jboss.cache.transaction.GenericTransactionManagerLookup");
+ configuration.setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
+ cache = (CacheSPI) new DefaultCacheFactory().createCache(configuration);
+ dataContainer = (DataContainerImpl) cache.getComponentRegistry().getComponent(DataContainer.class);
+ }
+
+ @AfterMethod
+ protected void tearDown() throws Exception
+ {
+ cache.stop();
+ cache.destroy();
+ }
+
+ public void testFailure() throws Exception
+ {
+
+ TransactionManager tm = cache.getTransactionManager();
+ try
+ {
+ tm.begin();
+ print("put()");
+ cache.put("/a/b/c", "test", "test");
+ assertTrue(cache.get("/a/b/c", "test").equals("test"));
+ print("remove()");
+ cache.removeNode("/a/b");
+ assertTrue(!cache.exists("/a/b"));
+ assertTrue(!cache.exists("/a/b/c"));
+ cache.put("/a/b/d", "test1", "test1");
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ print("Exists? " + cache.exists("/a/b/c"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ tm.commit();
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c"), true, true) == null);
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ dataContainer.printLockInfo();
+ }
+ catch (Exception ex) {
+ tm.rollback();
+ throw ex;
+ }
+ dataContainer.printLockInfo();
+ System.out.println(" lock info " + dataContainer.printLockInfo());
+ try
+ {
+ tm.begin();
+ print(cache.exists("/a/b/c"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ Transaction t = tm.suspend();
+ try
+ {
+ cache.putForExternalRead(Fqn.fromString("/a/b/c"), "test", "test");
+ }
+ catch (Exception ignore) {
+ ignore.printStackTrace();
+ }
+ tm.resume(t);
+ print("get(): " + cache.get("/a/b/c", "test"));
+ print(cache.exists("/a/b/c"));
+ cache.put("/a/b/c", "test", "test");
+ print(cache.exists("/a/b/c"));
+ tm.commit();
+ }
+ catch (Exception ex) {
+ tm.rollback();
+ throw ex;
+ }
+ }
+
+ private void print(Object s)
+ {
+ System.out.println(s);
+ }
+
+ private void print(boolean s)
+ {
+ System.out.println(s);
+ }
+
+ public void testReal() throws Exception
+ {
+ TransactionManager tm = cache.getTransactionManager();
+ tm.begin();
+ print("put()");
+ cache.put("/a/b/c", "test", "test");
+ assertTrue(cache.get("/a/b/c", "test").equals("test"));
+ print("remove()");
+ cache.removeNode("/a/b");
+ assertTrue(!cache.exists("/a/b"));
+ assertTrue(!cache.exists("/a/b/c"));
+ cache.put("/a/b/d", "test1", "test1");
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ print("Exists? " + cache.exists("/a/b/c"));
+ print("get(): " + cache.get("/a/b/c", "test"));
+ tm.commit();
+ assertNull(cache.peek(Fqn.fromString("/a/b/c"), true, true));
+ assertTrue(!cache.exists("/a/b/c"));
+ assertTrue(cache.exists("/a/b/d"));
+ dataContainer.printLockInfo();
+ }
+
+ public void testSimplified() throws Exception
+ {
+ TransactionManager tm = cache.getTransactionManager();
+ tm.begin();
+ print("put()");
+ cache.put("/a/b/c", "test", "test");
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c"), true, true) != null);
+ cache.removeNode("/a/b");
+ tm.commit();
+ assertTrue(cache.peek(Fqn.fromString("/a/b/c"), true, true) == null);
+ }
+}
17 years, 1 month
JBoss Cache SVN: r6736 - in core/trunk/src/main/java/org/jboss/cache: marshall and 1 other directory.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-16 12:39:12 -0400 (Tue, 16 Sep 2008)
New Revision: 6736
Modified:
core/trunk/src/main/java/org/jboss/cache/io/ExposedByteArrayOutputStream.java
core/trunk/src/main/java/org/jboss/cache/marshall/VersionAwareMarshaller.java
Log:
marshalling enhancements
Modified: core/trunk/src/main/java/org/jboss/cache/io/ExposedByteArrayOutputStream.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/io/ExposedByteArrayOutputStream.java 2008-09-16 16:06:40 UTC (rev 6735)
+++ core/trunk/src/main/java/org/jboss/cache/io/ExposedByteArrayOutputStream.java 2008-09-16 16:39:12 UTC (rev 6736)
@@ -75,7 +75,7 @@
* will almost certainly be longer than the data written to it; call
* <code>size()</code> to get the number of bytes of actual data.
*/
- public byte[] getRawBuffer()
+ public final byte[] getRawBuffer()
{
return buf;
}
@@ -123,7 +123,7 @@
* Gets the highest internal buffer size after which if more capacity
* is needed the buffer will grow in 25% increments rather than 100%.
*/
- public int getMaxDoublingSize()
+ public final int getMaxDoublingSize()
{
return maxDoublingSize;
}
@@ -135,7 +135,7 @@
* @param minNewSize the minimum number of bytes required
* @return the size to which the internal buffer should be resized
*/
- public int getNewBufferSize(int curSize, int minNewSize)
+ public final int getNewBufferSize(int curSize, int minNewSize)
{
if (curSize <= maxDoublingSize)
return Math.max(curSize << 1, minNewSize);
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/VersionAwareMarshaller.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/VersionAwareMarshaller.java 2008-09-16 16:06:40 UTC (rev 6735)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/VersionAwareMarshaller.java 2008-09-16 16:39:12 UTC (rev 6736)
@@ -154,7 +154,7 @@
@Override
public ByteBuffer objectToBuffer(Object obj) throws Exception
{
- ExposedByteArrayOutputStream baos = new ExposedByteArrayOutputStream();
+ ExposedByteArrayOutputStream baos = new ExposedByteArrayOutputStream(128);
ObjectOutputStream out = new ObjectOutputStream(baos);
out.writeShort(versionInt);
@@ -165,7 +165,7 @@
out.close();
// and return bytes.
- return new ByteBuffer(baos.toByteArray(), 0, baos.size());
+ return new ByteBuffer(baos.getRawBuffer(), 0, baos.size());
}
@Override
17 years, 1 month
JBoss Cache SVN: r6735 - core/trunk/src/main/java/org/jboss/cache/config/parsing.
by jbosscache-commits@lists.jboss.org
Author: mircea.markus
Date: 2008-09-16 12:06:40 -0400 (Tue, 16 Sep 2008)
New Revision: 6735
Modified:
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
Log:
removed unuded code
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java 2008-09-16 12:59:11 UTC (rev 6734)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser.java 2008-09-16 16:06:40 UTC (rev 6735)
@@ -402,31 +402,4 @@
NodeList elements = element.getElementsByTagName("jbosscache");
return elements != null && elements.getLength() > 0;
}
-
- /**
- * Default schema validation error handler, that throws an exception on validation errors.
- */
- private static class FailureErrorHandler implements ErrorHandler
- {
- public void warning(SAXParseException exception) throws SAXException
- {
- logAndThrowException(exception);
- }
-
- public void error(SAXParseException exception) throws SAXException
- {
- logAndThrowException(exception);
- }
-
- public void fatalError(SAXParseException exception) throws SAXException
- {
- logAndThrowException(exception);
- }
-
- private void logAndThrowException(SAXParseException exception)
- {
- log.error("Configuration warning: " + exception.getMessage());
- throw new ConfigurationException("Incorrect configuration file. Use '-Djbosscache.config.validate=false' to disable validation.", exception);
- }
- }
}
17 years, 1 month
JBoss Cache SVN: r6734 - core/branches/2.2.X/src/test/java/org/jboss/cache/profiling.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-16 08:59:11 -0400 (Tue, 16 Sep 2008)
New Revision: 6734
Modified:
core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/AbstractProfileTest.java
core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java
core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/ProfileTest.java
Log:
Updated tests
Modified: core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/AbstractProfileTest.java
===================================================================
--- core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/AbstractProfileTest.java 2008-09-16 12:14:36 UTC (rev 6733)
+++ core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/AbstractProfileTest.java 2008-09-16 12:59:11 UTC (rev 6734)
@@ -54,21 +54,39 @@
public Element getJGroupsConfig() throws Exception
{
- String udp = "<jgroupsConfig>\n" +
- " <UDP discard_incompatible_packets=\"true\" enable_bundling=\"true\" enable_diagnostics=\"false\" ip_ttl=\"2\"\n" +
- " loopback=\"false\" max_bundle_size=\"64000\" max_bundle_timeout=\"30\" mcast_addr=\"228.10.10.10\"\n" +
- " mcast_port=\"45588\" mcast_recv_buf_size=\"100000000\" mcast_send_buf_size=\"640000\"\n" +
- " oob_thread_pool.enabled=\"true\" oob_thread_pool.keep_alive_time=\"10000\" oob_thread_pool.max_threads=\"20\"\n" +
- " oob_thread_pool.min_threads=\"8\" oob_thread_pool.queue_enabled=\"false\" oob_thread_pool.queue_max_size=\"10\"\n" +
- " oob_thread_pool.rejection_policy=\"Run\" thread_naming_pattern=\"pl\" thread_pool.enabled=\"true\"\n" +
- " thread_pool.keep_alive_time=\"10000\" thread_pool.max_threads=\"30\" thread_pool.min_threads=\"8\"\n" +
- " thread_pool.queue_enabled=\"false\" thread_pool.queue_max_size=\"10\" thread_pool.rejection_policy=\"Run\"\n" +
- " tos=\"8\" ucast_recv_buf_size=\"20000000\" ucast_send_buf_size=\"640000\" use_concurrent_stack=\"true\"\n" +
- " use_incoming_packet_handler=\"true\"/>\n" +
+ String udp = " <jgroupsConfig>\n" +
+ " <UDP discard_incompatible_packets=\"true\" \n" +
+ " enable_bundling=\"true\" \n" +
+ " enable_diagnostics=\"false\" \n" +
+ " ip_ttl=\"2\"\n" +
+ " loopback=\"true\" \n" +
+ " max_bundle_size=\"64000\" \n" +
+ " max_bundle_timeout=\"30\" \n" +
+ " mcast_addr=\"228.10.10.10\"\n" +
+ " mcast_port=\"45588\" \n" +
+ " mcast_recv_buf_size=\"100000000\" \n" +
+ " mcast_send_buf_size=\"640000\"\n" +
+ " oob_thread_pool.enabled=\"true\" \n" +
+ " oob_thread_pool.keep_alive_time=\"10000\" \n" +
+ " oob_thread_pool.max_threads=\"20\"\n" +
+ " oob_thread_pool.min_threads=\"8\" \n" +
+ " oob_thread_pool.queue_enabled=\"false\"\n" +
+ " oob_thread_pool.rejection_policy=\"Run\" \n" +
+ " thread_naming_pattern=\"pl\" \n" +
+ " thread_pool.enabled=\"true\"\n" +
+ " thread_pool.keep_alive_time=\"10000\" \n" +
+ " thread_pool.max_threads=\"2\" \n" +
+ " thread_pool.min_threads=\"1\"\n" +
+ " thread_pool.queue_enabled=\"true\" \n" +
+ " thread_pool.queue_max_size=\"1000000\" \n" +
+ " thread_pool.rejection_policy=\"discard\"\n" +
+ " tos=\"8\" ucast_recv_buf_size=\"20000000\" \n" +
+ " ucast_send_buf_size=\"640000\" \n" +
+ " use_concurrent_stack=\"true\"/>\n" +
" <PING num_initial_members=\"3\" timeout=\"2000\"/>\n" +
" <MERGE2 max_interval=\"30000\" min_interval=\"10000\"/>\n" +
" <FD_SOCK/>\n" +
- " <FD max_tries=\"5\" shun=\"true\" timeout=\"10000\"/>\n" +
+ " <!--FD max_tries=\"5\" shun=\"true\" timeout=\"10000\"/-->\n" +
" <VERIFY_SUSPECT timeout=\"1500\"/>\n" +
" <pbcast.NAKACK discard_delivered_msgs=\"true\" gc_lag=\"0\" retransmit_timeout=\"300,600,1200,2400,4800\"\n" +
" use_mcast_xmit=\"false\"/>\n" +
@@ -76,7 +94,8 @@
" <pbcast.STABLE desired_avg_gossip=\"50000\" max_bytes=\"400000\" stability_delay=\"1000\"/>\n" +
" <pbcast.GMS join_timeout=\"5000\" print_local_addr=\"true\" shun=\"false\" view_ack_collection_timeout=\"5000\"\n" +
" view_bundling=\"true\"/>\n" +
- " <FC max_credits=\"500000\" min_threshold=\"0.2\"/>\n" +
+ " <FC max_credits=\"500000\" min_threshold=\"0.2\"\n" +
+ " max_block_time=\"20000\" />\n" +
" <FRAG2 frag_size=\"60000\"/>\n" +
" <pbcast.STREAMING_STATE_TRANSFER use_reading_thread=\"true\"/>\n" +
" <pbcast.FLUSH timeout=\"0\"/>\n" +
Modified: core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java
===================================================================
--- core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java 2008-09-16 12:14:36 UTC (rev 6733)
+++ core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java 2008-09-16 12:59:11 UTC (rev 6734)
@@ -2,6 +2,7 @@
import org.jboss.cache.config.BuddyReplicationConfig;
import org.jboss.cache.config.Configuration;
+import org.jboss.cache.lock.IsolationLevel;
import org.jboss.cache.transaction.DummyTransactionManagerLookup;
import org.testng.annotations.Test;
@@ -75,6 +76,8 @@
brc.setEnabled(true);
cache.getConfiguration().setBuddyReplicationConfig(brc);
cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+// cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
testReplAsync();
}
Modified: core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/ProfileTest.java
===================================================================
--- core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/ProfileTest.java 2008-09-16 12:14:36 UTC (rev 6733)
+++ core/branches/2.2.X/src/test/java/org/jboss/cache/profiling/ProfileTest.java 2008-09-16 12:59:11 UTC (rev 6734)
@@ -37,14 +37,17 @@
/*
Test configuration options
*/
- protected static final long NUM_OPERATIONS = 500000; // DURATION is replaced with a fixed number of operations instead.
- protected static final int NUM_THREADS = 15;
+ protected static final long NUM_OPERATIONS = 1000000; // DURATION is replaced with a fixed number of operations instead.
+ protected static final int NUM_THREADS = 1;
protected static final int MAX_RANDOM_SLEEP_MILLIS = 1;
protected static final int MAX_DEPTH = 3;
protected static final int MAX_OVERALL_NODES = 200;
protected static final int WARMUP_LOOPS = 20000;
protected static final boolean USE_SLEEP = false; // throttle generation a bit
+ protected static final Fqn BELAS_FQN = Fqn.fromString("/a/b/c");
+ protected static final String BELAS_KEY = "bela";
+
private List<Fqn> fqns = new ArrayList<Fqn>(MAX_OVERALL_NODES);
private Random r = new Random();
@@ -116,6 +119,8 @@
brc.setEnabled(true);
cache.getConfiguration().setBuddyReplicationConfig(brc);
cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.PESSIMISTIC);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+// cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
testReplAsync();
}
@@ -240,9 +245,11 @@
private void doTest() throws Exception
{
ExecutorService exec = Executors.newFixedThreadPool(NUM_THREADS);
+ // Executor exec = new DirectExecutor();
long startTime = System.currentTimeMillis();
log.warn("Starting test");
int i;
+ long print = NUM_OPERATIONS / 10;
for (i = 0; i < NUM_OPERATIONS; i++)
{
MyRunnable r = null;
@@ -258,6 +265,8 @@
r = new Remover(i);
break;
}
+ if (i % print == 0)
+ log.warn("processing iteration " + i);
exec.execute(r);
// if (USE_SLEEP) TestingUtil.sleepRandom(MAX_RANDOM_SLEEP_MILLIS);
if (USE_SLEEP) TestingUtil.sleepThread(MAX_RANDOM_SLEEP_MILLIS);
@@ -281,20 +290,23 @@
int id;
Mode mode;
+
public void run()
{
- if (id % 100 == 0) log.warn("Processing iteration " + id);
String k = getRandomString();
Fqn f = fqns.get(r.nextInt(MAX_OVERALL_NODES));
switch (mode)
{
case PUT:
cache.put(f, k, getRandomString());
+ // cache.put(BELAS_FQN, BELAS_KEY, new byte[10000]);
break;
case GET:
+ // cache.get(BELAS_FQN, BELAS_KEY);
cache.get(f, k);
break;
case REMOVE:
+ // cache.remove(BELAS_FQN, BELAS_KEY);
cache.remove(f, k);
break;
}
17 years, 1 month
JBoss Cache SVN: r6733 - core/trunk/src/test/java/org/jboss/cache/profiling.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-16 08:14:36 -0400 (Tue, 16 Sep 2008)
New Revision: 6733
Modified:
core/trunk/src/test/java/org/jboss/cache/profiling/AbstractProfileTest.java
core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java
core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java
Log:
Updated tests
Modified: core/trunk/src/test/java/org/jboss/cache/profiling/AbstractProfileTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/profiling/AbstractProfileTest.java 2008-09-16 10:28:05 UTC (rev 6732)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/AbstractProfileTest.java 2008-09-16 12:14:36 UTC (rev 6733)
@@ -54,21 +54,39 @@
public String getJGroupsConfig() throws Exception
{
- String udp = "<jgroupsConfig>\n" +
- " <UDP discard_incompatible_packets=\"true\" enable_bundling=\"true\" enable_diagnostics=\"false\" ip_ttl=\"2\"\n" +
- " loopback=\"false\" max_bundle_size=\"64000\" max_bundle_timeout=\"30\" mcast_addr=\"228.10.10.10\"\n" +
- " mcast_port=\"45588\" mcast_recv_buf_size=\"100000000\" mcast_send_buf_size=\"640000\"\n" +
- " oob_thread_pool.enabled=\"true\" oob_thread_pool.keep_alive_time=\"10000\" oob_thread_pool.max_threads=\"20\"\n" +
- " oob_thread_pool.min_threads=\"8\" oob_thread_pool.queue_enabled=\"false\" oob_thread_pool.queue_max_size=\"10\"\n" +
- " oob_thread_pool.rejection_policy=\"Run\" thread_naming_pattern=\"pl\" thread_pool.enabled=\"true\"\n" +
- " thread_pool.keep_alive_time=\"10000\" thread_pool.max_threads=\"30\" thread_pool.min_threads=\"8\"\n" +
- " thread_pool.queue_enabled=\"false\" thread_pool.queue_max_size=\"10\" thread_pool.rejection_policy=\"Run\"\n" +
- " tos=\"8\" ucast_recv_buf_size=\"20000000\" ucast_send_buf_size=\"640000\" use_concurrent_stack=\"true\"\n" +
- " use_incoming_packet_handler=\"true\"/>\n" +
+ String udp = " <jgroupsConfig>\n" +
+ " <UDP discard_incompatible_packets=\"true\" \n" +
+ " enable_bundling=\"true\" \n" +
+ " enable_diagnostics=\"false\" \n" +
+ " ip_ttl=\"2\"\n" +
+ " loopback=\"true\" \n" +
+ " max_bundle_size=\"64000\" \n" +
+ " max_bundle_timeout=\"30\" \n" +
+ " mcast_addr=\"228.10.10.10\"\n" +
+ " mcast_port=\"45588\" \n" +
+ " mcast_recv_buf_size=\"100000000\" \n" +
+ " mcast_send_buf_size=\"640000\"\n" +
+ " oob_thread_pool.enabled=\"true\" \n" +
+ " oob_thread_pool.keep_alive_time=\"10000\" \n" +
+ " oob_thread_pool.max_threads=\"20\"\n" +
+ " oob_thread_pool.min_threads=\"8\" \n" +
+ " oob_thread_pool.queue_enabled=\"false\"\n" +
+ " oob_thread_pool.rejection_policy=\"Run\" \n" +
+ " thread_naming_pattern=\"pl\" \n" +
+ " thread_pool.enabled=\"true\"\n" +
+ " thread_pool.keep_alive_time=\"10000\" \n" +
+ " thread_pool.max_threads=\"2\" \n" +
+ " thread_pool.min_threads=\"1\"\n" +
+ " thread_pool.queue_enabled=\"true\" \n" +
+ " thread_pool.queue_max_size=\"1000000\" \n" +
+ " thread_pool.rejection_policy=\"discard\"\n" +
+ " tos=\"8\" ucast_recv_buf_size=\"20000000\" \n" +
+ " ucast_send_buf_size=\"640000\" \n" +
+ " use_concurrent_stack=\"true\"/>\n" +
" <PING num_initial_members=\"3\" timeout=\"2000\"/>\n" +
" <MERGE2 max_interval=\"30000\" min_interval=\"10000\"/>\n" +
" <FD_SOCK/>\n" +
- " <FD max_tries=\"5\" shun=\"true\" timeout=\"10000\"/>\n" +
+ " <!--FD max_tries=\"5\" shun=\"true\" timeout=\"10000\"/-->\n" +
" <VERIFY_SUSPECT timeout=\"1500\"/>\n" +
" <pbcast.NAKACK discard_delivered_msgs=\"true\" gc_lag=\"0\" retransmit_timeout=\"300,600,1200,2400,4800\"\n" +
" use_mcast_xmit=\"false\"/>\n" +
@@ -76,7 +94,8 @@
" <pbcast.STABLE desired_avg_gossip=\"50000\" max_bytes=\"400000\" stability_delay=\"1000\"/>\n" +
" <pbcast.GMS join_timeout=\"5000\" print_local_addr=\"true\" shun=\"false\" view_ack_collection_timeout=\"5000\"\n" +
" view_bundling=\"true\"/>\n" +
- " <FC max_credits=\"500000\" min_threshold=\"0.2\"/>\n" +
+ " <FC max_credits=\"500000\" min_threshold=\"0.2\"\n" +
+ " max_block_time=\"20000\" />\n" +
" <FRAG2 frag_size=\"60000\"/>\n" +
" <pbcast.STREAMING_STATE_TRANSFER use_reading_thread=\"true\"/>\n" +
" <pbcast.FLUSH timeout=\"0\"/>\n" +
Modified: core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java 2008-09-16 10:28:05 UTC (rev 6732)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java 2008-09-16 12:14:36 UTC (rev 6733)
@@ -37,9 +37,7 @@
cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_ASYNC);
cache.getConfiguration().setConcurrencyLevel(500);
-// cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
cache.getConfiguration().setClusterConfig(getJGroupsConfig());
- cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
cache.start();
waitForTest();
}
@@ -80,8 +78,8 @@
cache.getConfiguration().setBuddyReplicationConfig(brc);
cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
cache.getConfiguration().setConcurrencyLevel(500);
-// cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
- cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+// cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
testReplAsync();
}
Modified: core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java 2008-09-16 10:28:05 UTC (rev 6732)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java 2008-09-16 12:14:36 UTC (rev 6733)
@@ -37,14 +37,17 @@
/*
Test configuration options
*/
- protected static final long NUM_OPERATIONS = 500000; // DURATION is replaced with a fixed number of operations instead.
- protected static final int NUM_THREADS = 15;
+ protected static final long NUM_OPERATIONS = 1000000; // DURATION is replaced with a fixed number of operations instead.
+ protected static final int NUM_THREADS = 1;
protected static final int MAX_RANDOM_SLEEP_MILLIS = 1;
protected static final int MAX_DEPTH = 3;
protected static final int MAX_OVERALL_NODES = 200;
protected static final int WARMUP_LOOPS = 20000;
protected static final boolean USE_SLEEP = false; // throttle generation a bit
+ protected static final Fqn BELAS_FQN = Fqn.fromString("/a/b/c");
+ protected static final String BELAS_KEY = "bela";
+
private List<Fqn> fqns = new ArrayList<Fqn>(MAX_OVERALL_NODES);
private Random r = new Random();
@@ -56,8 +59,7 @@
cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
cache.getConfiguration().setConcurrencyLevel(500);
- cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
-// cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
runCompleteTest();
}
@@ -82,9 +84,7 @@
cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_ASYNC);
cache.getConfiguration().setConcurrencyLevel(500);
-// cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
cache.getConfiguration().setClusterConfig(getJGroupsConfig());
- cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
runCompleteTest();
}
@@ -248,9 +248,11 @@
private void doTest() throws Exception
{
ExecutorService exec = Executors.newFixedThreadPool(NUM_THREADS);
+ // Executor exec = new DirectExecutor();
long startTime = System.currentTimeMillis();
log.warn("Starting test");
int i;
+ long print = NUM_OPERATIONS / 10;
for (i = 0; i < NUM_OPERATIONS; i++)
{
MyRunnable r = null;
@@ -266,6 +268,8 @@
r = new Remover(i);
break;
}
+ if (i % print == 0)
+ log.warn("processing iteration " + i);
exec.execute(r);
// if (USE_SLEEP) TestingUtil.sleepRandom(MAX_RANDOM_SLEEP_MILLIS);
if (USE_SLEEP) TestingUtil.sleepThread(MAX_RANDOM_SLEEP_MILLIS);
@@ -289,20 +293,23 @@
int id;
Mode mode;
+
public void run()
{
- if (id % 100 == 0) log.warn("Processing iteration " + id);
String k = getRandomString();
Fqn f = fqns.get(r.nextInt(MAX_OVERALL_NODES));
switch (mode)
{
case PUT:
cache.put(f, k, getRandomString());
+ // cache.put(BELAS_FQN, BELAS_KEY, new byte[10000]);
break;
case GET:
+ // cache.get(BELAS_FQN, BELAS_KEY);
cache.get(f, k);
break;
case REMOVE:
+ // cache.remove(BELAS_FQN, BELAS_KEY);
cache.remove(f, k);
break;
}
17 years, 1 month
JBoss Cache SVN: r6732 - core/trunk/src/test/java/org/jboss/cache/profiling.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-16 06:28:05 -0400 (Tue, 16 Sep 2008)
New Revision: 6732
Modified:
core/trunk/src/test/java/org/jboss/cache/profiling/AbstractProfileTest.java
core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java
core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java
Log:
Updated tests
Modified: core/trunk/src/test/java/org/jboss/cache/profiling/AbstractProfileTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/profiling/AbstractProfileTest.java 2008-09-16 10:19:33 UTC (rev 6731)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/AbstractProfileTest.java 2008-09-16 10:28:05 UTC (rev 6732)
@@ -108,6 +108,6 @@
" <pbcast.FLUSH timeout=\"0\"/>\n" +
" </jgroupsConfig>";
- return new JGroupsStackParser().parseClusterConfigXml(XmlConfigHelper.stringToElement(tcp));
+ return new JGroupsStackParser().parseClusterConfigXml(XmlConfigHelper.stringToElement(udp));
}
}
Modified: core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java 2008-09-16 10:19:33 UTC (rev 6731)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/ProfileSlaveTest.java 2008-09-16 10:28:05 UTC (rev 6732)
@@ -37,9 +37,9 @@
cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_ASYNC);
cache.getConfiguration().setConcurrencyLevel(500);
- cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+// cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
cache.getConfiguration().setClusterConfig(getJGroupsConfig());
-// cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
cache.start();
waitForTest();
}
@@ -80,8 +80,8 @@
cache.getConfiguration().setBuddyReplicationConfig(brc);
cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
cache.getConfiguration().setConcurrencyLevel(500);
- cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
-// cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+// cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
testReplAsync();
}
Modified: core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java 2008-09-16 10:19:33 UTC (rev 6731)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/ProfileTest.java 2008-09-16 10:28:05 UTC (rev 6732)
@@ -37,7 +37,7 @@
/*
Test configuration options
*/
- protected static final long NUM_OPERATIONS = 1000000; // DURATION is replaced with a fixed number of operations instead.
+ protected static final long NUM_OPERATIONS = 500000; // DURATION is replaced with a fixed number of operations instead.
protected static final int NUM_THREADS = 15;
protected static final int MAX_RANDOM_SLEEP_MILLIS = 1;
protected static final int MAX_DEPTH = 3;
@@ -56,8 +56,8 @@
cache.getConfiguration().setCacheMode(Configuration.CacheMode.LOCAL);
cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
cache.getConfiguration().setConcurrencyLevel(500);
-// cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
- cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+// cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
runCompleteTest();
}
@@ -82,9 +82,9 @@
cache.getConfiguration().setNodeLockingScheme(Configuration.NodeLockingScheme.MVCC);
cache.getConfiguration().setCacheMode(Configuration.CacheMode.REPL_ASYNC);
cache.getConfiguration().setConcurrencyLevel(500);
- cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
+// cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMITTED);
cache.getConfiguration().setClusterConfig(getJGroupsConfig());
-// cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE_READ);
runCompleteTest();
}
17 years, 1 month
JBoss Cache SVN: r6731 - core/branches/2.2.X.
by jbosscache-commits@lists.jboss.org
Author: manik.surtani(a)jboss.com
Date: 2008-09-16 06:19:33 -0400 (Tue, 16 Sep 2008)
New Revision: 6731
Modified:
core/branches/2.2.X/pom.xml
Log:
UPdated JGroups
Modified: core/branches/2.2.X/pom.xml
===================================================================
--- core/branches/2.2.X/pom.xml 2008-09-16 10:13:30 UTC (rev 6730)
+++ core/branches/2.2.X/pom.xml 2008-09-16 10:19:33 UTC (rev 6731)
@@ -27,7 +27,7 @@
<dependency>
<groupId>jgroups</groupId>
<artifactId>jgroups</artifactId>
- <version>2.6.2</version>
+ <version>2.6.3.GA</version>
</dependency>
<!-- For the JTA 1.1 API; consuming projects can safely
17 years, 1 month