From jbosscache-commits at lists.jboss.org Fri Aug 1 04:39:16 2008
Content-Type: multipart/mixed; boundary="===============4702771323880925918=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6477 -
core/trunk/src/main/java/org/jboss/cache/commands.
Date: Fri, 01 Aug 2008 04:39:16 -0400
Message-ID:
--===============4702771323880925918==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-01 04:39:15 -0400 (Fri, 01 Aug 2008)
New Revision: 6477
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/OptimisticCommandsFact=
oryImpl.java
core/trunk/src/main/java/org/jboss/cache/commands/PessimisticCommandsFac=
toryImpl.java
Log:
added createNodeCommand for opt locking
deprecated opt commands factory
Modified: core/trunk/src/main/java/org/jboss/cache/commands/OptimisticComma=
ndsFactoryImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/commands/OptimisticCommandsFac=
toryImpl.java 2008-07-31 18:08:14 UTC (rev 6476)
+++ core/trunk/src/main/java/org/jboss/cache/commands/OptimisticCommandsFac=
toryImpl.java 2008-08-01 08:39:15 UTC (rev 6477)
@@ -2,6 +2,7 @@
=
import org.jboss.cache.Fqn;
import org.jboss.cache.commands.legacy.read.LegacyGravitateDataCommand;
+import org.jboss.cache.commands.legacy.write.CreateNodeCommand;
import org.jboss.cache.commands.legacy.write.LegacyEvictCommand;
import org.jboss.cache.commands.legacy.write.VersionedInvalidateCommand;
import org.jboss.cache.commands.read.GravitateDataCommand;
@@ -13,7 +14,10 @@
*
* @author Manik Surtani (manik(a)jbo=
ss.org)
* @since 3.0
+ * @deprecated will be removed with opt locking
*/
+(a)Deprecated
+(a)SuppressWarnings("deprecation")
public class OptimisticCommandsFactoryImpl extends CommandsFactoryImpl
{
@Override
@@ -42,12 +46,28 @@
}
=
@Override
+ public CreateNodeCommand buildCreateNodeCommand(Fqn fqn)
+ {
+ CreateNodeCommand command =3D new CreateNodeCommand(fqn);
+ command.initialize(dataContainer);
+ return command;
+ }
+
+
+ @Override
public ReplicableCommand fromStream(int id, Object[] parameters)
{
ReplicableCommand command;
boolean skipSetParams =3D false;
switch (id)
{
+ case CreateNodeCommand.METHOD_ID:
+ {
+ CreateNodeCommand returnValue =3D new CreateNodeCommand(null);
+ returnValue.initialize(dataContainer);
+ command =3D returnValue;
+ break;
+ }
case GravitateDataCommand.METHOD_ID:
{
LegacyGravitateDataCommand returnValue =3D new LegacyGravitate=
DataCommand(rpcManager.getLocalAddress());
Modified: core/trunk/src/main/java/org/jboss/cache/commands/PessimisticComm=
andsFactoryImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/commands/PessimisticCommandsFa=
ctoryImpl.java 2008-07-31 18:08:14 UTC (rev 6476)
+++ core/trunk/src/main/java/org/jboss/cache/commands/PessimisticCommandsFa=
ctoryImpl.java 2008-08-01 08:39:15 UTC (rev 6477)
@@ -2,7 +2,6 @@
=
import org.jboss.cache.Fqn;
import org.jboss.cache.commands.legacy.read.PessGetChildrenNamesCommand;
-import org.jboss.cache.commands.legacy.write.CreateNodeCommand;
import org.jboss.cache.commands.legacy.write.PessClearDataCommand;
import org.jboss.cache.commands.legacy.write.PessMoveCommand;
import org.jboss.cache.commands.legacy.write.PessPutDataMapCommand;
@@ -30,7 +29,10 @@
* @author Manik Surtani (manik(a)jbo=
ss.org)
* @see org.jboss.cache.commands.legacy.ReversibleCommand
* @since 3.0
+ * @deprecated will be removed with possimistic locking
*/
+(a)Deprecated
+(a)SuppressWarnings("deprecation")
public class PessimisticCommandsFactoryImpl extends OptimisticCommandsFact=
oryImpl
{
@Override
@@ -98,14 +100,6 @@
}
=
@Override
- public CreateNodeCommand buildCreateNodeCommand(Fqn fqn)
- {
- CreateNodeCommand command =3D new CreateNodeCommand(fqn);
- command.initialize(dataContainer);
- return command;
- }
-
- @Override
public InvalidateCommand buildInvalidateCommand(Fqn fqn)
{
InvalidateCommand command =3D new InvalidateCommand(fqn);
@@ -185,13 +179,6 @@
command =3D returnValue;
break;
}
- case CreateNodeCommand.METHOD_ID:
- {
- CreateNodeCommand returnValue =3D new CreateNodeCommand(null);
- returnValue.initialize(dataContainer);
- command =3D returnValue;
- break;
- }
case InvalidateCommand.METHOD_ID:
{
InvalidateCommand returnValue =3D new InvalidateCommand(null);
--===============4702771323880925918==--
From jbosscache-commits at lists.jboss.org Fri Aug 1 05:04:42 2008
Content-Type: multipart/mixed; boundary="===============7949973549912777162=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6478 -
core/trunk/src/test/java/org/jboss/cache/profiling.
Date: Fri, 01 Aug 2008 05:04:40 -0400
Message-ID:
--===============7949973549912777162==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-01 05:04:40 -0400 (Fri, 01 Aug 2008)
New Revision: 6478
Added:
core/trunk/src/test/java/org/jboss/cache/profiling/ProfileMapViewTest.ja=
va
Log:
added test
Copied: core/trunk/src/test/java/org/jboss/cache/profiling/ProfileMapViewTe=
st.java (from rev 6476, core/trunk/src/test/java/org/jboss/cache/profiling/=
ProfileTest.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/test/java/org/jboss/cache/profiling/ProfileMapViewTest.j=
ava (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/profiling/ProfileMapViewTest.j=
ava 2008-08-01 09:04:40 UTC (rev 6478)
@@ -0,0 +1,305 @@
+package org.jboss.cache.profiling;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.Cache;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.lock.IsolationLevel;
+import org.jboss.cache.util.Caches;
+import org.jboss.cache.util.Caches.HashKeySelector;
+import org.jboss.cache.util.TestingUtil;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+(a)Test(groups =3D "profiling")
+public class ProfileMapViewTest
+{
+ /*
+ Test configuration options
+ */
+ protected static final long DURATION =3D 60 * 1000; // 1 min of GENERAT=
ION =3D a lot of processing. :-)
+ protected static final int NUM_THREADS =3D 15;
+ protected static final int MAX_RANDOM_SLEEP_MILLIS =3D 1;
+ protected static final int MAX_ENTRIES =3D 200;
+ protected static final int WARMUP_LOOPS =3D 20000;
+ protected static final boolean USE_SLEEP =3D false; // throttle generat=
ion a bit
+
+ private List keys =3D new ArrayList(MAX_ENTRIES);
+ private Random r =3D new Random();
+ private Cache cache;
+ private Map map;
+
+
+ private Log log =3D LogFactory.getLog(ProfileTest.class);
+
+ @BeforeTest
+ public void setUp()
+ {
+ Configuration cfg =3D UnitTestCacheConfigurationFactory.createConfig=
uration(Configuration.CacheMode.LOCAL);
+ cfg.setNodeLockingScheme(NodeLockingScheme.MVCC);
+ cfg.setConcurrencyLevel(500);
+ cache =3D new DefaultCacheFactory().createCache(cfg,=
false);
+ }
+
+ @AfterTest
+ public void tearDown()
+ {
+ cache.stop();
+ }
+
+
+ public void testLocalModeMVCC_RC() throws Exception
+ {
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.READ_COMMI=
TTED);
+ runCompleteTest();
+ }
+
+ public void testLocalModeMVCC_RR() throws Exception
+ {
+ cache.getConfiguration().setIsolationLevel(IsolationLevel.REPEATABLE=
_READ);
+ runCompleteTest();
+ }
+
+
+ private void runCompleteTest() throws Exception
+ {
+ init();
+ startup();
+ warmup();
+ doTest();
+
+ // wait for user exit
+ System.in.read();
+ }
+
+ /**
+ * Thr following test phases can be profiled individually using trigger=
s in JProfiler.
+ */
+
+ protected void init()
+ {
+ long startTime =3D System.currentTimeMillis();
+ log.warn("Starting init() phase");
+ keys.clear();
+ for (int i =3D 0; i < MAX_ENTRIES; i++)
+ {
+ String key =3D createRandomKey(r);
+ while (keys.contains(key)) key =3D createRandomKey(r);
+ if (i % 10 =3D=3D 0)
+ {
+ log.warn("Generated " + i + " fqns");
+ }
+ keys.add(key);
+ }
+ System.gc();
+ long duration =3D System.currentTimeMillis() - startTime;
+ log.warn("Finished init() phase. " + printDuration(duration));
+ }
+
+ private String createRandomKey(Random r)
+ {
+ StringBuilder s =3D new StringBuilder("/");
+ int depth =3D r.nextInt(3);
+ for (int i =3D 0; i < depth; i++)
+ {
+ s.append(r.nextInt(Integer.MAX_VALUE)).append("/");
+ }
+
+ return s.toString();
+ }
+
+ private Map createMap(Cache cache)
+ {
+ return Caches.asPartitionedMap(cache.getRoot(), new HashKeySelector(=
128));
+ }
+
+ private void startup()
+ {
+ long startTime =3D System.currentTimeMillis();
+ log.warn("Starting cache");
+ cache.start();
+ map =3D createMap(cache);
+ long duration =3D System.currentTimeMillis() - startTime;
+ log.warn("Started cache. " + printDuration(duration));
+ }
+
+ private void warmup() throws InterruptedException
+ {
+ long startTime =3D System.currentTimeMillis();
+ ExecutorService exec =3D Executors.newFixedThreadPool(NUM_THREADS);
+ log.warn("Starting warmup");
+ // creates all the Fqns since this can be expensive and we don't rea=
lly want to measure this (for now)
+ for (final String key : keys)
+ {
+ exec.execute(new Runnable()
+ {
+ public void run()
+ {
+ // this will create the necessary nodes.
+// cache.put(f, Collections.emptyMap());
+ map.put(key, "value");
+ }
+ });
+ }
+
+ // loop through WARMUP_LOOPS gets and puts for JVM optimisation
+ for (int i =3D 0; i < WARMUP_LOOPS; i++)
+ {
+ exec.execute(new Runnable()
+ {
+ public void run()
+ {
+// Fqn f =3D fqns.get(r.nextInt(MAX_ENTRIES));
+ String key =3D keys.get(r.nextInt(MAX_ENTRIES));
+// cache.get(f, "");
+// cache.put(f, "k", "v");
+// cache.remove(f, "k");
+ map.get(key);
+ map.put(key, "value");
+ map.remove(key);
+ }
+ });
+ }
+
+ exec.shutdown();
+ exec.awaitTermination(360, TimeUnit.SECONDS);
+
+ long duration =3D System.currentTimeMillis() - startTime;
+ log.warn("Finished warmup. " + printDuration(duration));
+ //cache.removeNode(Fqn.ROOT);
+ cache.stop();
+ cache.start();
+ map =3D createMap(cache);
+ }
+
+ private void doTest() throws Exception
+ {
+ ExecutorService exec =3D Executors.newFixedThreadPool(NUM_THREADS);
+ long end =3D System.currentTimeMillis() + DURATION;
+ long startTime =3D System.currentTimeMillis();
+ log.warn("Starting test");
+ int i =3D 0;
+ while (System.currentTimeMillis() < end)
+ {
+ MyRunnable r =3D null;
+ switch (i % 3)
+ {
+ case 0:
+ r =3D new Putter(i++);
+ break;
+ case 1:
+ r =3D new Getter(i++);
+ break;
+ case 2:
+ r =3D new Remover(i++);
+ break;
+ }
+ exec.execute(r);
+// if (USE_SLEEP) TestingUtil.sleepRandom(MAX_RANDOM_SLEEP_MILLIS);
+ if (USE_SLEEP) TestingUtil.sleepThread(MAX_RANDOM_SLEEP_MILLIS);
+ }
+ log.warn("Finished generating runnables; awaiting executor completio=
n");
+ // wait for executors to complete!
+ exec.shutdown();
+ exec.awaitTermination(((long) i), TimeUnit.SECONDS); // wait up to =
1 sec for each call?
+ long duration =3D System.currentTimeMillis() - startTime;
+ log.warn("Finished test. " + printDuration(duration));
+ }
+
+ enum Mode
+ {
+ PUT, GET, REMOVE
+ }
+
+ private abstract class MyRunnable implements Runnable
+ {
+ int id;
+ Mode mode;
+
+ public void run()
+ {
+ if (id % 100 =3D=3D 0) log.warn("Processing iteration " + id);
+ String k =3D getRandomString();
+ String key =3D keys.get(r.nextInt(MAX_ENTRIES));
+ switch (mode)
+ {
+ case PUT:
+// cache.put(f, k, getRandomString());
+ map.put(key, getRandomString());
+ break;
+ case GET:
+// cache.get(f, k);
+ map.get(key);
+ break;
+ case REMOVE:
+// cache.remove(f, k);
+ map.remove(key);
+ break;
+ }
+ }
+ }
+
+ private class Putter extends MyRunnable
+ {
+ private Putter(int id)
+ {
+ this.id =3D id;
+ mode =3D Mode.PUT;
+ }
+ }
+
+ private class Getter extends MyRunnable
+ {
+ private Getter(int id)
+ {
+ this.id =3D id;
+ mode =3D Mode.GET;
+ }
+ }
+
+ private class Remover extends MyRunnable
+ {
+ private Remover(int id)
+ {
+ this.id =3D id;
+ mode =3D Mode.REMOVE;
+ }
+ }
+
+ private String getRandomString()
+ {
+ StringBuilder sb =3D new StringBuilder();
+ int len =3D r.nextInt(10);
+
+ for (int i =3D 0; i < len; i++)
+ {
+ sb.append((char) (63 + r.nextInt(26)));
+ }
+ return sb.toString();
+ }
+
+ private String printDuration(long duration)
+ {
+ if (duration > 2000)
+ {
+ double dSecs =3D ((double) duration / (double) 1000);
+ return "Duration: " + dSecs + " seconds";
+ }
+ else
+ {
+ return "Duration: " + duration + " millis";
+ }
+ }
+}
\ No newline at end of file
--===============7949973549912777162==--
From jboss-qa-internal at redhat.com Fri Aug 1 06:47:34 2008
Content-Type: multipart/mixed; boundary="===============4888004006134275167=="
MIME-Version: 1.0
From: jboss-qa-internal at redhat.com
To: jbosscache-commits at lists.jboss.org
Subject: =?utf-8?q?=5Bjbosscache-commits=5D_Hudson_build_is_still_unstable=3A_jbos?=
=?utf-8?q?s-cache-core-trunk-jdk1=2E5_=C2=BB_JBoss_Cache_-_Core_Edition_?=
=?utf-8?q?=23527?=
Date: Fri, 01 Aug 2008 06:47:31 -0400
Message-ID: <587808797.7211217587651700.JavaMail.hudson@hudson1.qa.atl2.redhat.com>
In-Reply-To: 269443537.6241217541983146.JavaMail.hudson@hudson1.qa.atl2.redhat.com
--===============4888004006134275167==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
See http://hudson.qa.jboss.com/hudson/job/jboss-cache-core-trunk-jdk1.5/org=
.jboss.cache$jbosscache-core/527/changes
--===============4888004006134275167==--
From jbosscache-commits at lists.jboss.org Fri Aug 1 07:03:23 2008
Content-Type: multipart/mixed; boundary="===============4958440061213256072=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6479 - in core/trunk/src:
main/java/org/jboss/cache/commands/write and 4 other directories.
Date: Fri, 01 Aug 2008 07:03:23 -0400
Message-ID:
--===============4958440061213256072==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-01 07:03:23 -0400 (Fri, 01 Aug 2008)
New Revision: 6479
Added:
core/trunk/src/main/java/org/jboss/cache/notifications/annotation/NodeIn=
validated.java
core/trunk/src/main/java/org/jboss/cache/notifications/event/NodeInvalid=
atedEvent.java
core/trunk/src/test/java/org/jboss/cache/notifications/NotifyNodeInvalid=
atedTest.java
Modified:
core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/Versioned=
InvalidateCommand.java
core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateComman=
d.java
core/trunk/src/main/java/org/jboss/cache/notifications/Notifier.java
core/trunk/src/main/java/org/jboss/cache/notifications/NotifierImpl.java
core/trunk/src/main/java/org/jboss/cache/notifications/annotation/CacheL=
istener.java
core/trunk/src/main/java/org/jboss/cache/notifications/event/Event.java
core/trunk/src/main/java/org/jboss/cache/notifications/event/EventImpl.j=
ava
core/trunk/src/test/java/org/jboss/cache/notifications/EventLog.java
core/trunk/src/test/java/org/jboss/cache/notifications/NotifierAnnotatio=
nsTest.java
core/trunk/src/test/java/org/jboss/cache/notifications/NotifierTest.java
core/trunk/src/test/java/org/jboss/cache/notifications/RemoteCacheListen=
erTest.java
Log:
JBCACHE-86 - a NodeInvalidated callback to listeners
Modified: core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/Ve=
rsionedInvalidateCommand.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/Versione=
dInvalidateCommand.java 2008-08-01 09:04:40 UTC (rev 6478)
+++ core/trunk/src/main/java/org/jboss/cache/commands/legacy/write/Versione=
dInvalidateCommand.java 2008-08-01 11:03:23 UTC (rev 6479)
@@ -129,10 +129,10 @@
=
protected void removeData(NodeSPI n, InvocationContext ctx) throws Cach=
eException
{
- notifier.notifyNodeEvicted(fqn, true, ctx);
+ notifier.notifyNodeInvalidated(fqn, true, ctx);
n.clearDataDirect();
n.setDataLoaded(false);
- notifier.notifyNodeEvicted(fqn, false, ctx);
+ notifier.notifyNodeInvalidated(fqn, false, ctx);
}
=
public DataVersion getDataVersion()
Modified: core/trunk/src/main/java/org/jboss/cache/commands/write/Invalidat=
eCommand.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateComma=
nd.java 2008-08-01 09:04:40 UTC (rev 6478)
+++ core/trunk/src/main/java/org/jboss/cache/commands/write/InvalidateComma=
nd.java 2008-08-01 11:03:23 UTC (rev 6479)
@@ -65,14 +65,14 @@
=
boolean evictNode(Fqn fqn, InvocationContext ctx)
{
- notifier.notifyNodeEvicted(fqn, true, ctx);
+ notifier.notifyNodeInvalidated(fqn, true, ctx);
try
{
return dataContainer.evict(fqn);
}
finally
{
- notifier.notifyNodeEvicted(fqn, false, ctx);
+ notifier.notifyNodeInvalidated(fqn, false, ctx);
}
}
=
Modified: core/trunk/src/main/java/org/jboss/cache/notifications/Notifier.j=
ava
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/notifications/Notifier.java 20=
08-08-01 09:04:40 UTC (rev 6478)
+++ core/trunk/src/main/java/org/jboss/cache/notifications/Notifier.java 20=
08-08-01 11:03:23 UTC (rev 6479)
@@ -56,6 +56,11 @@
void notifyNodeEvicted(Fqn fqn, boolean pre, InvocationContext ctx);
=
/**
+ * Notifies all registered listeners of a nodeInvalidated event.
+ */
+ void notifyNodeInvalidated(Fqn fqn, boolean pre, InvocationContext ctx);
+
+ /**
* Notifies all registered listeners of a nodeLoaded event.
*/
void notifyNodeLoaded(Fqn fqn, boolean pre, Map data, InvocationContext=
ctx);
Modified: core/trunk/src/main/java/org/jboss/cache/notifications/NotifierIm=
pl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/notifications/NotifierImpl.jav=
a 2008-08-01 09:04:40 UTC (rev 6478)
+++ core/trunk/src/main/java/org/jboss/cache/notifications/NotifierImpl.jav=
a 2008-08-01 11:03:23 UTC (rev 6479)
@@ -28,11 +28,12 @@
import org.jgroups.View;
=
import javax.transaction.Transaction;
+import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
-import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
@@ -55,31 +56,35 @@
private static final Class[] allowedMethodAnnotations =3D
{
CacheStarted.class, CacheStopped.class, CacheBlocked.class,=
CacheUnblocked.class, NodeCreated.class, NodeRemoved.class, NodeVisited.cl=
ass, NodeModified.class, NodeMoved.class,
- NodeActivated.class, NodePassivated.class, NodeLoaded.class=
, NodeEvicted.class, TransactionRegistered.class, TransactionCompleted.clas=
s, ViewChanged.class, BuddyGroupChanged.class
+ NodeActivated.class, NodePassivated.class, NodeLoaded.class=
, NodeEvicted.class, TransactionRegistered.class, TransactionCompleted.clas=
s, ViewChanged.class, BuddyGroupChanged.class,
+ NodeInvalidated.class
};
private static final Class[] parameterTypes =3D
{
CacheStartedEvent.class, CacheStoppedEvent.class, CacheBloc=
kedEvent.class, CacheUnblockedEvent.class, NodeCreatedEvent.class, NodeRemo=
vedEvent.class, NodeVisitedEvent.class, NodeModifiedEvent.class, NodeMovedE=
vent.class,
- NodeActivatedEvent.class, NodePassivatedEvent.class, NodeLo=
adedEvent.class, NodeEvictedEvent.class, TransactionRegisteredEvent.class, =
TransactionCompletedEvent.class, ViewChangedEvent.class, BuddyGroupChangedE=
vent.class
+ NodeActivatedEvent.class, NodePassivatedEvent.class, NodeLo=
adedEvent.class, NodeEvictedEvent.class, TransactionRegisteredEvent.class, =
TransactionCompletedEvent.class, ViewChangedEvent.class, BuddyGroupChangedE=
vent.class,
+ NodeInvalidatedEvent.class
};
=
- private final List cacheStartedListeners =3D new Co=
pyOnWriteArrayList();
- private final List cacheStoppedListeners =3D new Co=
pyOnWriteArrayList();
- private final List cacheBlockedListeners =3D new Co=
pyOnWriteArrayList();
- private final List cacheUnblockedListeners =3D new =
CopyOnWriteArrayList();
- private final List nodeCreatedListeners =3D new Cop=
yOnWriteArrayList();
- private final List nodeRemovedListeners =3D new Cop=
yOnWriteArrayList();
- private final List nodeVisitedListeners =3D new Cop=
yOnWriteArrayList();
- private final List nodeModifiedListeners =3D new Co=
pyOnWriteArrayList();
- private final List nodeMovedListeners =3D new CopyO=
nWriteArrayList();
- private final List nodeActivatedListeners =3D new C=
opyOnWriteArrayList();
- private final List nodePassivatedListeners =3D new =
CopyOnWriteArrayList();
- private final List nodeLoadedListeners =3D new Copy=
OnWriteArrayList();
- private final List nodeEvictedListeners =3D new Cop=
yOnWriteArrayList();
- private final List transactionRegisteredListeners =
=3D new CopyOnWriteArrayList();
- private final List transactionCompletedListeners =
=3D new CopyOnWriteArrayList();
- private final List viewChangedListeners =3D new Cop=
yOnWriteArrayList();
- private final List buddyGroupChangedListeners =3D n=
ew CopyOnWriteArrayList();
+ final Map, List> listen=
ersMap =3D new HashMap, List>(32);
+ final List cacheStartedListeners =3D new CopyOnWrit=
eArrayList();
+ final List cacheStoppedListeners =3D new CopyOnWrit=
eArrayList();
+ final List cacheBlockedListeners =3D new CopyOnWrit=
eArrayList();
+ final List cacheUnblockedListeners =3D new CopyOnWr=
iteArrayList();
+ final List nodeCreatedListeners =3D new CopyOnWrite=
ArrayList();
+ final List nodeRemovedListeners =3D new CopyOnWrite=
ArrayList();
+ final List nodeVisitedListeners =3D new CopyOnWrite=
ArrayList();
+ final List nodeModifiedListeners =3D new CopyOnWrit=
eArrayList();
+ final List nodeMovedListeners =3D new CopyOnWriteAr=
rayList();
+ final List nodeActivatedListeners =3D new CopyOnWri=
teArrayList();
+ final List nodePassivatedListeners =3D new CopyOnWr=
iteArrayList();
+ final List nodeLoadedListeners =3D new CopyOnWriteA=
rrayList();
+ final List nodeInvalidatedListeners =3D new CopyOnW=
riteArrayList();
+ final List nodeEvictedListeners =3D new CopyOnWrite=
ArrayList();
+ final List transactionRegisteredListeners =3D new C=
opyOnWriteArrayList();
+ final List transactionCompletedListeners =3D new Co=
pyOnWriteArrayList();
+ final List viewChangedListeners =3D new CopyOnWrite=
ArrayList();
+ final List buddyGroupChangedListeners =3D new CopyO=
nWriteArrayList();
=
// final Map> listenerInvocations =3D=
new ConcurrentHashMap>();
private Cache cache;
@@ -88,10 +93,29 @@
=
public NotifierImpl()
{
+ listenersMap.put(CacheStarted.class, cacheStartedListeners);
+ listenersMap.put(CacheStopped.class, cacheStoppedListeners);
+ listenersMap.put(CacheBlocked.class, cacheBlockedListeners);
+ listenersMap.put(CacheUnblocked.class, cacheUnblockedListeners);
+ listenersMap.put(NodeCreated.class, nodeCreatedListeners);
+ listenersMap.put(NodeRemoved.class, nodeRemovedListeners);
+ listenersMap.put(NodeVisited.class, nodeVisitedListeners);
+ listenersMap.put(NodeModified.class, nodeModifiedListeners);
+ listenersMap.put(NodeMoved.class, nodeMovedListeners);
+ listenersMap.put(NodeActivated.class, nodeActivatedListeners);
+ listenersMap.put(NodePassivated.class, nodePassivatedListeners);
+ listenersMap.put(NodeLoaded.class, nodeLoadedListeners);
+ listenersMap.put(NodeEvicted.class, nodeEvictedListeners);
+ listenersMap.put(TransactionRegistered.class, transactionRegisteredL=
isteners);
+ listenersMap.put(TransactionCompleted.class, transactionCompletedLis=
teners);
+ listenersMap.put(ViewChanged.class, viewChangedListeners);
+ listenersMap.put(BuddyGroupChanged.class, buddyGroupChangedListeners=
);
+ listenersMap.put(NodeInvalidated.class, nodeInvalidatedListeners);
}
=
public NotifierImpl(Cache cache)
{
+ this();
this.cache =3D cache;
}
=
@@ -120,6 +144,7 @@
*
* @param listener object to be considered as a listener.
*/
+ @SuppressWarnings("unchecked")
private void validateAndAddListenerInvocation(Object listener)
{
testListenerClassValidity(listener.getClass());
@@ -162,7 +187,7 @@
=
private void addListenerInvocation(Class annotation, ListenerInvocation=
li)
{
- List result =3D getListenersForAnnotation(annota=
tion);
+ List result =3D getListenerCollectionForAnnotati=
on(annotation);
result.add(li);
}
=
@@ -179,7 +204,7 @@
private void removeListenerInvocation(Class annotation, Object listener)
{
if (listener =3D=3D null) return;
- List l =3D getListenersForAnnotation(annotation);
+ List l =3D getListenerCollectionForAnnotation(an=
notation);
Set
+ * Note: Since 3.0, a new parameter, sync, has been introd=
uced on this annotation. This defaults to true
+ * which provides the above semantics. Alternatively, if you set sync=
to false, then invocations are made in a
+ * separate thread, which will not cause any blocking on the caller=
or network thread. The separate thread is taken
+ * from a pool, which can be configured using {@link org.jboss.cache.confi=
g.Configuration#setListenerAsyncPoolSize(int)}.
*
- *
* Summary of Notification Annotations
*
*
@@ -298,5 +301,12 @@
@Target(ElementType.TYPE)
public @interface CacheListener
{
+ /**
+ * Specifies whether callbacks on any class annotated with this annotat=
ion happens synchronously (in the caller's thread)
+ * or asynchronously (using a separate thread). Defaults to true=
tt>.
+ *
+ * @return true if the expectation is that callbacks are called using t=
he caller's thread; false if they are to be made in a separate thread.
+ * @since 3.0
+ */
boolean sync() default true;
}
--===============6806510994640899211==--
From jboss-qa-internal at redhat.com Mon Aug 4 09:56:11 2008
Content-Type: multipart/mixed; boundary="===============6881606544236644176=="
MIME-Version: 1.0
From: jboss-qa-internal at redhat.com
To: jbosscache-commits at lists.jboss.org
Subject: =?utf-8?q?=5Bjbosscache-commits=5D_Hudson_build_is_still_unstable=3A_jbos?=
=?utf-8?q?s-cache-core-trunk-jdk1=2E5_=C2=BB_JBoss_Cache_-_Core_Edition_?=
=?utf-8?q?=23532?=
Date: Mon, 04 Aug 2008 09:56:06 -0400
Message-ID: <450087068.12191217858166753.JavaMail.hudson@hudson1.qa.atl2.redhat.com>
In-Reply-To: 2139995674.10691217780405272.JavaMail.hudson@hudson1.qa.atl2.redhat.com
--===============6881606544236644176==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
See http://hudson.qa.jboss.com/hudson/job/jboss-cache-core-trunk-jdk1.5/org=
.jboss.cache$jbosscache-core/532/changes
--===============6881606544236644176==--
From jbosscache-commits at lists.jboss.org Mon Aug 4 10:20:21 2008
Content-Type: multipart/mixed; boundary="===============0409471134606186214=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6495 -
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0.
Date: Mon, 04 Aug 2008 10:20:21 -0400
Message-ID:
--===============0409471134606186214==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: mircea.markus
Date: 2008-08-04 10:20:21 -0400 (Mon, 04 Aug 2008)
New Revision: 6495
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/config.sh
Log:
increased memory size
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/co=
nfig.sh
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/config.s=
h 2008-08-04 13:34:30 UTC (rev 6494)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/config.s=
h 2008-08-04 14:20:21 UTC (rev 6495)
@@ -15,5 +15,5 @@
#--classpath was set
=
#additional JVM options
-JVM_OPTIONS=3D"$JVM_OPTIONS -Djava.net.preferIPv4Stack=3Dtrue -Djbosscache=
.config.validate=3Dfalse" =
+JVM_OPTIONS=3D"$JVM_OPTIONS -Djava.net.preferIPv4Stack=3Dtrue -Djbosscache=
.config.validate=3Dfalse -Xmx2048m"
JVM_OPTIONS=3D"$JVM_OPTIONS -DcacheBenchFwk.cacheWrapperClassName=3Dorg.ca=
chebench.cachewrappers.JBossCache300Wrapper"
--===============0409471134606186214==--
From jbosscache-commits at lists.jboss.org Mon Aug 4 10:21:20 2008
Content-Type: multipart/mixed; boundary="===============4252883762791052252=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6496 -
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1.
Date: Mon, 04 Aug 2008 10:21:20 -0400
Message-ID:
--===============4252883762791052252==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: mircea.markus
Date: 2008-08-04 10:21:20 -0400 (Mon, 04 Aug 2008)
New Revision: 6496
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/config.sh
Log:
increased memory size
Modified: benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/con=
fig.sh
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/config.sh=
2008-08-04 14:20:21 UTC (rev 6495)
+++ benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/config.sh=
2008-08-04 14:21:20 UTC (rev 6496)
@@ -15,6 +15,6 @@
#--classpath was set
=
#additional JVM options
-export JVM_OPTIONS=3D"$JVM_OPTIONS -Djava.net.preferIPv4Stack=3Dtrue -Dtan=
gosol.coherence.localhost=3D${MYTESTIP_1}"
+export JVM_OPTIONS=3D"$JVM_OPTIONS -Xmx2048m -Djava.net.preferIPv4Stack=3D=
true -Dtangosol.coherence.localhost=3D${MYTESTIP_1}"
export JVM_OPTIONS=3D"$JVM_OPTIONS -Dtangosol.coherence.cacheconfig=3Dcach=
e-config.xml"
export JVM_OPTIONS=3D"$JVM_OPTIONS -DcacheBenchFwk.cacheWrapperClassName=
=3Dorg.cachebench.cachewrappers.Coherence331Wrapper"
--===============4252883762791052252==--
From jbosscache-commits at lists.jboss.org Mon Aug 4 10:22:30 2008
Content-Type: multipart/mixed; boundary="===============9210551689063059990=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6497 -
core/trunk/src/main/java/org/jboss/cache/marshall.
Date: Mon, 04 Aug 2008 10:22:30 -0400
Message-ID:
--===============9210551689063059990==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-04 10:22:30 -0400 (Mon, 04 Aug 2008)
New Revision: 6497
Modified:
core/trunk/src/main/java/org/jboss/cache/marshall/AbstractMarshaller.java
Log:
Compat with older marshaller
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/AbstractMarshal=
ler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/marshall/AbstractMarshaller.ja=
va 2008-08-04 14:21:20 UTC (rev 6496)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/AbstractMarshaller.ja=
va 2008-08-04 14:22:30 UTC (rev 6497)
@@ -104,7 +104,7 @@
=
public Object objectFromByteBuffer(byte[] bytes) throws Exception
{
- throw new RuntimeException("Needs to be overridden!");
+ return objectFromByteBuffer(bytes, 0, bytes.length);
}
=
public Object objectFromByteBuffer(byte[] bytes, int offset, int len) t=
hrows Exception
--===============9210551689063059990==--
From jboss-qa-internal at redhat.com Mon Aug 4 10:31:22 2008
Content-Type: multipart/mixed; boundary="===============9179133593481285887=="
MIME-Version: 1.0
From: jboss-qa-internal at redhat.com
To: jbosscache-commits at lists.jboss.org
Subject: =?utf-8?q?=5Bjbosscache-commits=5D_Build_failed_in_Hudson=3A_jboss-cache-?=
=?utf-8?q?core-trunk-jdk1=2E6_=C2=BB_JBoss_Cache_-_Core_Edition_=23401?=
Date: Mon, 04 Aug 2008 10:31:15 -0400
Message-ID: <1951981320.12211217860275609.JavaMail.hudson@hudson1.qa.atl2.redhat.com>
In-Reply-To: 1364597441.10701217781108224.JavaMail.hudson@hudson1.qa.atl2.redhat.com
--===============9179133593481285887==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
See http://hudson.qa.jboss.com/hudson/job/jboss-cache-core-trunk-jdk1.6/org=
.jboss.cache$jbosscache-core/401/changes
------------------------------------------
started
Building remotely on dev60-linux
Reusing existing maven process
[INFO] Scanning for projects...
[INFO] --------------------------------------------------------------------=
----
[INFO] Building JBoss Cache - Core Edition
[INFO] task-segment: [package]
[INFO] --------------------------------------------------------------------=
----
[INFO] [enforcer:enforce {execution: enforce-java}]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
Compiling 464 source files to /home/hudson/hudson_workspace/workspace/jboss=
-cache-core-trunk-jdk1.6/target/classes
[HUDSON] Archiving /home/hudson/hudson_workspace/workspace/jboss-cache-core=
-trunk-jdk1.6/./pom.xml
[INFO] --------------------------------------------------------------------=
----
[ERROR] BUILD FAILURE
[INFO] --------------------------------------------------------------------=
----
[INFO] Compilation failure
/home/hudson/hudson_workspace/workspace/jboss-cache-core-trunk-jdk1.6/src/m=
ain/java/org/jboss/cache/util/concurrent/WithinThreadExecutor.java:[20,7] o=
rg.jboss.cache.util.concurrent.WithinThreadExecutor is not abstract and doe=
s not override abstract method invokeAny(java.util.Collection extends =
java.util.concurrent.Callable>,long,java.util.concurrent.TimeUnit) in ja=
va.util.concurrent.ExecutorService
[INFO] --------------------------------------------------------------------=
----
[INFO] For more information, run Maven with the -e switch
[INFO] --------------------------------------------------------------------=
----
[INFO] Total time: 26 seconds
[INFO] Finished at: Mon Aug 04 10:31:12 EDT 2008
[INFO] Final Memory: 23M/134M
[INFO] --------------------------------------------------------------------=
----
Waiting for Hudson to finish collecting data
--===============9179133593481285887==--
From jbosscache-commits at lists.jboss.org Mon Aug 4 10:42:47 2008
Content-Type: multipart/mixed; boundary="===============0611383899052689024=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6498 -
pojo/trunk/src/test/resources.
Date: Mon, 04 Aug 2008 10:42:47 -0400
Message-ID:
--===============0611383899052689024==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-04 10:42:47 -0400 (Mon, 04 Aug 2008)
New Revision: 6498
Modified:
pojo/trunk/src/test/resources/log4j.xml
Log:
Reduced log levels
Modified: pojo/trunk/src/test/resources/log4j.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- pojo/trunk/src/test/resources/log4j.xml 2008-08-04 14:22:30 UTC (rev 64=
97)
+++ pojo/trunk/src/test/resources/log4j.xml 2008-08-04 14:42:47 UTC (rev 64=
98)
@@ -63,7 +63,7 @@
=
-
+
=
--===============0611383899052689024==--
From jbosscache-commits at lists.jboss.org Mon Aug 4 11:56:44 2008
Content-Type: multipart/mixed; boundary="===============1401541401555412918=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6499 -
core/trunk/src/main/java/org/jboss/cache/config/parsing.
Date: Mon, 04 Aug 2008 11:56:43 -0400
Message-ID:
--===============1401541401555412918==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: mircea.markus
Date: 2008-08-04 11:56:43 -0400 (Mon, 04 Aug 2008)
New Revision: 6499
Modified:
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfiguration=
Parser.java
Log:
now It is possible to override the schema with one specified through a cust=
om porperty
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfig=
urationParser.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfiguratio=
nParser.java 2008-08-04 14:42:47 UTC (rev 6498)
+++ core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfiguratio=
nParser.java 2008-08-04 15:56:43 UTC (rev 6499)
@@ -50,10 +50,12 @@
* Reads in XMLconfiguration files and spits out a {@link org.jboss.cache.=
config.Configuration} object.
* By default this class uses a validating parser (configurable).
*
- * In order to make the parser non-validating by default, the follwing sys=
tem property is expected:
- * -Djbosscache.config.validate=3Dfalse
- *
- * Implementation note: this class is stateful and one instance should be =
used for parsing a single configuration file.
+ * Following system properties can be used for customizing parser behavior:
+ *
+ *
-Djbosscache.config.validate=3Dfalse will make the parser=
non-validating
+ *
-Djbosscache.config.schemaLocation=3Durl allows one to sp=
ecify a validation schema that would override the one specified in the the =
xml document
+ *
+ * This class is stateful and one instance should be used for parsing a si=
ngle configuration file.
*
* @author Mircea.Markus(a)jboss.com
* @since 3.0
@@ -63,6 +65,7 @@
private static final Log log =3D LogFactory.getLog(XmlConfigurationPars=
er.class);
=
public static final String VALIDATING_SYSTEM_PROPERTY =3D "jbosscache.c=
onfig.validate";
+ public static final String SCHEMA_LOCATION_SYSTEM_PROPERTY =3D "jbossca=
che.config.schemaLocation";
=
/**
* the resulting configuration.
@@ -71,6 +74,7 @@
private Element root;
private ErrorHandler errorHandler;
private boolean isValidating;
+ private String schemaLocation;
=
/**
* If validation is on (default) one can specify an error handler for h=
andling validation errors.
@@ -80,6 +84,7 @@
{
this.errorHandler =3D errorHandler;
isValidating =3D System.getProperty(VALIDATING_SYSTEM_PROPERTY) =3D=
=3D null || Boolean.getBoolean(VALIDATING_SYSTEM_PROPERTY);
+ schemaLocation =3D System.getProperty(SCHEMA_LOCATION_SYSTEM_PROPERT=
Y);
}
=
/**
@@ -387,6 +392,15 @@
docBuilderFactory.setValidating(true);
docBuilderFactory.setNamespaceAware(true);
docBuilderFactory.setAttribute("http://java.sun.com/xml/jaxp/p=
roperties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
+ if (schemaLocation !=3D null)
+ {
+ if (log.isTraceEnabled()) log.trace("Using the schema locat=
ion set to: '" + schemaLocation + '\'');
+ docBuilderFactory.setAttribute("http://java.sun.com/xml/jax=
p/properties/schemaSource", schemaLocation);
+ }
+ else if (log.isTraceEnabled())
+ {
+ log.trace("Validation is enabled, using the schema decalred=
in the .xml configuration file");
+ }
}
DocumentBuilder parser =3D docBuilderFactory.newDocumentBuilder();
parser.setErrorHandler(errorHandler);
--===============1401541401555412918==--
From jbosscache-commits at lists.jboss.org Mon Aug 4 11:57:30 2008
Content-Type: multipart/mixed; boundary="===============1169503057401397703=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6500 - in core/trunk/src:
test/java/org/jboss/cache/config/parsing and 1 other directory.
Date: Mon, 04 Aug 2008 11:57:29 -0400
Message-ID:
--===============1169503057401397703==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: mircea.markus
Date: 2008-08-04 11:57:29 -0400 (Mon, 04 Aug 2008)
New Revision: 6500
Modified:
core/trunk/src/main/resources/jbosscache-config-3.0.xsd
core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfiguration=
SchemaTest.java
Log:
schema now supports the 'listeners' configuration elements
Modified: core/trunk/src/main/resources/jbosscache-config-3.0.xsd
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/resources/jbosscache-config-3.0.xsd 2008-08-04 15:5=
6:43 UTC (rev 6499)
+++ core/trunk/src/main/resources/jbosscache-config-3.0.xsd 2008-08-04 15:5=
7:29 UTC (rev 6500)
@@ -1,22 +1,23 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -95,17 +96,17 @@
-
+
-
+
-
+
@@ -133,6 +134,10 @@
=
+
+
+
+
@@ -154,7 +159,7 @@
=
-
+
@@ -173,7 +178,7 @@
=
-
+
@@ -188,10 +193,10 @@
-
+
-
+
Modified: core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfig=
urationSchemaTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfiguratio=
nSchemaTest.java 2008-08-04 15:56:43 UTC (rev 6499)
+++ core/trunk/src/test/java/org/jboss/cache/config/parsing/XmlConfiguratio=
nSchemaTest.java 2008-08-04 15:57:29 UTC (rev 6500)
@@ -46,6 +46,7 @@
{
System.out.println("file =3D " + file);
parser.parseFile(BASE_DIR_FOR_CONFIG + File.separator + file);
+ System.out.println("Processed file =3D " + file);
for (Exception e : handler.exceptionList) e.printStackTrace();
assert handler.noErrors() : "error during parsing (file " + file =
+ ")";
}
--===============1169503057401397703==--
From jboss-qa-internal at redhat.com Mon Aug 4 12:12:40 2008
Content-Type: multipart/mixed; boundary="===============2861796010596069053=="
MIME-Version: 1.0
From: jboss-qa-internal at redhat.com
To: jbosscache-commits at lists.jboss.org
Subject: =?utf-8?q?=5Bjbosscache-commits=5D_Build_failed_in_Hudson=3A_jboss-cache-?=
=?utf-8?q?core-trunk-jdk1=2E6_=C2=BB_JBoss_Cache_-_Core_Edition_=23402?=
Date: Mon, 04 Aug 2008 12:11:58 -0400
Message-ID: <814107337.12301217866318812.JavaMail.hudson@hudson1.qa.atl2.redhat.com>
In-Reply-To: 1951981320.12211217860275609.JavaMail.hudson@hudson1.qa.atl2.redhat.com
--===============2861796010596069053==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
See http://hudson.qa.jboss.com/hudson/job/jboss-cache-core-trunk-jdk1.6/org=
.jboss.cache$jbosscache-core/402/changes
Changes:
[mircea.markus] schema now supports the 'listeners' configuration elements
[mircea.markus] now It is possible to override the schema with one specifie=
d through a custom porperty
------------------------------------------
started
Building remotely on dev60-linux
Reusing existing maven process
[INFO] Scanning for projects...
[INFO] --------------------------------------------------------------------=
----
[INFO] Building JBoss Cache - Core Edition
[INFO] task-segment: [package]
[INFO] --------------------------------------------------------------------=
----
[INFO] [enforcer:enforce {execution: enforce-java}]
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
Compiling 464 source files to /home/hudson/hudson_workspace/workspace/jboss=
-cache-core-trunk-jdk1.6/target/classes
[HUDSON] Archiving /home/hudson/hudson_workspace/workspace/jboss-cache-core=
-trunk-jdk1.6/./pom.xml
[INFO] --------------------------------------------------------------------=
----
[ERROR] BUILD FAILURE
[INFO] --------------------------------------------------------------------=
----
[INFO] Compilation failure
/home/hudson/hudson_workspace/workspace/jboss-cache-core-trunk-jdk1.6/src/m=
ain/java/org/jboss/cache/util/concurrent/WithinThreadExecutor.java:[20,7] o=
rg.jboss.cache.util.concurrent.WithinThreadExecutor is not abstract and doe=
s not override abstract method invokeAny(java.util.Collection extends =
java.util.concurrent.Callable>,long,java.util.concurrent.TimeUnit) in ja=
va.util.concurrent.ExecutorService
[INFO] --------------------------------------------------------------------=
----
[INFO] For more information, run Maven with the -e switch
[INFO] --------------------------------------------------------------------=
----
[INFO] Total time: 28 seconds
[INFO] Finished at: Mon Aug 04 12:11:42 EDT 2008
[INFO] Final Memory: 22M/112M
[INFO] --------------------------------------------------------------------=
----
Waiting for Hudson to finish collecting data
--===============2861796010596069053==--
From jbosscache-commits at lists.jboss.org Mon Aug 4 12:30:05 2008
Content-Type: multipart/mixed; boundary="===============5082174230351545160=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6501 -
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib.
Date: Mon, 04 Aug 2008 12:30:04 -0400
Message-ID:
--===============5082174230351545160==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: mircea.markus
Date: 2008-08-04 12:30:04 -0400 (Mon, 04 Aug 2008)
New Revision: 6501
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib/jboss=
cache-core.jar
Log:
updated jbc jar
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/li=
b/jbosscache-core.jar
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)
--===============5082174230351545160==--
From jbosscache-commits at lists.jboss.org Mon Aug 4 12:57:26 2008
Content-Type: multipart/mixed; boundary="===============2489912423056621795=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6502 -
benchmarks/benchmark-fwk/trunk.
Date: Mon, 04 Aug 2008 12:57:25 -0400
Message-ID:
--===============2489912423056621795==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: mircea.markus
Date: 2008-08-04 12:57:25 -0400 (Mon, 04 Aug 2008)
New Revision: 6502
Modified:
benchmarks/benchmark-fwk/trunk/allJBossCacheTests.sh
Log:
cluster.sh will be called with nohup
Modified: benchmarks/benchmark-fwk/trunk/allJBossCacheTests.sh
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- benchmarks/benchmark-fwk/trunk/allJBossCacheTests.sh 2008-08-04 16:30:0=
4 UTC (rev 6501)
+++ benchmarks/benchmark-fwk/trunk/allJBossCacheTests.sh 2008-08-04 16:57:2=
5 UTC (rev 6502)
@@ -1,10 +1,9 @@
#!/bin/bash
=
scaling=3D"2 4 6 8"
-#scaling=3D"2 4 6 8 10"
-#scaling=3D"2 4"
-configs=3D"pess-repl-async.xml pess-repl-sync.xml pess-repl-async-br.xml"
-products=3D"jbosscache-2.0.0 jbosscache-2.1.0"
+configs=3D"pess-repl-sync.xml pess-repl-sync-br.xml pess-repl-async.xml mv=
cc-repl-sync.xml mvcc-repl-sync-br.xml mvcc-repl-async.xml"
+#configs=3D"distributed replicated"
+products=3D"jbosscache-3.0.0"
=
mkdir output
=
@@ -14,7 +13,7 @@
do
for size in $scaling
do
- ./cluster.sh start $product $config $size
+ nohup ./cluster.sh start $product $config $size
=
outputFileName=3Ddata_${product}_${config}_${size}.csv
while [ ! -e $outputFileName ]
--===============2489912423056621795==--
From jboss-qa-internal at redhat.com Mon Aug 4 13:27:46 2008
Content-Type: multipart/mixed; boundary="===============1531148542118646440=="
MIME-Version: 1.0
From: jboss-qa-internal at redhat.com
To: jbosscache-commits at lists.jboss.org
Subject: =?utf-8?q?=5Bjbosscache-commits=5D_Hudson_build_is_still_unstable=3A_jbos?=
=?utf-8?q?s-cache-core-trunk-jdk1=2E5_=C2=BB_JBoss_Cache_-_Core_Edition_?=
=?utf-8?q?=23534?=
Date: Mon, 04 Aug 2008 13:27:40 -0400
Message-ID: <1462027951.12431217870860716.JavaMail.hudson@hudson1.qa.atl2.redhat.com>
In-Reply-To: 450087068.12191217858166753.JavaMail.hudson@hudson1.qa.atl2.redhat.com
--===============1531148542118646440==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
See http://hudson.qa.jboss.com/hudson/job/jboss-cache-core-trunk-jdk1.5/org=
.jboss.cache$jbosscache-core/534/changes
--===============1531148542118646440==--
From jboss-qa-internal at redhat.com Mon Aug 4 15:43:30 2008
Content-Type: multipart/mixed; boundary="===============0247096374421550879=="
MIME-Version: 1.0
From: jboss-qa-internal at redhat.com
To: jbosscache-commits at lists.jboss.org
Subject: =?utf-8?q?=5Bjbosscache-commits=5D_Hudson_build_is_still_unstable=3A_jbos?=
=?utf-8?q?s-cache-core-trunk-jdk1=2E5_=C2=BB_JBoss_Cache_-_Core_Edition_?=
=?utf-8?q?=23535?=
Date: Mon, 04 Aug 2008 15:43:23 -0400
Message-ID: <1778084350.12681217879003646.JavaMail.hudson@hudson1.qa.atl2.redhat.com>
In-Reply-To: 1462027951.12431217870860716.JavaMail.hudson@hudson1.qa.atl2.redhat.com
--===============0247096374421550879==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
See http://hudson.qa.jboss.com/hudson/job/jboss-cache-core-trunk-jdk1.5/org=
.jboss.cache$jbosscache-core/535/changes
--===============0247096374421550879==--
From jbosscache-commits at lists.jboss.org Mon Aug 4 16:26:16 2008
Content-Type: multipart/mixed; boundary="===============5105770112640108030=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6503 -
core/trunk/src/main/java/org/jboss/cache/util/concurrent.
Date: Mon, 04 Aug 2008 16:26:14 -0400
Message-ID:
--===============5105770112640108030==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-04 16:26:13 -0400 (Mon, 04 Aug 2008)
New Revision: 6503
Modified:
core/trunk/src/main/java/org/jboss/cache/util/concurrent/WithinThreadExe=
cutor.java
Log:
Worked around http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=3D6267833
Modified: core/trunk/src/main/java/org/jboss/cache/util/concurrent/WithinTh=
readExecutor.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/util/concurrent/WithinThreadEx=
ecutor.java 2008-08-04 16:57:25 UTC (rev 6502)
+++ core/trunk/src/main/java/org/jboss/cache/util/concurrent/WithinThreadEx=
ecutor.java 2008-08-04 20:26:13 UTC (rev 6503)
@@ -67,22 +67,30 @@
throw new UnsupportedOperationException();
}
=
- public List> invokeAll(Collection> tasks) thr=
ows InterruptedException
+ @SuppressWarnings("unchecked")
+ // unchecked on purpose due to http://bugs.sun.com/bugdatabase/view_bug=
.do?bug_id=3D6267833
+ public List invokeAll(Collection tasks) throws InterruptedException
{
throw new UnsupportedOperationException();
}
=
- public List> invokeAll(Collection> tasks, lon=
g timeout, TimeUnit unit) throws InterruptedException
+ @SuppressWarnings("unchecked")
+ // unchecked on purpose due to http://bugs.sun.com/bugdatabase/view_bug=
.do?bug_id=3D6267833
+ public List invokeAll(Collection tasks, long timeout, TimeUnit unit) th=
rows InterruptedException
{
throw new UnsupportedOperationException();
}
=
- public T invokeAny(Collection> tasks) throws Interrupte=
dException, ExecutionException
+ @SuppressWarnings("unchecked")
+ // unchecked on purpose due to http://bugs.sun.com/bugdatabase/view_bug=
.do?bug_id=3D6267833
+ public Object invokeAny(Collection tasks) throws InterruptedException, =
ExecutionException
{
throw new UnsupportedOperationException();
}
=
- public T invokeAny(Collection> tasks, long timeout, Tim=
eUnit unit) throws InterruptedException, ExecutionException, TimeoutExcepti=
on
+ @SuppressWarnings("unchecked")
+ // unchecked on purpose due to http://bugs.sun.com/bugdatabase/view_bug=
.do?bug_id=3D6267833
+ public Object invokeAny(Collection tasks, long timeout, TimeUnit unit) =
throws InterruptedException, ExecutionException, TimeoutException
{
throw new UnsupportedOperationException();
}
--===============5105770112640108030==--
From jboss-qa-internal at redhat.com Mon Aug 4 18:37:23 2008
Content-Type: multipart/mixed; boundary="===============3945113417905330827=="
MIME-Version: 1.0
From: jboss-qa-internal at redhat.com
To: jbosscache-commits at lists.jboss.org
Subject: =?utf-8?q?=5Bjbosscache-commits=5D_Hudson_build_is_still_unstable=3A_jbos?=
=?utf-8?q?s-cache-core-trunk-jdk1=2E5_=C2=BB_JBoss_Cache_-_Core_Edition_?=
=?utf-8?q?=23536?=
Date: Mon, 04 Aug 2008 18:37:20 -0400
Message-ID: <1991948003.12901217889440242.JavaMail.hudson@hudson1.qa.atl2.redhat.com>
In-Reply-To: 1778084350.12681217879003646.JavaMail.hudson@hudson1.qa.atl2.redhat.com
--===============3945113417905330827==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
See http://hudson.qa.jboss.com/hudson/job/jboss-cache-core-trunk-jdk1.5/org=
.jboss.cache$jbosscache-core/536/changes
--===============3945113417905330827==--
From jboss-qa-internal at redhat.com Mon Aug 4 19:24:17 2008
Content-Type: multipart/mixed; boundary="===============1107417679897553395=="
MIME-Version: 1.0
From: jboss-qa-internal at redhat.com
To: jbosscache-commits at lists.jboss.org
Subject: =?utf-8?q?=5Bjbosscache-commits=5D_Hudson_build_is_unstable=3A_jboss-cach?=
=?utf-8?q?e-core-trunk-jdk1=2E6_=C2=BB_JBoss_Cache_-_Core_Edition_=23403?=
Date: Mon, 04 Aug 2008 19:24:13 -0400
Message-ID: <908041050.12931217892253576.JavaMail.hudson@hudson1.qa.atl2.redhat.com>
In-Reply-To: 814107337.12301217866318812.JavaMail.hudson@hudson1.qa.atl2.redhat.com
--===============1107417679897553395==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
See http://hudson.qa.jboss.com/hudson/job/jboss-cache-core-trunk-jdk1.6/org=
.jboss.cache$jbosscache-core/403/changes
--===============1107417679897553395==--
From jbosscache-commits at lists.jboss.org Tue Aug 5 06:23:57 2008
Content-Type: multipart/mixed; boundary="===============5192921695485565165=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6504 - in core/trunk/src:
test/java/org/jboss/cache/util and 1 other directory.
Date: Tue, 05 Aug 2008 06:23:57 -0400
Message-ID:
--===============5192921695485565165==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-05 06:23:56 -0400 (Tue, 05 Aug 2008)
New Revision: 6504
Modified:
core/trunk/src/main/java/org/jboss/cache/util/Caches.java
core/trunk/src/test/java/org/jboss/cache/util/CachesTest.java
Log:
Update to Caches code
Modified: core/trunk/src/main/java/org/jboss/cache/util/Caches.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/util/Caches.java 2008-08-04 20=
:26:13 UTC (rev 6503)
+++ core/trunk/src/main/java/org/jboss/cache/util/Caches.java 2008-08-05 10=
:23:56 UTC (rev 6504)
@@ -3,6 +3,7 @@
import org.jboss.cache.Cache;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
+import org.jboss.cache.NodeSPI;
import org.jboss.cache.loader.CacheLoader;
=
import java.util.AbstractMap;
@@ -10,7 +11,6 @@
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.Map;
-import java.util.Map.Entry;
import java.util.Set;
=
/**
@@ -36,12 +36,13 @@
/**
* Returns a {@link Map} from the root node.
*
+ * @param cache cache to wrap as a map
+ * @return a map representation of the cache
* @see #asMap(Node)
*/
- public static Map asMap(Cache cache)
+ public static Map asMap(Cache cache)
{
- if (cache =3D=3D null)
- throw new NullPointerException("cache");
+ if (cache =3D=3D null) throw new NullPointerException("cache");
return asMap(cache.getRoot());
}
=
@@ -62,10 +63,13 @@
* Also, when using a {@link CacheLoader} for storage, keys used must b=
e valid as
* part of the {@link Fqn} used in calls. Generally speaking, simple st=
ring values are
* preferred.
+ *
+ * @param node node in a cache to wrap
+ * @return a Map representation of the cache
*/
- public static Map asMap(Node node)
+ public static Map asMap(Node node)
{
- return new MapNode(node);
+ return new MapNode(node);
}
=
/**
@@ -83,10 +87,13 @@
* of the data at time of calling. This may be very inefficient.
*
* The map is not serializable.
+ *
+ * @param node node to wrap
+ * @return Map representation of the cache
*/
- public static Map asSimpleMap(Node node)
+ public static Map asSimpleMap(Node node)
{
- return new SimpleMapNode(node);
+ return new SimpleMapNode(node);
}
=
/**
@@ -100,23 +107,28 @@
* and all methods are thread safe.
*
* The set is not serializable.
+ *
+ * @param node node to wrap
+ * @return a Set representation of the values in a node
*/
- public static Set asSimpleSet(Node node)
+ public static Set asSimpleSet(Node node)
{
- return new SimpleSetNode(node);
+ return new SimpleSetNode(node);
}
=
/**
* Returns a {@link Map}, where map entries are partitioned into
* children nodes, within a cache node.
- * The default child selector divides the data into 16 child nodes base=
d on hash code.
+ * The default child selector divides the data into 128 child nodes bas=
ed on hash code.
* Note that for large data sets, the number of child nodes should be i=
ncreased.
*
* @param node node to cache under
+ * @return a Map representation of the cache
*/
- public static Map asPartitionedMap(Node node)
+ @SuppressWarnings("unchecked")
+ public static Map asPartitionedMap(Node node)
{
- return new PartitionedMapNode(node, HashKeySelector.DEFAULT);
+ return new PartitionedMapNode(node, HashKeySelector.DEFAULT);
}
=
/**
@@ -132,10 +144,11 @@
*
* @param node node to cache under
* @param ss selector strategy that chooses a segment based on key
+ * @return a Map representation of the cache
*/
- public static Map asPartitionedMap(Node node, ChildSelector ss)
+ public static Map asPartitionedMap(Node node, ChildS=
elector ss)
{
- return new PartitionedMapNode(node, ss);
+ return new PartitionedMapNode(node, ss);
}
=
/**
@@ -143,31 +156,36 @@
* within the cache root, by key hash code.
*
* @param cache cache to use
- * @return
+ * @return a Map representation of the cache
*/
- public static Map asPartitionedMap(Cache cache)
+ public static Map asPartitionedMap(Cache cache)
{
return asPartitionedMap(cache.getRoot());
}
=
/**
+ * Computes an improved hash code from an object's hash code.
+ */
+ static protected final int hashCode(int i)
+ {
+ i ^=3D i >>> 20 ^ i >>> 12;
+ return i ^ i >>> 7 ^ i >>> 4;
+ }
+
+ /**
* Returns a segment ({@link Node#getChild(Object) child node name})
* to use based on the characteristics of a key.
*
* Here is an example class which selects a child based on a person's d=
epartment:
*
- * public static class DepartmentSelector implements ChildSelector
+ * public static class DepartmentSelector implements ChildSelector<P=
erson>
* {
- *
- * public Object childName(Person key)
- * {
- * return key.getDepartment();
+ * public Object childName(Person key)
+ * {
+ * return key.getDepartment();
+ * }
* }
- *
- * }
*
- *
- * @
*/
public interface ChildSelector
{
@@ -177,21 +195,23 @@
* @param key for calls to {@link Map#put}, {@link Map#get} etc.
* @return node name
*/
- Object childName(T key);
+ Fqn childName(T key);
}
=
/**
* Class that returns a child name to use based on the hash code of a k=
ey.
*/
- public static class HashKeySelector implements ChildSelector
+ public static class HashKeySelector implements ChildSelector
{
=
- static ChildSelector DEFAULT =3D new HashKeySelector(16);
+ static ChildSelector DEFAULT =3D new HashKeySelector(128);
=
protected int segments;
=
/**
* Constructs with N segments, where N must be a power of 2.
+ *
+ * @param segments Number of hash segments
*/
public HashKeySelector(int segments)
{
@@ -203,42 +223,34 @@
}
=
/**
- * Computes an improved hash code from an object's hash code.
- */
- protected int hashCode(int i)
- {
- i ^=3D i >>> 20 ^ i >>> 12;
- return i ^ i >>> 7 ^ i >>> 4;
- }
-
- /**
* Returns the segment for this key, in the inclusive range 0 to {@l=
ink #segments} - 1.
*/
- protected int segmentFor(Object key)
+ protected final int segmentFor(T key)
{
if (key =3D=3D null)
return 0;
int hc =3D key.hashCode();
- return hashCode(hc) & (segments - 1);
+ return Caches.hashCode(hc) & (segments - 1);
}
=
/**
* Returns the node name for this segment.
*/
- protected Object childName(int segment)
+ protected final Fqn childName(int segment)
{
- return "" + segment;//IntegerCache.toString(segment);
+ return Fqn.fromElements(Integer.toString(segment));
}
=
/**
* Returns the node name for this key.
* By default, returns a String containing the segment.
*/
- public Object childName(Object key)
+ public final Fqn childName(T key)
{
return childName(segmentFor(key));
}
=
+ @Override
public String toString()
{
return super.toString() + " segments=3D" + segments;
@@ -246,14 +258,14 @@
=
}
=
- static class MapNode extends AbstractMap
+ static class MapNode extends AbstractMap
{
=
public static final String KEY =3D "K";
=
- private Node node;
+ private Node node; // purposefully un-genericized
=
- public MapNode(Node node)
+ public MapNode(Node node)
{
if (node =3D=3D null)
throw new NullPointerException("node");
@@ -261,16 +273,16 @@
}
=
@Override
- public Set entrySet()
+ public Set> entrySet()
{
- return new AbstractSet()
+ return new AbstractSet>()
{
=
@Override
- public Iterator iterator()
+ public Iterator> iterator()
{
- final Iterator i =3D set().iterator();
- return new Iterator()
+ final Iterator> i =3D set().iterator();
+ return new Iterator>()
{
=
Object name;
@@ -282,13 +294,14 @@
return i.hasNext();
}
=
- public Object next()
+ @SuppressWarnings("unchecked")
+ public Entry next()
{
Node n =3D i.next();
this.name =3D n.getFqn().getLastElement();
this.next =3D true;
Object key =3D n.get(KEY);
- return new SimpleEntry(name, key);
+ return new SimpleImmutableEntry(name, key);
}
=
public void remove()
@@ -298,6 +311,7 @@
node.removeChild(name);
}
=
+ @Override
public String toString()
{
return "Itr name=3D" + name;
@@ -306,7 +320,8 @@
};
}
=
- private Set set()
+ @SuppressWarnings("unchecked")
+ private Set> set()
{
return node.getChildren();
}
@@ -334,12 +349,13 @@
}
=
@Override
- public Object get(Object arg0)
+ @SuppressWarnings("unchecked")
+ public V get(Object arg0)
{
Node child =3D node.getChild(arg0);
if (child =3D=3D null)
return null;
- return child.get(KEY);
+ return (V) child.get(KEY);
}
=
@Override
@@ -349,10 +365,10 @@
}
=
@Override
- public Set keySet()
+ public Set keySet()
{
=
- return new AbstractSet()
+ return new AbstractSet()
{
=
private Set set()
@@ -361,22 +377,23 @@
}
=
@Override
- public Iterator iterator()
+ public Iterator iterator()
{
final Iterator i =3D set().iterator();
- return new Iterator()
+ return new Iterator()
{
=
- Object child;
+ K child;
=
public boolean hasNext()
{
return i.hasNext();
}
=
- public Object next()
+ @SuppressWarnings("unchecked")
+ public K next()
{
- child =3D i.next();
+ child =3D (K) i.next();
return child;
}
=
@@ -408,18 +425,20 @@
}
=
@Override
- public Object put(Object arg0, Object arg1)
+ @SuppressWarnings("unchecked")
+ public V put(K arg0, V arg1)
{
- return node.addChild(Fqn.fromElements(arg0)).put(KEY, arg1);
+ return (V) node.addChild(Fqn.fromElements(arg0)).put(KEY, arg1);
}
=
@Override
- public Object remove(Object arg0)
+ @SuppressWarnings("unchecked")
+ public V remove(Object arg0)
{
Node child =3D node.getChild(arg0);
if (child =3D=3D null)
return null;
- Object o =3D child.remove(KEY);
+ V o =3D (V) child.remove(KEY);
node.removeChild(arg0);
return o;
}
@@ -432,12 +451,12 @@
=
}
=
- static class SimpleMapNode extends AbstractMap implements java.util.Map
+ static class SimpleMapNode extends AbstractMap
{
=
- private Node node;
+ private Node node;
=
- public SimpleMapNode(Node node)
+ public SimpleMapNode(Node node)
{
if (node =3D=3D null)
throw new NullPointerException("node");
@@ -465,39 +484,43 @@
/**
* getData returns a snapshot of the data.
*/
- public Set entrySet()
+ @Override
+ public Set> entrySet()
{
return node.getData().entrySet();
}
=
@Override
- public Object get(Object key)
+ @SuppressWarnings("unchecked")
+ public V get(Object key)
{
- return node.get(key);
+ return node.get((K) key);
}
=
@Override
- public Set keySet()
+ public Set keySet()
{
return node.getKeys();
}
=
@Override
- public Object put(Object key, Object value)
+ public V put(K key, V value)
{
return node.put(key, value);
}
=
@Override
- public void putAll(Map map)
+ @SuppressWarnings("unchecked")
+ public void putAll(Map extends K, ? extends V> map)
{
- node.putAll(map);
+ node.putAll((Map) map);
}
=
@Override
- public Object remove(Object key)
+ @SuppressWarnings("unchecked")
+ public V remove(Object key)
{
- return node.remove(key);
+ return node.remove((K) key);
}
=
@Override
@@ -508,14 +531,14 @@
=
}
=
- static class SimpleSetNode extends AbstractSet implements java.util.Set
+ static class SimpleSetNode extends AbstractSet implements java.ut=
il.Set
{
=
private Node node;
=
private static final String VALUE =3D "V";
=
- public SimpleSetNode(Node node)
+ public SimpleSetNode(Node node)
{
if (node =3D=3D null)
throw new NullPointerException("node");
@@ -535,6 +558,7 @@
}
=
@Override
+ @SuppressWarnings("unchecked")
public boolean remove(Object key)
{
return node.remove(key) !=3D null;
@@ -547,18 +571,19 @@
}
=
@Override
- public boolean add(Object arg0)
+ @SuppressWarnings("unchecked")
+ public boolean add(K arg0)
{
return node.put(arg0, VALUE) =3D=3D null;
}
=
@Override
- public Iterator iterator()
+ public Iterator iterator()
{
final Iterator i =3D node.getKeys().iterator();
- return new Iterator()
+ return new Iterator()
{
- Object key;
+ K key;
=
boolean next =3D false;
=
@@ -567,13 +592,15 @@
return i.hasNext();
}
=
- public Object next()
+ @SuppressWarnings("unchecked")
+ public K next()
{
- key =3D i.next();
+ key =3D (K) i.next();
next =3D true;
return key;
}
=
+ @SuppressWarnings("unchecked")
public void remove()
{
if (!next)
@@ -586,31 +613,31 @@
=
}
=
- static class PartitionedMapNode extends AbstractMap
+ static class PartitionedMapNode extends AbstractMap
{
=
- private Node node;
+ private NodeSPI node;
=
- private ChildSelector selector;
+ private ChildSelector selector;
=
- public PartitionedMapNode(Node node, ChildSelector selector)
+ public PartitionedMapNode(Node node, ChildSelector selector)
{
- this.node =3D node;
+ this.node =3D (NodeSPI) node;
this.selector =3D selector;
}
=
@Override
- public Set entrySet()
+ public Set> entrySet()
{
- return new AbstractSet()
+ return new AbstractSet>()
{
=
Iterator ci =3D node.getChildren().iterator();
=
@Override
- public Iterator iterator()
+ public Iterator> iterator()
{
- return new Iterator()
+ return new Iterator>()
{
=
Iterator ni;
@@ -620,6 +647,7 @@
findNext();
}
=
+ @SuppressWarnings("unchecked")
private void nextChild()
{
ni =3D new SimpleMapNode(ci.next()).entrySet().iterat=
or();
@@ -640,9 +668,10 @@
return ni.hasNext();
}
=
- public Entry next()
+ @SuppressWarnings("unchecked")
+ public Entry next()
{
- Entry n =3D (Entry) ni.next();
+ Entry n =3D (Entry) ni.next();
findNext();
return n;
}
@@ -665,15 +694,17 @@
}
=
@Override
+ @SuppressWarnings("unchecked")
public Set keySet()
{
- return new AbstractSet()
+ return new AbstractSet>()
{
=
@Override
- public Iterator iterator()
+ @SuppressWarnings("unchecked")
+ public Iterator> iterator()
{
- return PartitionedMapNode.super.keySet().iterator();
+ return (Iterator>) PartitionedMapNode.super.key=
Set().iterator();
}
=
@Override
@@ -706,40 +737,38 @@
node.getChild(o).clearData();
}
=
- private Node nodeFor(Object o)
+ @SuppressWarnings("unchecked")
+ private Fqn fqnFor(Object o)
{
- return node.getChild(selector.childName(o));
+ return Fqn.fromRelativeFqn(node.getFqn(), selector.childName((K) =
o));
}
=
@Override
+ @SuppressWarnings("unchecked")
public boolean containsKey(Object o)
{
- Node n =3D nodeFor(o);
- if (n =3D=3D null) return false;
- return n.getKeys().contains(o);
+ Fqn fqn =3D fqnFor(o);
+ Set keys =3D node.getCache().getKeys(fqn);
+ return keys !=3D null && keys.contains(o);
}
=
@Override
- public Object get(Object o)
+ @SuppressWarnings("unchecked")
+ public V get(Object key)
{
- Node n =3D nodeFor(o);
- if (n =3D=3D null) return null;
- return n.get(o);
+ return (V) node.getCache().get(fqnFor(key), key);
}
=
+ @SuppressWarnings("unchecked")
public Object put(Object key, Object value)
{
- Object name =3D selector.childName(key);
- Node n =3D node.getChild(name);
- if (n =3D=3D null)
- n =3D node.addChild(Fqn.fromElements(name));
- return n.put(key, value);
+ return node.getCache().put(fqnFor(key), key, value);
}
=
- public Object remove(Object o)
+ @SuppressWarnings("unchecked")
+ public V remove(Object key)
{
- Node n =3D nodeFor(o);
- return n.remove(o);
+ return (V) node.getCache().remove(fqnFor(key), key);
}
=
public int size()
@@ -752,65 +781,5 @@
}
return size;
}
-
}
-
- public static class SimpleEntry implements Entry
- {
- K key;
- V value;
-
- public SimpleEntry(K key, V value)
- {
- this.key =3D key;
- this.value =3D value;
- }
-
- public SimpleEntry(Entry e)
- {
- this.key =3D e.getKey();
- this.value =3D e.getValue();
- }
-
- public K getKey()
- {
- return key;
- }
-
- public V getValue()
- {
- return value;
- }
-
- public V setValue(V value)
- {
- V oldValue =3D this.value;
- this.value =3D value;
- return oldValue;
- }
-
- public boolean equals(Object o)
- {
- if (!(o instanceof Map.Entry))
- return false;
- Map.Entry e =3D (Map.Entry) o;
- return eq(key, e.getKey()) && eq(value, e.getValue());
- }
-
- public int hashCode()
- {
- return ((key =3D=3D null) ? 0 : key.hashCode()) ^
- ((value =3D=3D null) ? 0 : value.hashCode());
- }
-
- public String toString()
- {
- return key + "=3D" + value;
- }
-
- private static boolean eq(Object o1, Object o2)
- {
- return (o1 =3D=3D null ? o2 =3D=3D null : o1.equals(o2));
- }
- }
}
Modified: core/trunk/src/test/java/org/jboss/cache/util/CachesTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/test/java/org/jboss/cache/util/CachesTest.java 2008-08-0=
4 20:26:13 UTC (rev 6503)
+++ core/trunk/src/test/java/org/jboss/cache/util/CachesTest.java 2008-08-0=
5 10:23:56 UTC (rev 6504)
@@ -1,12 +1,14 @@
package org.jboss.cache.util;
=
+import junit.framework.TestCase;
import org.jboss.cache.Cache;
+import org.jboss.cache.DataContainer;
+import org.jboss.cache.DataContainerImpl;
import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
+import org.jboss.cache.invocation.CacheInvocationDelegate;
import org.jboss.cache.util.Caches.ChildSelector;
-import org.jboss.cache.util.Caches.SimpleEntry;
-import static org.testng.AssertJUnit.*;
-import org.testng.annotations.Test;
=
import java.util.Collection;
import java.util.Iterator;
@@ -16,8 +18,7 @@
/**
* Tests {@link Caches}.
*/
-(a)Test(groups =3D "functional")
-public class CachesTest
+public class CachesTest extends TestCase
{
String a =3D "a";
=
@@ -25,11 +26,11 @@
=
String c =3D "c";
=
- Cache cache =3D new DefaultCacheFactory=
().createCache();
+ Cache cache =3D new DefaultCacheFactory().createCache();
=
public void testSegment()
{
- Map m =3D Caches.asPartitionedMap(cache);
+ Map m =3D Caches.asPartitionedMap(cache);
// m.put(a, b);
testMap(m);
m.clear();
@@ -42,14 +43,13 @@
{
assertEquals("foo " + i, m.get(Integer.toHexString(i)));
}
- System.out.println(CachePrinter.printCacheDetails(cache));
}
=
public void testAsMap()
{
- Map m =3D Caches.asMap(cache);
+ Map m =3D Caches.asMap(cache);
testMap(m);
- for (Node n : cache.getRoot().getChildren())
+ for (Node n : (Set) cache.getRoot().getChildren())
{
assertEquals("/a", n.getFqn().toString());
assertEquals(c, n.get("K"));
@@ -141,10 +141,10 @@
assertEquals(false, i.hasNext());
=
assertEquals(true, m.keySet().contains(c));
- assertEquals(true, m.entrySet().contains(new SimpleEntry(c, a)));
+ assertEquals(true, m.entrySet().contains(new SimpleImmutableEntry(c,=
a)));
assertEquals(true, m.values().contains(a));
assertEquals(false, m.keySet().contains(a));
- assertEquals(false, m.entrySet().contains(new SimpleEntry(a, c)));
+ assertEquals(false, m.entrySet().contains(new SimpleImmutableEntry(a=
, c)));
assertEquals(false, m.values().contains(c));
assertEquals(false, m.isEmpty());
m.clear();
@@ -173,9 +173,15 @@
m.put(h, 21);
assertEquals(42, m.get(f));
assertEquals(69, m.get(g));
- System.out.println(CachePrinter.printCacheDetails(cache));
+ System.out.println(printDetails(cache));
}
=
+ private String printDetails(Cache c)
+ {
+ DataContainer dc =3D ((CacheInvocationDelegate) c).getDataContainer(=
);
+ return ((DataContainerImpl) dc).printDetails();
+ }
+
public static class Person
{
String name;
@@ -203,9 +209,9 @@
public static class DepartmentSelector implements ChildSelector
{
=
- public Object childName(Person key)
+ public Fqn childName(Person key)
{
- return key.getDepartment();
+ return Fqn.fromElements(key.getDepartment());
}
=
}
--===============5192921695485565165==--
From jbosscache-commits at lists.jboss.org Tue Aug 5 06:27:36 2008
Content-Type: multipart/mixed; boundary="===============5761545434729007052=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6505 -
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/cachebench/cachewrappers.
Date: Tue, 05 Aug 2008 06:27:36 -0400
Message-ID:
--===============5761545434729007052==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-05 06:27:36 -0400 (Tue, 05 Aug 2008)
New Revision: 6505
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/c=
achebench/cachewrappers/JBossCache300Wrapper.java
Log:
More efficient flat map
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/sr=
c/org/cachebench/cachewrappers/JBossCache300Wrapper.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/=
cachebench/cachewrappers/JBossCache300Wrapper.java 2008-08-05 10:23:56 UTC =
(rev 6504)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/src/org/=
cachebench/cachewrappers/JBossCache300Wrapper.java 2008-08-05 10:27:36 UTC =
(rev 6505)
@@ -8,7 +8,6 @@
import org.jboss.cache.Fqn;
import org.jboss.cache.config.Option;
import org.jboss.cache.util.Caches;
-import org.jboss.cache.util.Caches.HashKeySelector;
=
import java.util.List;
import java.util.Map;
@@ -38,7 +37,7 @@
if (FLAT)
{
log.info("Using FLAT MAP wrapper");
- flatCache =3D Caches.asPartitionedMap(cache.getRoot(), new HashKe=
ySelector(128));
+ flatCache =3D Caches.asMap(cache);
}
}
=
--===============5761545434729007052==--
From jbosscache-commits at lists.jboss.org Tue Aug 5 06:31:25 2008
Content-Type: multipart/mixed; boundary="===============3395598444367836607=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6506 - in
benchmarks/benchmark-fwk/trunk/cache-products: jbosscache-3.0.0 and 1 other
directory.
Date: Tue, 05 Aug 2008 06:31:21 -0400
Message-ID:
--===============3395598444367836607==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-05 06:31:21 -0400 (Tue, 05 Aug 2008)
New Revision: 6506
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/config.sh
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/config.sh
Log:
Dont set XMX params herevi cache-products/coherence-3.3.1/config.sh =
Modified: benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/con=
fig.sh
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/config.sh=
2008-08-05 10:27:36 UTC (rev 6505)
+++ benchmarks/benchmark-fwk/trunk/cache-products/coherence-3.3.1/config.sh=
2008-08-05 10:31:21 UTC (rev 6506)
@@ -15,6 +15,6 @@
#--classpath was set
=
#additional JVM options
-export JVM_OPTIONS=3D"$JVM_OPTIONS -Xmx2048m -Djava.net.preferIPv4Stack=3D=
true -Dtangosol.coherence.localhost=3D${MYTESTIP_1}"
+export JVM_OPTIONS=3D"$JVM_OPTIONS -Djava.net.preferIPv4Stack=3Dtrue -Dtan=
gosol.coherence.localhost=3D${MYTESTIP_1}"
export JVM_OPTIONS=3D"$JVM_OPTIONS -Dtangosol.coherence.cacheconfig=3Dcach=
e-config.xml"
export JVM_OPTIONS=3D"$JVM_OPTIONS -DcacheBenchFwk.cacheWrapperClassName=
=3Dorg.cachebench.cachewrappers.Coherence331Wrapper"
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/co=
nfig.sh
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/config.s=
h 2008-08-05 10:27:36 UTC (rev 6505)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/config.s=
h 2008-08-05 10:31:21 UTC (rev 6506)
@@ -15,5 +15,5 @@
#--classpath was set
=
#additional JVM options
-JVM_OPTIONS=3D"$JVM_OPTIONS -Djava.net.preferIPv4Stack=3Dtrue -Djbosscache=
.config.validate=3Dfalse -Xmx2048m"
+JVM_OPTIONS=3D"$JVM_OPTIONS -Djava.net.preferIPv4Stack=3Dtrue -Djbosscache=
.config.validate=3Dfalse"
JVM_OPTIONS=3D"$JVM_OPTIONS -DcacheBenchFwk.cacheWrapperClassName=3Dorg.ca=
chebench.cachewrappers.JBossCache300Wrapper"
--===============3395598444367836607==--
From jbosscache-commits at lists.jboss.org Tue Aug 5 06:37:31 2008
Content-Type: multipart/mixed; boundary="===============4348551059474029987=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6507 - in searchable/trunk:
src/main/java/org/jboss/cache/search and 1 other directories.
Date: Tue, 05 Aug 2008 06:37:26 -0400
Message-ID:
--===============4348551059474029987==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: navssurtani
Date: 2008-08-05 06:37:26 -0400 (Tue, 05 Aug 2008)
New Revision: 6507
Added:
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheCon=
figuration.java
Removed:
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheCfg=
Impl.java
Modified:
searchable/trunk/pom.xml
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFac=
tory.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoList=
ener.java
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCach=
eTest.java
Log:
Old changes and changed core dep to CR7
Modified: searchable/trunk/pom.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/pom.xml 2008-08-05 10:31:21 UTC (rev 6506)
+++ searchable/trunk/pom.xml 2008-08-05 10:37:26 UTC (rev 6507)
@@ -4,7 +4,7 @@
xsi:schemaLocation=3D"http://maven.apache.org/POM/4.0.0 http://ma=
ven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
- 0.1-SNAPSHOT
+ 0.1-Beta1
unit
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ jboss:service=3DNaming
+ jboss:service=3DTransactionManager
+
+
+ org.jboss.cache.tr=
ansaction.GenericTransactionManagerLookup
+
+
+
+
+ READ_COMMITTED
+
+
+ LOCAL
+
+
+ JBossCache-Cluster
+
+ 20000
+
+
+ 15000
+
+
+ 10000
+
+
Added: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/conf/=
pess-local-RR.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/conf/pes=
s-local-RR.xml (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.1.0/conf/pes=
s-local-RR.xml 2008-08-05 15:49:20 UTC (rev 6518)
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ jboss:service=3DNaming
+ jboss:service=3DTransactionManager
+
+
+ org.jboss.cache.tr=
ansaction.GenericTransactionManagerLookup
+
+
+
+
+ REPEATABLE_READ
+
+
+ LOCAL
+
+
+ JBossCache-Cluster
+
+ 20000
+
+
+ 15000
+
+
+ 10000
+
+
--===============6840105320962707523==--
From jbosscache-commits at lists.jboss.org Tue Aug 5 11:49:55 2008
Content-Type: multipart/mixed; boundary="===============8379039650314564900=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6519 -
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf.
Date: Tue, 05 Aug 2008 11:49:55 -0400
Message-ID:
--===============8379039650314564900==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-05 11:49:55 -0400 (Tue, 05 Aug 2008)
New Revision: 6519
Added:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pess=
-local-RC.xml
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pess=
-local-RR.xml
Log:
Added RR and RC
Added: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/=
pess-local-RC.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pes=
s-local-RC.xml (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pes=
s-local-RC.xml 2008-08-05 15:49:55 UTC (rev 6519)
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ jboss:service=3DNaming
+ jboss:service=3DTransactionManager
+
+
+ org.jboss.cache.tr=
ansaction.GenericTransactionManagerLookup
+
+
+
+
+ READ_COMMITTED
+
+
+ LOCAL
+
+
+ JBossCache-Cluster
+
+ 20000
+
+
+ 15000
+
+
+ 10000
+
+
Added: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/=
pess-local-RR.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pes=
s-local-RR.xml (rev 0)
+++ benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-2.2.0/conf/pes=
s-local-RR.xml 2008-08-05 15:49:55 UTC (rev 6519)
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ jboss:service=3DNaming
+ jboss:service=3DTransactionManager
+
+
+ org.jboss.cache.tr=
ansaction.GenericTransactionManagerLookup
+
+
+
+
+ REPEATABLE_READ
+
+
+ LOCAL
+
+
+ JBossCache-Cluster
+
+ 20000
+
+
+ 15000
+
+
+ 10000
+
+
--===============8379039650314564900==--
From jbosscache-commits at lists.jboss.org Tue Aug 5 12:32:59 2008
Content-Type: multipart/mixed; boundary="===============0953960902574789758=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6520 -
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib.
Date: Tue, 05 Aug 2008 12:32:58 -0400
Message-ID:
--===============0953960902574789758==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: mircea.markus
Date: 2008-08-05 12:32:58 -0400 (Tue, 05 Aug 2008)
New Revision: 6520
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib/jboss=
cache-core.jar
Log:
updated jbc distro
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/li=
b/jbosscache-core.jar
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)
--===============0953960902574789758==--
From jboss-qa-internal at redhat.com Tue Aug 5 12:36:19 2008
Content-Type: multipart/mixed; boundary="===============6598049703795413506=="
MIME-Version: 1.0
From: jboss-qa-internal at redhat.com
To: jbosscache-commits at lists.jboss.org
Subject: =?utf-8?q?=5Bjbosscache-commits=5D_Hudson_build_is_still_unstable=3A_jbos?=
=?utf-8?q?s-cache-core-trunk-jdk1=2E5_=C2=BB_JBoss_Cache_-_Core_Edition_?=
=?utf-8?q?=23538?=
Date: Tue, 05 Aug 2008 12:36:12 -0400
Message-ID: <172593533.14291217954172555.JavaMail.hudson@hudson1.qa.atl2.redhat.com>
In-Reply-To: 1982702611.13931217945602729.JavaMail.hudson@hudson1.qa.atl2.redhat.com
--===============6598049703795413506==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
See http://hudson.qa.jboss.com/hudson/job/jboss-cache-core-trunk-jdk1.5/org=
.jboss.cache$jbosscache-core/538/changes
--===============6598049703795413506==--
From jboss-qa-internal at redhat.com Tue Aug 5 13:38:13 2008
Content-Type: multipart/mixed; boundary="===============6469003614522980093=="
MIME-Version: 1.0
From: jboss-qa-internal at redhat.com
To: jbosscache-commits at lists.jboss.org
Subject: =?utf-8?q?=5Bjbosscache-commits=5D_Hudson_build_is_still_unstable=3A_jbos?=
=?utf-8?q?s-cache-core-trunk-jdk1=2E6_=C2=BB_JBoss_Cache_-_Core_Edition_?=
=?utf-8?q?=23405?=
Date: Tue, 05 Aug 2008 13:38:10 -0400
Message-ID: <2131242718.14741217957890673.JavaMail.hudson@hudson1.qa.atl2.redhat.com>
In-Reply-To: 277940613.13961217946686894.JavaMail.hudson@hudson1.qa.atl2.redhat.com
--===============6469003614522980093==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
See http://hudson.qa.jboss.com/hudson/job/jboss-cache-core-trunk-jdk1.6/org=
.jboss.cache$jbosscache-core/405/changes
--===============6469003614522980093==--
From jbosscache-commits at lists.jboss.org Tue Aug 5 18:59:48 2008
Content-Type: multipart/mixed; boundary="===============8272428057402331309=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6521 -
benchmarks/benchmark-fwk/trunk.
Date: Tue, 05 Aug 2008 18:59:47 -0400
Message-ID:
--===============8272428057402331309==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-05 18:59:47 -0400 (Tue, 05 Aug 2008)
New Revision: 6521
Modified:
benchmarks/benchmark-fwk/trunk/runAllLocal.sh
Log:
Modified: benchmarks/benchmark-fwk/trunk/runAllLocal.sh
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- benchmarks/benchmark-fwk/trunk/runAllLocal.sh 2008-08-05 16:32:58 UTC (=
rev 6520)
+++ benchmarks/benchmark-fwk/trunk/runAllLocal.sh 2008-08-05 22:59:47 UTC (=
rev 6521)
@@ -5,17 +5,16 @@
jdk=3Djava5
rm -rf ./output/*
export PLAIN_JVM_OPTIONS=3D"${JVM_OPTIONS} -DcacheBenchFwk.fwkCfgFile=3Dca=
chebench-local.xml -Xms2g -Xmx2g"
-unset JVM_OPTIONS && export JVM_OPTIONS=3D${PLAIN_JVM_OPTIONS}
-./runLocalNode.sh jbosscache-2.2.0 pess-local.xml
+unset JVM_OPTIONS && export JVM_OPTIONS=3D"${PLAIN_JVM_OPTIONS} -DcacheBen=
chFwk.productSuffix=3D.CR7"
+./runLocalNode.sh jbosscache-2.2.0 pess-local-RR.xml
+./runLocalNode.sh jbosscache-2.2.0 pess-local-RC.xml
+unset JVM_OPTIONS && export JVM_OPTIONS=3D"${PLAIN_JVM_OPTIONS} -DcacheBen=
chFwk.productSuffix=3D.ALPHA2"
./runLocalNode.sh jbosscache-3.0.0 mvcc-local-RR.xml
./runLocalNode.sh jbosscache-3.0.0 mvcc-local-RC.xml
-unset JVM_OPTIONS && export JVM_OPTIONS=3D"${PLAIN_JVM_OPTIONS} -cacheBenc=
hFwk.useFlatCache=3Dtrue -cacheBenchFwk.productSuffix=3DFlatCache"
-./runLocalNode.sh jbosscache-3.0.0 mvcc-local-RR.xml
-./runLocalNode.sh jbosscache-3.0.0 mvcc-local-RC.xml
unset JVM_OPTIONS && export JVM_OPTIONS=3D${PLAIN_JVM_OPTIONS}
-./runLocalNode.sh jbosscache-2.2.0 pess-local-NONE.xml
+./runLocalNode.sh jbosscache-2.1.0 pess-local-RR.xml
+./runLocalNode.sh jbosscache-2.1.0 pess-local-RC.xml
./runLocalNode.sh ehcache-1.5.0 ehcache-local.xml
-./runLocalNode.sh coherence-3.3.1 local-default.xml
=
mkdir output
mv data* ./output
--===============8272428057402331309==--
From jbosscache-commits at lists.jboss.org Tue Aug 5 19:01:19 2008
Content-Type: multipart/mixed; boundary="===============3573813007992586086=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6522 -
benchmarks/benchmark-fwk/trunk.
Date: Tue, 05 Aug 2008 19:01:18 -0400
Message-ID:
--===============3573813007992586086==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-05 19:01:18 -0400 (Tue, 05 Aug 2008)
New Revision: 6522
Modified:
benchmarks/benchmark-fwk/trunk/build.xml
Log:
Modified: benchmarks/benchmark-fwk/trunk/build.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- benchmarks/benchmark-fwk/trunk/build.xml 2008-08-05 22:59:47 UTC (rev 6=
521)
+++ benchmarks/benchmark-fwk/trunk/build.xml 2008-08-05 23:01:18 UTC (rev 6=
522)
@@ -102,7 +102,7 @@
=
+ description=3D"Compile module coherence331; production classes"=
if=3D"coherence.jars.present">
--===============3573813007992586086==--
From jbosscache-commits at lists.jboss.org Tue Aug 5 20:56:02 2008
Content-Type: multipart/mixed; boundary="===============5869173937119158879=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6523 -
core/trunk/src/main/java/org/jboss/cache/interceptors.
Date: Tue, 05 Aug 2008 20:56:02 -0400
Message-ID:
--===============5869173937119158879==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-05 20:56:02 -0400 (Tue, 05 Aug 2008)
New Revision: 6523
Modified:
core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.java
Log:
Null chk
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/TxIntercept=
or.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.jav=
a 2008-08-05 23:01:18 UTC (rev 6522)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/TxInterceptor.jav=
a 2008-08-06 00:56:02 UTC (rev 6523)
@@ -1114,7 +1114,7 @@
if (ctx =3D=3D null) ctx =3D invocationContextContainer.get();
ctx.setLocalRollbackOnly(localRollbackOnly);
setTransactionalContext(tx, gtx, transactionContext, ctx);
- ctx.setOptionOverrides(transactionalOptions);
+ if (transactionalOptions !=3D null) ctx.setOptionOverrides(transa=
ctionalOptions);
try
{
super.afterCompletion(status);
--===============5869173937119158879==--
From jbosscache-commits at lists.jboss.org Tue Aug 5 20:57:16 2008
Content-Type: multipart/mixed; boundary="===============6407481266588456054=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6524 - in core/trunk/src:
main/java/org/jboss/cache/interceptors and 4 other directories.
Date: Tue, 05 Aug 2008 20:57:16 -0400
Message-ID:
--===============6407481266588456054==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-05 20:57:16 -0400 (Tue, 05 Aug 2008)
New Revision: 6524
Added:
core/trunk/src/test/java/org/jboss/cache/api/mvcc/PersistingTransientSta=
teTest.java
core/trunk/src/test/java/org/jboss/cache/optimistic/PersistingTransientS=
tateTest.java
core/trunk/src/test/java/org/jboss/cache/statetransfer/PersistingTransie=
ntStateTest.java
Modified:
core/trunk/src/main/java/org/jboss/cache/config/Option.java
core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreIntercep=
tor.java
core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTrans=
ferIntegrator.java
core/trunk/src/main/java/org/jboss/cache/statetransfer/LegacyStateTransf=
erIntegrator.java
core/trunk/src/main/java/org/jboss/cache/statetransfer/LegacyStateTransf=
erManager.java
Log:
JBCACHE-131 - persist transient state during state transfer under certain c=
onditions
Modified: core/trunk/src/main/java/org/jboss/cache/config/Option.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/config/Option.java 2008-08-06 =
00:56:02 UTC (rev 6523)
+++ core/trunk/src/main/java/org/jboss/cache/config/Option.java 2008-08-06 =
00:57:16 UTC (rev 6524)
@@ -33,6 +33,7 @@
private int groupRequestMode =3D -1;
=
private int lockAcquisitionTimeout =3D -1;
+ private boolean suppressPersistence;
=
/**
* @since 1.4.0
@@ -303,6 +304,7 @@
if (forceAsynchronous !=3D option.forceAsynchronous) return false;
if (forceSynchronous !=3D option.forceSynchronous) return false;
if (lockAcquisitionTimeout !=3D option.lockAcquisitionTimeout) retur=
n false;
+ if (suppressPersistence !=3D option.suppressPersistence) return fals=
e;
return true;
}
=
@@ -320,6 +322,7 @@
result =3D 29 * result + (forceAsynchronous ? 0 : 1);
result =3D 29 * result + (forceSynchronous ? 0 : 1);
result =3D 29 * result + (lockAcquisitionTimeout);
+ result =3D 29 * result + (suppressPersistence ? 0 : 1);
return result;
}
=
@@ -338,6 +341,7 @@
this.forceAsynchronous =3D false;
this.forceSynchronous =3D false;
this.lockAcquisitionTimeout =3D -1;
+ this.suppressPersistence =3D false;
}
=
/**
@@ -426,4 +430,26 @@
{
this.groupRequestMode =3D groupRequestMode;
}
+
+ /**
+ * If set to true, any persistence to a cache loader will be suppressed=
for the current invocation only. Does not apply to transactional calls.
+ *
+ * @return true if persistence is suppressed.
+ * @since 3.0
+ */
+ public boolean isSuppressPersistence()
+ {
+ return suppressPersistence;
+ }
+
+ /**
+ * If set to true, any persistence to a cache loader will be suppressed=
for the current invocation only. Does not apply to transactional calls.
+ *
+ * @param suppressPersistence if true, will suppress persistence.
+ * @since 3.0
+ */
+ public void setSuppressPersistence(boolean suppressPersistence)
+ {
+ this.suppressPersistence =3D suppressPersistence;
+ }
}
Modified: core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreI=
nterceptor.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterce=
ptor.java 2008-08-06 00:56:02 UTC (rev 6523)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/CacheStoreInterce=
ptor.java 2008-08-06 00:57:16 UTC (rev 6524)
@@ -86,7 +86,7 @@
@Override
public boolean skipInterception(InvocationContext ctx, VisitableCommand=
command)
{
- if (!ctx.isOriginLocal() && loaderConfig.isShared())
+ if ((!ctx.isOriginLocal() && loaderConfig.isShared()) || ctx.getOpti=
onOverrides().isSuppressPersistence())
{
if (trace)
log.trace("Passing up method call and bypassing this intercept=
or since the cache loader is shared and this call originated remotely.");
Modified: core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultSta=
teTransferIntegrator.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTran=
sferIntegrator.java 2008-08-06 00:56:02 UTC (rev 6523)
+++ core/trunk/src/main/java/org/jboss/cache/statetransfer/DefaultStateTran=
sferIntegrator.java 2008-08-06 00:57:16 UTC (rev 6524)
@@ -12,11 +12,10 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.InternalNode;
-import org.jboss.cache.NodeFactory;
-import org.jboss.cache.Region;
+import org.jboss.cache.Node;
+import org.jboss.cache.NodeSPI;
import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.eviction.EvictedEventNode;
-import org.jboss.cache.eviction.NodeEventType;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.factories.annotations.Inject;
import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.invocation.InvocationContext;
@@ -42,24 +41,25 @@
private static final Log log =3D LogFactory.getLog(DefaultStateTransfer=
Integrator.class);
private static final boolean trace =3D log.isTraceEnabled();
=
- private CacheSPI cache;
+ private CacheSPI, ?> cache;
=
- private NodeFactory factory;
-
private Set internalFqns;
+ private Configuration cfg;
+ private boolean needToPersistState; // for JBCACHE-131
=
-
@Inject
- public void inject(CacheSPI, ?> cache, NodeFactory nodefactory)
+ public void inject(CacheSPI, ?> cache, Configuration cfg)
{
this.cache =3D cache;
- this.factory =3D nodefactory;
+ this.cfg =3D cfg;
}
=
@Start(priority =3D 14)
public void start()
{
this.internalFqns =3D cache.getInternalFqns();
+ needToPersistState =3D cfg.getCacheLoaderConfig() !=3D null && !cfg.=
getCacheLoaderConfig().isFetchPersistentState() &&
+ !cfg.getCacheLoaderConfig().isShared();
}
=
public void integrateState(ObjectInputStream ois, Object target, Fqn ta=
rgetRoot, boolean integratePersistentState) throws Exception
@@ -86,7 +86,7 @@
log.trace("integrating transient state for " + target);
}
=
- integrateTransientState(target, in);
+ integrateTransientState(target.getFqn(), in);
=
transientSet =3D true;
=
@@ -189,10 +189,23 @@
for (InternalNode n : children) notifyAllNodesCreated(ctx, n);
}
=
- private void integrateTransientState(InternalNode target, ObjectInputSt=
ream in) throws Exception
+ private void prepareContextOptions()
{
- target.removeChildren();
+ cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(=
true);
+ cache.getInvocationContext().getOptionOverrides().setSkipCacheStatus=
Check(true);
+ cache.getInvocationContext().getOptionOverrides().setSuppressPersist=
ence(!needToPersistState);
+ }
=
+ private void integrateTransientState(Fqn target, ObjectInputStream in) =
throws Exception
+ {
+ prepareContextOptions();
+ NodeSPI targetNode =3D cache.getNode(target);
+ for (Object childname : targetNode.getChildrenNames())
+ {
+ prepareContextOptions();
+ targetNode.removeChild(childname);
+ }
+
List list =3D readNodesAsList(in);
if (list !=3D null)
{
@@ -207,18 +220,20 @@
//are there any transient nodes at all?
if (nd !=3D null && !nd.isMarker())
{
- Map attributes =3D nd.getAttributes();
+ // with MVCC these calls should ALWAYS go up the intercepto=
r chain since no other locking
+ // takes place elsewhere.
+ prepareContextOptions();
+ cache.clearData(target);
+ prepareContextOptions();
+ cache.put(target, nd.getAttributes());
=
- target.setInternalState(attributes);
-
// Check whether this is an integration into the buddy back=
up
// subtree
Fqn tferFqn =3D nd.getFqn();
- Fqn tgtFqn =3D target.getFqn();
- boolean move =3D tgtFqn.isChildOrEquals(BuddyManager.BUDDY_=
BACKUP_SUBTREE_FQN)
- && !tferFqn.isChildOrEquals(tgtFqn);
+ boolean move =3D target.isChildOrEquals(BuddyManager.BUDDY_=
BACKUP_SUBTREE_FQN)
+ && !tferFqn.isChildOrEquals(target);
// If it is an integration, calculate how many levels of of=
fset
- int offset =3D move ? tgtFqn.size() - tferFqn.size() : 0;
+ int offset =3D move ? target.size() - tferFqn.size() : 0;
=
integrateStateTransferChildren(target, offset, nodeDataIter=
ator);
=
@@ -240,11 +255,11 @@
return (List) obj;
}
=
- private NodeData integrateStateTransferChildren(InternalNode parent, in=
t offset, Iterator nodeDataIterator)
+ private NodeData integrateStateTransferChildren(Fqn parentFqn, int offs=
et, Iterator nodeDataIterator)
throws IOException, ClassNotFoundException
{
- int parent_level =3D parent.getFqn().size();
- int target_level =3D parent_level + 1;
+ int parentLevel =3D parentFqn.size();
+ int targetLevel =3D parentLevel + 1;
Fqn fqn;
int size;
NodeData nd =3D nodeDataIterator.hasNext() ? nodeDataIterator.next()=
: null;
@@ -255,35 +270,28 @@
// change the Fqn to fit under it
if (offset > 0)
{
- fqn =3D Fqn.fromRelativeFqn(parent.getFqn().getAncestor(offset=
), fqn);
+ fqn =3D Fqn.fromRelativeFqn(parentFqn.getAncestor(offset), fqn=
);
}
size =3D fqn.size();
- if (size <=3D parent_level)
+ if (size <=3D parentLevel)
{
return nd;
}
- else if (size > target_level)
+ else if (size > targetLevel)
{
- throw new IllegalStateException("NodeData " + fqn + " is not a=
direct child of " + parent.getFqn());
+ throw new IllegalStateException("NodeData " + fqn + " is not a=
direct child of " + parentFqn);
}
=
Map attrs =3D nd.getAttributes();
=
- InternalNode internalTarget =3D factory.createInternalNode(fqn);
- internalTarget.setInternalState(attrs);
- parent.addChild(internalTarget);
+ prepareContextOptions();
+ cache.clearData(fqn);
+ prepareContextOptions();
+ cache.put(fqn, attrs);
=
- // JBCACHE-913
- Region region =3D cache.getRegion(fqn, false);
- if (region !=3D null && region.getEvictionPolicy() !=3D null)
- {
- region.putNodeEvent(new EvictedEventNode(fqn, NodeEventType.AD=
D_NODE_EVENT,
- attrs =3D=3D null ? 0 : attrs.size()));
- }
-
// Recursively call, which will walk down the tree
// and return the next NodeData that's a child of our parent
- nd =3D integrateStateTransferChildren(internalTarget, offset, nod=
eDataIterator);
+ nd =3D integrateStateTransferChildren(fqn, offset, nodeDataIterat=
or);
}
if (nd !=3D null && nd.isExceptionMarker())
{
@@ -294,18 +302,18 @@
return null;
}
=
- private Set retainInternalNodes(InternalNode target)
+ private Set retainInternalNodes(Fqn target)
{
- Set result =3D new HashSet();
- Fqn targetFqn =3D target.getFqn();
+ Set result =3D new HashSet();
for (Fqn internalFqn : internalFqns)
{
- if (internalFqn.isChildOf(targetFqn))
+ if (internalFqn.isChildOf(target))
{
- InternalNode internalNode =3D getInternalNode(target, internal=
Fqn);
- if (internalNode !=3D null)
+ prepareContextOptions();
+ Node node =3D getInternalNode(cache.getNode(target), internalF=
qn);
+ if (node !=3D null)
{
- result.add(internalNode);
+ result.add(node.getFqn());
}
}
}
@@ -313,10 +321,12 @@
return result;
}
=
- private InternalNode getInternalNode(InternalNode parent, Fqn internalF=
qn)
+ private Node getInternalNode(Node parentNode, Fqn internalFqn)
{
- Object name =3D internalFqn.get(parent.getFqn().size());
- InternalNode result =3D parent.getChild(name);
+ Fqn parentFqn =3D parentNode.getFqn();
+ Object name =3D internalFqn.get(parentFqn.size());
+ prepareContextOptions();
+ Node result =3D parentNode.getChild(name);
if (result !=3D null)
{
if (internalFqn.size() < result.getFqn().size())
@@ -328,29 +338,33 @@
return result;
}
=
- private void integrateRetainedNodes(InternalNode target)
+ private void integrateRetainedNodes(Fqn target)
{
- Set retainedNodes =3D retainInternalNodes(target);
- Fqn rootFqn =3D target.getFqn();
- for (InternalNode retained : retainedNodes)
+ Set retainedNodes =3D retainInternalNodes(target);
+ for (Fqn retained : retainedNodes)
{
- if (retained.getFqn().isChildOf(rootFqn))
+ if (retained.isChildOf(target))
{
integrateRetainedNode(target, retained);
}
}
}
=
- private void integrateRetainedNode(InternalNode ancestor, InternalNode =
descendant)
+
+ // TODO: What is this rubbish?!??
+ private void integrateRetainedNode(Fqn ancFqn, Fqn descFqn)
{
- Fqn descFqn =3D descendant.getFqn();
- Fqn ancFqn =3D ancestor.getFqn();
+ prepareContextOptions();
+ InternalNode ancestor =3D cache.getNode(ancFqn).getDelegationTarget(=
);
Object name =3D descFqn.get(ancFqn.size());
InternalNode child =3D ancestor.getChild(name);
if (ancFqn.size() =3D=3D descFqn.size() + 1)
{
if (child =3D=3D null)
{
+ prepareContextOptions();
+ InternalNode descendant =3D cache.getNode(descFqn).getDelegati=
onTarget();
+ prepareContextOptions();
ancestor.addChild(name, descendant);
}
else
@@ -373,7 +387,7 @@
}
=
// Keep walking down the tree
- integrateRetainedNode(child, descendant);
+ integrateRetainedNode(child.getFqn(), descFqn);
}
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/statetransfer/LegacyStat=
eTransferIntegrator.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/statetransfer/LegacyStateTrans=
ferIntegrator.java 2008-08-06 00:56:02 UTC (rev 6523)
+++ core/trunk/src/main/java/org/jboss/cache/statetransfer/LegacyStateTrans=
ferIntegrator.java 2008-08-06 00:57:16 UTC (rev 6524)
@@ -16,6 +16,7 @@
import org.jboss.cache.NodeSPI;
import org.jboss.cache.Region;
import org.jboss.cache.buddyreplication.BuddyManager;
+import org.jboss.cache.config.Configuration;
import org.jboss.cache.eviction.EvictedEventNode;
import org.jboss.cache.eviction.NodeEventType;
import org.jboss.cache.factories.annotations.Inject;
@@ -43,24 +44,26 @@
=
private static final Log log =3D LogFactory.getLog(LegacyStateTransferI=
ntegrator.class);
private static final boolean trace =3D log.isTraceEnabled();
-
private CacheSPI cache;
-
private NodeFactory factory;
-
private Set internalFqns;
+ private Configuration cfg;
+ private boolean usePut; // for JBCACHE-131
=
@Inject
- public void inject(CacheSPI, ?> cache, NodeFactory nodefactory)
+ public void inject(CacheSPI, ?> cache, NodeFactory nodefactory, Confi=
guration cfg)
{
this.cache =3D cache;
this.factory =3D nodefactory;
+ this.cfg =3D cfg;
}
=
@Start(priority =3D 14)
public void start()
{
this.internalFqns =3D cache.getInternalFqns();
+ usePut =3D cfg.getCacheLoaderConfig() !=3D null && !cfg.getCacheLoad=
erConfig().isFetchPersistentState() &&
+ !cfg.getCacheLoaderConfig().isShared();
}
=
public void integrateState(ObjectInputStream ois, Object target, Fqn ta=
rgetFqn, boolean integratePersistentState) throws Exception
@@ -212,9 +215,20 @@
if (nd !=3D null && !nd.isMarker())
{
Map attributes =3D nd.getAttributes();
+ if (usePut)
+ {
+ cache.getInvocationContext().getOptionOverrides().setCac=
heModeLocal(true);
+ cache.getInvocationContext().getOptionOverrides().setSki=
pCacheStatusCheck(true);
+ target.clearData();
+ cache.getInvocationContext().getOptionOverrides().setCac=
heModeLocal(true);
+ cache.getInvocationContext().getOptionOverrides().setSki=
pCacheStatusCheck(true);
+ target.putAll(attributes);
+ }
+ else
+ {
+ target.setInternalState(attributes);
+ }
=
- target.setInternalState(attributes);
-
// Check whether this is an integration into the buddy back=
up
// subtree
Fqn tferFqn =3D nd.getFqn();
@@ -276,16 +290,29 @@
=
// We handle this NodeData. Create a TreeNode and
// integrate its data
- NodeSPI target =3D factory.createNode(fqn, parent, attrs);
- parent.addChild(fqn.getLastElement(), target);
-
- // JBCACHE-913
- Region region =3D cache.getRegion(fqn, false);
- if (region !=3D null && region.getEvictionPolicy() !=3D null)
+ NodeSPI target;
+ if (usePut)
{
- region.putNodeEvent(new EvictedEventNode(fqn, NodeEventType.AD=
D_NODE_EVENT,
- attrs =3D=3D null ? 0 : attrs.size()));
+ cache.getInvocationContext().getOptionOverrides().setCacheMode=
Local(true);
+ cache.getInvocationContext().getOptionOverrides().setSkipCache=
StatusCheck(true);
+ cache.clearData(fqn);
+ cache.getInvocationContext().getOptionOverrides().setCacheMode=
Local(true);
+ cache.getInvocationContext().getOptionOverrides().setSkipCache=
StatusCheck(true);
+ cache.put(fqn, attrs);
+ target =3D cache.getNode(fqn);
}
+ else
+ {
+ target =3D factory.createNode(fqn, parent, attrs);
+ parent.addChild(fqn.getLastElement(), target);
+ // JBCACHE-913
+ Region region =3D cache.getRegion(fqn, false);
+ if (region !=3D null && region.getEvictionPolicy() !=3D null)
+ {
+ region.putNodeEvent(new EvictedEventNode(fqn, NodeEventType=
.ADD_NODE_EVENT,
+ attrs =3D=3D null ? 0 : attrs.size()));
+ }
+ }
=
// Recursively call, which will walk down the tree
// and return the next NodeData that's a child of our parent
Modified: core/trunk/src/main/java/org/jboss/cache/statetransfer/LegacyStat=
eTransferManager.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/statetransfer/LegacyStateTrans=
ferManager.java 2008-08-06 00:56:02 UTC (rev 6523)
+++ core/trunk/src/main/java/org/jboss/cache/statetransfer/LegacyStateTrans=
ferManager.java 2008-08-06 00:57:16 UTC (rev 6524)
@@ -5,6 +5,7 @@
import org.jboss.cache.NodeSPI;
import org.jboss.cache.RegionEmptyException;
import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.lock.LockManager;
import static org.jboss.cache.lock.LockType.READ;
import org.jboss.cache.lock.TimeoutException;
@@ -23,6 +24,7 @@
public class LegacyStateTransferManager extends DefaultStateTransferManager
{
protected LockManager lockManager;
+ private boolean usePut; // for JBCACHE-131
=
@Inject
public void injectLockManager(LockManager lockManager)
@@ -30,6 +32,13 @@
this.lockManager =3D lockManager;
}
=
+ @Start(priority =3D 14)
+ public void checkLoaders()
+ {
+ usePut =3D configuration.getCacheLoaderConfig() !=3D null && !config=
uration.getCacheLoaderConfig().isFetchPersistentState() &&
+ !configuration.getCacheLoaderConfig().isShared();
+ }
+
@Override
public void getState(ObjectOutputStream out, Fqn fqn, long timeout, boo=
lean force, boolean suppressErrors) throws Exception
{
@@ -136,6 +145,7 @@
=
protected void acquireLocksForStateTransfer(NodeSPI root, long timeout,=
boolean force) throws InterruptedException
{
+ if (usePut) return;
try
{
lockManager.lockAll(root, READ, getLockOwner(), timeout, true);
@@ -157,6 +167,7 @@
=
protected void releaseStateTransferLocks(NodeSPI root)
{
+ if (usePut) return;
try
{
lockManager.unlockAll(root, getLockOwner());
Added: core/trunk/src/test/java/org/jboss/cache/api/mvcc/PersistingTransien=
tStateTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/test/java/org/jboss/cache/api/mvcc/PersistingTransientSt=
ateTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/api/mvcc/PersistingTransientSt=
ateTest.java 2008-08-06 00:57:16 UTC (rev 6524)
@@ -0,0 +1,13 @@
+package org.jboss.cache.api.mvcc;
+
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.testng.annotations.Test;
+
+(a)Test(groups =3D "functional")
+public class PersistingTransientStateTest extends org.jboss.cache.statetra=
nsfer.PersistingTransientStateTest
+{
+ public PersistingTransientStateTest()
+ {
+ nls =3D NodeLockingScheme.MVCC;
+ }
+}
\ No newline at end of file
Added: core/trunk/src/test/java/org/jboss/cache/optimistic/PersistingTransi=
entStateTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/test/java/org/jboss/cache/optimistic/PersistingTransient=
StateTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/optimistic/PersistingTransient=
StateTest.java 2008-08-06 00:57:16 UTC (rev 6524)
@@ -0,0 +1,13 @@
+package org.jboss.cache.optimistic;
+
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.testng.annotations.Test;
+
+(a)Test(groups =3D "functional")
+public class PersistingTransientStateTest extends org.jboss.cache.statetra=
nsfer.PersistingTransientStateTest
+{
+ public PersistingTransientStateTest()
+ {
+ nls =3D NodeLockingScheme.OPTIMISTIC;
+ }
+}
Added: core/trunk/src/test/java/org/jboss/cache/statetransfer/PersistingTra=
nsientStateTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/test/java/org/jboss/cache/statetransfer/PersistingTransi=
entStateTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/statetransfer/PersistingTransi=
entStateTest.java 2008-08-06 00:57:16 UTC (rev 6524)
@@ -0,0 +1,113 @@
+package org.jboss.cache.statetransfer;
+
+import org.jboss.cache.Cache;
+import org.jboss.cache.CacheFactory;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.config.CacheLoaderConfig;
+import org.jboss.cache.config.CacheLoaderConfig.IndividualCacheLoaderConfi=
g;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.Configuration.CacheMode;
+import org.jboss.cache.config.Configuration.NodeLockingScheme;
+import org.jboss.cache.loader.CacheLoader;
+import org.jboss.cache.loader.DummyInMemoryCacheLoader;
+import org.jboss.cache.transaction.DummyTransactionManagerLookup;
+import org.jboss.cache.util.TestingUtil;
+import org.testng.annotations.Test;
+
+/**
+ * Transient state SHOULD be persisted on the receiving cache IF fetchPers=
istentState is FALSE and the cache loader
+ * is NOT shared.
+ *
+ * Needs to be tested with PL, OL and MVCC.
+ *
+ * Pertains to JBCACHE-131
+ *
+ */
+(a)Test(groups =3D "functional")
+public class PersistingTransientStateTest
+{
+ protected NodeLockingScheme nls =3D NodeLockingScheme.PESSIMISTIC;
+ protected Fqn fqn =3D Fqn.fromString("/a/b/c");
+ protected String k =3D "k", v =3D "v";
+
+ public void testPersistentStateTransfer() throws Exception
+ {
+ Cache c1 =3D null, c2 =3D null;
+ try
+ {
+ CacheFactory cf =3D new DefaultCacheFactory();
+ Configuration cfg =3D new Configuration();
+ cfg.setTransactionManagerLookupClass(DummyTransactionManagerLooku=
p.class.getName());
+ cfg.setCacheMode(CacheMode.REPL_SYNC);
+ cfg.setFetchInMemoryState(true);
+ // configure with CL
+ IndividualCacheLoaderConfig iclc =3D new IndividualCacheLoaderCon=
fig();
+ iclc.setClassName(DummyInMemoryCacheLoader.class.getName());
+ iclc.setFetchPersistentState(false);
+ CacheLoaderConfig clc =3D new CacheLoaderConfig();
+ clc.addIndividualCacheLoaderConfig(iclc);
+
+ cfg.setCacheLoaderConfig(clc);
+ cfg.setNodeLockingScheme(nls);
+
+ c1 =3D cf.createCache(cfg.clone());
+ c1.put(fqn, k, v);
+
+ assert c1.get(fqn, k).equals(v);
+ assert getLoader(c1).get(fqn).get(k).equals(v);
+
+ c2 =3D cf.createCache(cfg.clone());
+ assert c2.get(fqn, k).equals(v);
+ assert getLoader(c2).get(fqn).get(k).equals(v);
+ }
+ finally
+ {
+ TestingUtil.killCaches(c1, c2);
+ }
+ }
+
+ public void testPersistentStateTransferShared() throws Exception
+ {
+ Cache c1 =3D null, c2 =3D null;
+ try
+ {
+ CacheFactory cf =3D new DefaultCacheFactory();
+ Configuration cfg =3D new Configuration();
+ cfg.setTransactionManagerLookupClass(DummyTransactionManagerLooku=
p.class.getName());
+ cfg.setCacheMode(CacheMode.REPL_SYNC);
+ cfg.setFetchInMemoryState(true);
+ // configure with CL
+ IndividualCacheLoaderConfig iclc =3D new IndividualCacheLoaderCon=
fig();
+ iclc.setClassName(DummyInMemoryCacheLoader.class.getName());
+ iclc.setFetchPersistentState(false);
+ CacheLoaderConfig clc =3D new CacheLoaderConfig();
+ clc.addIndividualCacheLoaderConfig(iclc);
+ clc.setShared(true); // even though it isn't really a shared CL
+
+ cfg.setCacheLoaderConfig(clc);
+ cfg.setNodeLockingScheme(nls);
+
+ c1 =3D cf.createCache(cfg.clone());
+ c1.put(fqn, k, v);
+
+ assert c1.get(fqn, k).equals(v);
+ assert getLoader(c1).get(fqn).get(k).equals(v);
+
+ c2 =3D cf.createCache(cfg.clone());
+ assert c2.get(fqn, k).equals(v);
+ assert getLoader(c2).get(fqn) =3D=3D null;
+ }
+ finally
+ {
+ TestingUtil.killCaches(c1, c2);
+ }
+ }
+
+ protected CacheLoader getLoader(Cache, ?> c)
+ {
+ return ((CacheSPI) c).getCacheLoaderManager().getCacheLoader();
+ }
+
+}
--===============6407481266588456054==--
From jboss-qa-internal at redhat.com Wed Aug 6 03:15:42 2008
Content-Type: multipart/mixed; boundary="===============2916013058963820014=="
MIME-Version: 1.0
From: jboss-qa-internal at redhat.com
To: jbosscache-commits at lists.jboss.org
Subject: =?utf-8?q?=5Bjbosscache-commits=5D_Hudson_build_is_still_unstable=3A_jbos?=
=?utf-8?q?s-cache-core-trunk-jdk1=2E5_=C2=BB_JBoss_Cache_-_Core_Edition_?=
=?utf-8?q?=23539?=
Date: Wed, 06 Aug 2008 03:15:38 -0400
Message-ID: <228017621.16231218006938506.JavaMail.hudson@hudson1.qa.atl2.redhat.com>
In-Reply-To: 172593533.14291217954172555.JavaMail.hudson@hudson1.qa.atl2.redhat.com
--===============2916013058963820014==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
See http://hudson.qa.jboss.com/hudson/job/jboss-cache-core-trunk-jdk1.5/org=
.jboss.cache$jbosscache-core/539/changes
--===============2916013058963820014==--
From jboss-qa-internal at redhat.com Wed Aug 6 03:56:53 2008
Content-Type: multipart/mixed; boundary="===============4885766231713919094=="
MIME-Version: 1.0
From: jboss-qa-internal at redhat.com
To: jbosscache-commits at lists.jboss.org
Subject: =?utf-8?q?=5Bjbosscache-commits=5D_Hudson_build_is_still_unstable=3A_jbos?=
=?utf-8?q?s-cache-core-trunk-jdk1=2E6_=C2=BB_JBoss_Cache_-_Core_Edition_?=
=?utf-8?q?=23406?=
Date: Wed, 06 Aug 2008 03:56:50 -0400
Message-ID: <115549049.16281218009410492.JavaMail.hudson@hudson1.qa.atl2.redhat.com>
In-Reply-To: 2131242718.14741217957890673.JavaMail.hudson@hudson1.qa.atl2.redhat.com
--===============4885766231713919094==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
See http://hudson.qa.jboss.com/hudson/job/jboss-cache-core-trunk-jdk1.6/org=
.jboss.cache$jbosscache-core/406/changes
--===============4885766231713919094==--
From jbosscache-commits at lists.jboss.org Wed Aug 6 04:21:48 2008
Content-Type: multipart/mixed; boundary="===============7482614681332309961=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6525 - in searchable/trunk:
src/main/java/org/jboss/cache/search and 4 other directories.
Date: Wed, 06 Aug 2008 04:21:48 -0400
Message-ID:
--===============7482614681332309961==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: navssurtani
Date: 2008-08-06 04:21:48 -0400 (Wed, 06 Aug 2008)
New Revision: 6525
Modified:
searchable/trunk/TODO.txt
searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityId.java
searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityLoader.=
java
searchable/trunk/src/main/java/org/jboss/cache/search/CacheQuery.java
searchable/trunk/src/main/java/org/jboss/cache/search/CacheQueryImpl.java
searchable/trunk/src/main/java/org/jboss/cache/search/InvalidFqnExceptio=
n.java
searchable/trunk/src/main/java/org/jboss/cache/search/InvalidKeyExceptio=
n.java
searchable/trunk/src/main/java/org/jboss/cache/search/NodeModifiedTransa=
ctionContext.java
searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionCon=
text.java
searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIterato=
rImpl.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCache.ja=
va
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheCon=
figuration.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFac=
tory.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheImp=
l.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCoreList=
ener.java
searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoList=
ener.java
searchable/trunk/src/main/java/org/jboss/cache/search/Transformer.java
searchable/trunk/src/test/java/org/jboss/cache/search/CacheEntityIdTest.=
java
searchable/trunk/src/test/java/org/jboss/cache/search/NodeModifiedTransa=
ctionContextTest.java
searchable/trunk/src/test/java/org/jboss/cache/search/QueryResultIterato=
rImplTest.java
searchable/trunk/src/test/java/org/jboss/cache/search/SearchableCacheImp=
lTest.java
searchable/trunk/src/test/java/org/jboss/cache/search/TransformerTest.ja=
va
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/BrokenAnn=
otationTest.java
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/Clustered=
CacheTest.java
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCach=
eTest.java
searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalPOJO=
CacheTest.java
searchable/trunk/src/test/java/org/jboss/cache/search/helper/IndexCleanU=
p.java
searchable/trunk/src/test/java/org/jboss/cache/search/test/BrokenDocumen=
tId.java
searchable/trunk/src/test/java/org/jboss/cache/search/test/BrokenProvide=
d.java
searchable/trunk/src/test/java/org/jboss/cache/search/test/Person.java
Log:
Changed @author in classes to * @author Navin Surtani (nsurtani(a)redhat.com)
Modified: searchable/trunk/TODO.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/TODO.txt 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/TODO.txt 2008-08-06 08:21:48 UTC (rev 6525)
@@ -6,8 +6,6 @@
=
So that when a large amount of hits are there, they can be loaded when req=
uired.
=
-3 - Deal with Lucene Filters and Sorting.
-
4 - Non-string keys.
=
Think.
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntity=
Id.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityId.jav=
a 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityId.jav=
a 2008-08-06 08:21:48 UTC (rev 6525)
@@ -5,8 +5,7 @@
/**
*
* This class is used to get fqns, keys and documentId's by calling method=
s on {@link org.jboss.cache.search.Transformer}
- *
- @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
public class CacheEntityId
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntity=
Loader.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityLoader=
.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/CacheEntityLoader=
.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -9,8 +9,7 @@
=
/**
* Class that is used to load objects from a list of CacheEntityId ids.
- *
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
public class CacheEntityLoader
{
@@ -30,6 +29,7 @@
*/
public List load(List ids)
{
+ if (ids =3D=3D null) throw new NullPointerException("ids are null");
List retVal =3D new ArrayList(ids.size());
=
for (CacheEntityId id: ids)
@@ -48,6 +48,7 @@
*/
public Object load(CacheEntityId id)
{
+ if (id =3D=3D null) throw new NullPointerException("id is null");
return cache.get(id.getFqn(), id.getKey());
}
=
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/CacheQuery.=
java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/main/java/org/jboss/cache/search/CacheQuery.java 2=
008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/CacheQuery.java 2=
008-08-06 08:21:48 UTC (rev 6525)
@@ -32,6 +32,15 @@
QueryResultIterator iterator();
=
/**
+ * Lazily loads the results from the Query as a {@link org.jboss.cache.=
search.QueryResultIterator}
+ *
+ * @return a QueryResultIterator which can be used to lazily ite=
rate through results.
+ */
+
+ QueryResultIterator lazyIterator();
+
+
+ /**
* Sets a result with a given index to the first result.
*
* @param index of result to be set to the first.
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/CacheQueryI=
mpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/main/java/org/jboss/cache/search/CacheQueryImpl.ja=
va 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/CacheQueryImpl.ja=
va 2008-08-06 08:21:48 UTC (rev 6525)
@@ -35,12 +35,11 @@
/**
* Implementation class of the CacheQuery interface.
*
- *
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
public class CacheQueryImpl implements CacheQuery
{
-// private Cache cache; - Removed on 11/07/2008, cache is assigned but n=
ever used. Hence removed.
+ // private Cache cache; - Removed on 11/07/2008, cache is assigned bu=
t never used. Hence removed.
private Class[] classes;
private Sort sort;
private Filter filter;
@@ -85,7 +84,6 @@
}
=
=
-
/**
* @return The result size of the query.
*/
@@ -241,6 +239,27 @@
return new QueryResultIteratorImpl(ids, entityLoader);
}
=
+ public QueryResultIterator lazyIterator()
+ {
+ IndexSearcher searcher =3D buildSearcher(searchFactory);
+
+ try
+ {
+ Hits hits =3D getHits(searcher);
+ int first =3D first();
+ int max =3D max(first, hits);
+
+ DocumentExtractor extractor =3D new DocumentExtractor(luceneQuery=
, searcher, searchFactory, indexProjection);
+ =
+ }
+ catch (IOException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use Fil=
e | Settings | File Templates.
+ }
+
+ return null;
+ }
+
/**
* Returns a the results from the query as a List object.
*
@@ -423,7 +442,7 @@
}
=
private void populateDirectories(List directories, D=
irectoryProvider[] directoryProviders)
- =
+
{
for (DirectoryProvider provider : directoryProviders)
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/InvalidFqnE=
xception.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/main/java/org/jboss/cache/search/InvalidFqnExcepti=
on.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/InvalidFqnExcepti=
on.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -5,8 +5,7 @@
/**
* Thrown when an invalid Fqn is passed into {@link org.jboss.cache.search=
.Transformer#generateId(org.jboss.cache.Fqn, String)}
*
- *
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
public class InvalidFqnException extends CacheException
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/InvalidKeyE=
xception.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/main/java/org/jboss/cache/search/InvalidKeyExcepti=
on.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/InvalidKeyExcepti=
on.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -1,7 +1,7 @@
package org.jboss.cache.search;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurta=
ni(a)redhat.com)
*/
public class InvalidKeyException extends Exception
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/NodeModifie=
dTransactionContext.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/main/java/org/jboss/cache/search/NodeModifiedTrans=
actionContext.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/NodeModifiedTrans=
actionContext.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -12,7 +12,7 @@
*
* It is used by the {@link SearchableCoreListener} to pass transaction in=
formation to a Hibernate Search {@link org.hibernate.search.backend.Work} o=
bject.
*
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
* @see SearchableCoreListener
*/
public class NodeModifiedTransactionContext implements TransactionContext
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransac=
tionContext.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionCo=
ntext.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/PojoTransactionCo=
ntext.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -7,7 +7,7 @@
//import javax.transaction.Transaction;
//
///**
-// * @author Navin Surtani - navin(a)surtani.org
+// * @author Navin Surtani (nsurt=
ani(a)redhat.com)
// */
//public class PojoTransactionContext implements TransactionContext
//{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/QueryResult=
IteratorImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIterat=
orImpl.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/QueryResultIterat=
orImpl.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -9,7 +9,7 @@
* This is the implementation class for the interface QueryResultIterator =
which extends ListIterator. It is what is
* returned when the iterator() method is run on a CacheQuery instance.
*
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
public class QueryResultIteratorImpl implements QueryResultIterator
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableC=
ache.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCache.j=
ava 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCache.j=
ava 2008-08-06 08:21:48 UTC (rev 6525)
@@ -4,7 +4,7 @@
import org.jboss.cache.Cache;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*
* This will be the most used interface in JBossCache searchable. =
It extends Cache and therefore will have
* the standard get(), put() and remove() methods. The additional =
method is the createQuery method which people
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableC=
acheConfiguration.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheCo=
nfiguration.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheCo=
nfiguration.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -14,7 +14,7 @@
* Class that implements {@link org.hibernate.search.cfg.SearchConfigurati=
on} so that within JBossCache Searchable, there is no
* need for a Hibernate Core configuration object.
*
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
public class SearchableCacheConfiguration implements SearchConfiguration
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableC=
acheFactory.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFa=
ctory.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheFa=
ctory.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -12,7 +12,7 @@
import java.lang.reflect.Field;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
public class SearchableCacheFactory
{
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableC=
acheImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheIm=
pl.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCacheIm=
pl.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -19,7 +19,7 @@
import java.util.Set;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*
* Implementation class for the SearchableCache interface.
*/
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableC=
oreListener.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCoreLis=
tener.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchableCoreLis=
tener.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -14,7 +14,7 @@
import java.util.Map;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*
* Listener class for changes made to the cache. This listener makes chang=
es if it is a org.jboss.cache being used. =
*/
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/SearchableP=
ojoListener.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoLis=
tener.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/SearchablePojoLis=
tener.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -10,7 +10,7 @@
import javax.transaction.Transaction;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
=
//@PojoCacheListener
Modified: searchable/trunk/src/main/java/org/jboss/cache/search/Transformer=
.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/main/java/org/jboss/cache/search/Transformer.java =
2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/main/java/org/jboss/cache/search/Transformer.java =
2008-08-06 08:21:48 UTC (rev 6525)
@@ -3,8 +3,8 @@
import org.jboss.cache.Fqn;
=
/**
-(a)author Navin Surtani - navin(a)surtani.org
-
+* @author Navin Surtani (nsurtani=
(a)redhat.com)
+*
* This class is one that does all the 'conversion' work between JBossCache=
and Hibernate Search. This is where
* users can switch from Fqn and key to a documentId and vice versa.
*
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/CacheEntity=
IdTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/test/java/org/jboss/cache/search/CacheEntityIdTest=
.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/CacheEntityIdTest=
.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -5,7 +5,7 @@
import org.jboss.cache.search.CacheEntityId;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
=
@Test
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/NodeModifie=
dTransactionContextTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/test/java/org/jboss/cache/search/NodeModifiedTrans=
actionContextTest.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/NodeModifiedTrans=
actionContextTest.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -3,7 +3,7 @@
import org.testng.annotations.Test;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
=
@Test
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/QueryResult=
IteratorImplTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/test/java/org/jboss/cache/search/QueryResultIterat=
orImplTest.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/QueryResultIterat=
orImplTest.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -11,7 +11,7 @@
import java.util.Map;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*
* Test class for the QueryResultIteratorImpl
*/
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/SearchableC=
acheImplTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/test/java/org/jboss/cache/search/SearchableCacheIm=
plTest.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/SearchableCacheIm=
plTest.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -5,7 +5,7 @@
import org.jboss.cache.DefaultCacheFactory;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
=
@Test (groups =3D "functional")
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/Transformer=
Test.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/test/java/org/jboss/cache/search/TransformerTest.j=
ava 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/TransformerTest.j=
ava 2008-08-06 08:21:48 UTC (rev 6525)
@@ -4,7 +4,7 @@
import org.testng.annotations.Test;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*
* Unit-test class for the Transformer class.
*/
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/Br=
okenAnnotationTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/BrokenAn=
notationTest.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/BrokenAn=
notationTest.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -9,7 +9,7 @@
import org.jboss.cache.DefaultCacheFactory;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
@Test (groups =3D "functional")
public class BrokenAnnotationTest
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/Cl=
usteredCacheTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/Clustere=
dCacheTest.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/Clustere=
dCacheTest.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -22,7 +22,7 @@
import java.util.List;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
@Test(groups =3D "functional")
public class ClusteredCacheTest
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/Lo=
calCacheTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCac=
heTest.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalCac=
heTest.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -25,7 +25,7 @@
import java.io.File;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
=
@Test(groups =3D "functional")
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/Lo=
calPOJOCacheTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalPOJ=
OCacheTest.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/blackbox/LocalPOJ=
OCacheTest.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -28,7 +28,7 @@
* instead of cache.put() and cache.remove().
*
*
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
=
@Test(groups =3D "functional", enabled =3D false)
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/helper/Inde=
xCleanUp.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/test/java/org/jboss/cache/search/helper/IndexClean=
Up.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/helper/IndexClean=
Up.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -5,7 +5,7 @@
import java.io.File;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
public class IndexCleanUp
{
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/test/Broken=
DocumentId.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/test/java/org/jboss/cache/search/test/BrokenDocume=
ntId.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/test/BrokenDocume=
ntId.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -6,7 +6,7 @@
import org.hibernate.search.annotations.Field;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
@ProvidedId
@Indexed
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/test/Broken=
Provided.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/test/java/org/jboss/cache/search/test/BrokenProvid=
ed.java 2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/test/BrokenProvid=
ed.java 2008-08-06 08:21:48 UTC (rev 6525)
@@ -5,7 +5,7 @@
import org.hibernate.search.annotations.Field;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
@Indexed
public class BrokenProvided
Modified: searchable/trunk/src/test/java/org/jboss/cache/search/test/Person=
.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- searchable/trunk/src/test/java/org/jboss/cache/search/test/Person.java =
2008-08-06 00:57:16 UTC (rev 6524)
+++ searchable/trunk/src/test/java/org/jboss/cache/search/test/Person.java =
2008-08-06 08:21:48 UTC (rev 6525)
@@ -9,7 +9,7 @@
import java.io.Serializable;
=
/**
- * @author Navin Surtani - navin(a)surtani.org
+ * @author Navin Surtani (nsurtan=
i(a)redhat.com)
*/
@ProvidedId
@Indexed
--===============7482614681332309961==--
From jbosscache-commits at lists.jboss.org Wed Aug 6 05:22:45 2008
Content-Type: multipart/mixed; boundary="===============1563581414284751246=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6526 -
core/trunk/src/test/java/org/jboss/cache/buddyreplication.
Date: Wed, 06 Aug 2008 05:22:45 -0400
Message-ID:
--===============1563581414284751246==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: mircea.markus
Date: 2008-08-06 05:22:45 -0400 (Wed, 06 Aug 2008)
New Revision: 6526
Added:
core/trunk/src/test/java/org/jboss/cache/buddyreplication/MvccBuddyRepli=
cationTest.java
Log:
added ut for MVCC buddy failure
Added: core/trunk/src/test/java/org/jboss/cache/buddyreplication/MvccBuddyR=
eplicationTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/MvccBuddyRepl=
icationTest.java (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/MvccBuddyRepl=
icationTest.java 2008-08-06 09:22:45 UTC (rev 6526)
@@ -0,0 +1,77 @@
+/*
+ * 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.buddyreplication;
+
+import org.jboss.cache.DefaultCacheFactory;
+import org.jboss.cache.Cache;
+import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
+import org.jboss.cache.lock.IsolationLevel;
+import org.jboss.cache.config.Option;
+import org.jboss.cache.config.Configuration;
+import org.jboss.cache.config.BuddyReplicationConfig;
+import org.jboss.cache.config.parsing.XmlConfigurationParser;
+import org.testng.annotations.Test;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.AfterMethod;
+
+import java.util.Properties;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Mircea.Markus(a)jboss.com
+ * @since 3.0
+ */
+(a)Test(groups =3D "functionl")
+public class MvccBuddyReplicationTest
+{
+ private static final String FILE =3D "configs/mvcc-repl-sync-br.xml";
+
+ Configuration configuration;
+
+ public void testSimpleFailure() throws InterruptedException
+ {
+ Cache cache1 =3D createCache();
+ Thread.sleep(1000);
+ Cache cache2 =3D createCache();
+
+ cache1.put("/test", "key", "value");
+ cache1.stop();
+
+ Option option =3D cache2.getInvocationContext().getOptionOverrides();
+ option.setForceDataGravitation(true);
+ try
+ {
+ assert cache2.get("/test", "key").equals("value");
+ } finally
+ {
+ cache2.stop();
+ }
+ }
+
+ private Cache createCache()
+ {
+ Configuration fileConfig =3D new XmlConfigurationParser().parseFile(=
FILE);
+ DefaultCacheFactory dcf =3D new DefaultCacheFactory();
+ return dcf.createCache(fileConfig);
+ }
+}
--===============1563581414284751246==--
From jbosscache-commits at lists.jboss.org Wed Aug 6 05:23:42 2008
Content-Type: multipart/mixed; boundary="===============2827168153234682644=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6527 -
core/trunk/src/test/resources/configs.
Date: Wed, 06 Aug 2008 05:23:42 -0400
Message-ID:
--===============2827168153234682644==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: mircea.markus
Date: 2008-08-06 05:23:41 -0400 (Wed, 06 Aug 2008)
New Revision: 6527
Added:
core/trunk/src/test/resources/configs/mvcc-repl-sync-br.xml
Log:
added ut for MVCC buddy failure
Added: core/trunk/src/test/resources/configs/mvcc-repl-sync-br.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/test/resources/configs/mvcc-repl-sync-br.xml =
(rev 0)
+++ core/trunk/src/test/resources/configs/mvcc-repl-sync-br.xml 2008-08-06 =
09:23:41 UTC (rev 6527)
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ numBuddies =3D 1
+ ignoreColocatedBuddies =3D true
+
+
+
+
+
--===============2827168153234682644==--
From jbosscache-commits at lists.jboss.org Wed Aug 6 10:37:51 2008
Content-Type: multipart/mixed; boundary="===============0433623226083987161=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6528 -
core/trunk/src/test/java/org/jboss/cache/buddyreplication.
Date: Wed, 06 Aug 2008 10:37:50 -0400
Message-ID:
--===============0433623226083987161==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-06 10:37:50 -0400 (Wed, 06 Aug 2008)
New Revision: 6528
Modified:
core/trunk/src/test/java/org/jboss/cache/buddyreplication/MvccBuddyRepli=
cationTest.java
Log:
Improved test
Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/MvccBud=
dyReplicationTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/MvccBuddyRepl=
icationTest.java 2008-08-06 09:23:41 UTC (rev 6527)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/MvccBuddyRepl=
icationTest.java 2008-08-06 14:37:50 UTC (rev 6528)
@@ -21,57 +21,50 @@
*/
package org.jboss.cache.buddyreplication;
=
-import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.Cache;
-import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
-import org.jboss.cache.lock.IsolationLevel;
-import org.jboss.cache.config.Option;
+import org.jboss.cache.DefaultCacheFactory;
import org.jboss.cache.config.Configuration;
-import org.jboss.cache.config.BuddyReplicationConfig;
+import org.jboss.cache.config.Option;
import org.jboss.cache.config.parsing.XmlConfigurationParser;
+import org.jboss.cache.util.TestingUtil;
import org.testng.annotations.Test;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.AfterMethod;
=
-import java.util.Properties;
-import java.util.List;
-import java.util.ArrayList;
-
/**
* @author Mircea.Markus(a)jboss.com
* @since 3.0
*/
-(a)Test(groups =3D "functionl")
+(a)Test(groups =3D "functional")
public class MvccBuddyReplicationTest
{
private static final String FILE =3D "configs/mvcc-repl-sync-br.xml";
=
- Configuration configuration;
-
- public void testSimpleFailure() throws InterruptedException
+ public void testSimpleFailure()
{
- Cache cache1 =3D createCache();
- Thread.sleep(1000);
- Cache cache2 =3D createCache();
-
- cache1.put("/test", "key", "value");
- cache1.stop();
-
- Option option =3D cache2.getInvocationContext().getOptionOverrides();
- option.setForceDataGravitation(true);
+ Cache cache1 =3D null, cache2 =3D null;
try
{
+ cache1 =3D createCache();
+ TestingUtil.sleepThread(1000);
+ cache2 =3D createCache();
+
+ cache1.put("/test", "key", "value");
+ cache1.stop();
+
+ Option option =3D cache2.getInvocationContext().getOptionOverride=
s();
+ option.setForceDataGravitation(true);
assert cache2.get("/test", "key").equals("value");
- } finally
+ }
+ finally
{
- cache2.stop();
+ TestingUtil.killCaches(cache1, cache2);
+
}
}
=
- private Cache createCache()
+ private Cache createCache()
{
Configuration fileConfig =3D new XmlConfigurationParser().parseFile(=
FILE);
- DefaultCacheFactory dcf =3D new DefaultCacheFactory();
+ DefaultCacheFactory dcf =3D new DefaultCacheFactory<=
String, String>();
return dcf.createCache(fileConfig);
}
}
--===============0433623226083987161==--
From jbosscache-commits at lists.jboss.org Wed Aug 6 10:42:03 2008
Content-Type: multipart/mixed; boundary="===============8739036797077814852=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6529 - in core/trunk/src:
main/java/org/jboss/cache/factories and 3 other directories.
Date: Wed, 06 Aug 2008 10:42:03 -0400
Message-ID:
--===============8739036797077814852==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-06 10:42:03 -0400 (Wed, 06 Aug 2008)
New Revision: 6529
Added:
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInte=
rceptor.java
core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyDataGravitat=
orInterceptor.java
Removed:
core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInte=
rceptor.java
Modified:
core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFacto=
ry.java
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicati=
onConfigTest.java
core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFacto=
ryTest.java
Log:
Fixed broken data gravitation with MVCC
Modified: core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java 2008-08=
-06 14:37:50 UTC (rev 6528)
+++ core/trunk/src/main/java/org/jboss/cache/DataContainerImpl.java 2008-08=
-06 14:42:03 UTC (rev 6529)
@@ -219,6 +219,26 @@
=
public List buildNodeData(List list, NodeSPI node, =
boolean mapSafe)
{
+ if (usingMvcc)
+ return buildNodeData(list, node.getDelegationTarget(), mapSafe);
+ else
+ return buildNodeDataLegacy(list, node, mapSafe);
+ }
+
+ private List buildNodeData(List list, InternalNode<=
?, ?> node, boolean mapSafe)
+ {
+ NodeData data =3D new NodeData(buddyFqnTransformer.getActualFqn(node=
.getFqn()), node.getData(), mapSafe);
+ list.add(data);
+ for (InternalNode childNode : node.getChildrenMap().values())
+ {
+ buildNodeData(list, childNode, true);
+ }
+ return list;
+ }
+
+ @Deprecated
+ private List buildNodeDataLegacy(List list, NodeSPI=
node, boolean mapSafe)
+ {
NodeData data =3D new NodeData(buddyFqnTransformer.getActualFqn(node=
.getFqn()), node.getDataDirect(), mapSafe);
list.add(data);
for (Object childNode : node.getChildrenDirect())
Modified: core/trunk/src/main/java/org/jboss/cache/factories/InterceptorCha=
inFactory.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFact=
ory.java 2008-08-06 14:37:50 UTC (rev 6528)
+++ core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFact=
ory.java 2008-08-06 14:42:03 UTC (rev 6529)
@@ -132,8 +132,14 @@
}
=
if (configuration.isUsingBuddyReplication())
- interceptorChain.appendIntereceptor(createInterceptor(DataGravita=
torInterceptor.class));
+ {
+ if (configuration.getNodeLockingScheme() =3D=3D NodeLockingScheme=
.MVCC)
+ interceptorChain.appendIntereceptor(createInterceptor(DataGrav=
itatorInterceptor.class));
+ else
+ interceptorChain.appendIntereceptor(createInterceptor(LegacyDa=
taGravitatorInterceptor.class));
+ }
=
+
if (optimistic)
{
interceptorChain.appendIntereceptor(createInterceptor(OptimisticL=
ockingInterceptor.class));
Deleted: core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitat=
orInterceptor.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInt=
erceptor.java 2008-08-06 14:37:50 UTC (rev 6528)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInt=
erceptor.java 2008-08-06 14:42:03 UTC (rev 6529)
@@ -1,439 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.cache.interceptors;
-
-import org.jboss.cache.CacheException;
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DataContainer;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
-import org.jboss.cache.buddyreplication.BuddyManager;
-import org.jboss.cache.buddyreplication.GravitateResult;
-import org.jboss.cache.commands.CommandsFactory;
-import org.jboss.cache.commands.DataCommand;
-import org.jboss.cache.commands.ReplicableCommand;
-import org.jboss.cache.commands.read.ExistsCommand;
-import org.jboss.cache.commands.read.GetChildrenNamesCommand;
-import org.jboss.cache.commands.read.GetDataMapCommand;
-import org.jboss.cache.commands.read.GetKeyValueCommand;
-import org.jboss.cache.commands.read.GetKeysCommand;
-import org.jboss.cache.commands.read.GetNodeCommand;
-import org.jboss.cache.commands.read.GravitateDataCommand;
-import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
-import org.jboss.cache.commands.tx.CommitCommand;
-import org.jboss.cache.commands.tx.RollbackCommand;
-import org.jboss.cache.factories.annotations.Inject;
-import org.jboss.cache.invocation.InvocationContext;
-import org.jboss.cache.marshall.NodeData;
-import org.jboss.cache.transaction.GlobalTransaction;
-import org.jgroups.Address;
-import org.jgroups.blocks.GroupRequest;
-import org.jgroups.blocks.RspFilter;
-
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * The Data Gravitator interceptor intercepts cache misses and attempts to
- * gravitate data from other parts of the cluster.
- *
- * Only used if Buddy Replication is enabled. Also, the interceptor only =
kicks
- * in if an {@link org.jboss.cache.config.Option} is passed in to force Da=
ta
- * Gravitation for a specific invocation or if autoDataGravitation =
is
- * set to true when configuring Buddy Replication.
- *
- * See the JBoss Cache User Guide for more details on configuration option=
s.
- * There is a section dedicated to Buddy Replication in the Replication
- * chapter.
- *
- * In terms of functionality, if a gravitation call has occured and a clea=
nup call is needed (based on
- * how BR is configured), a cleanup call will be broadcast immediately aft=
er the gravitation call (no txs)
- * or if txs are used, an asynchronous call is made to perform the =
cleanup outside the scope
- * of the tx that caused the gravitation event.
- *
- *
- * @author Manik Surtani (manik(a)jbo=
ss.org)
- */
-public class DataGravitatorInterceptor extends BaseRpcInterceptor
-{
- private BuddyManager buddyManager;
- /**
- * Map that contains commands that need cleaning up. This is keyed on =
global transaction, and contains a list of
- * cleanup commands corresponding to all gravitate calls made during th=
e course of the transaction in question.
- */
- private Map> cleanupCommands=
=3D new ConcurrentHashMap>();
- private DataContainer dataContainer;
- private CommandsFactory commandsFactory;
- private CacheSPI cacheSPI;
- private BuddyFqnTransformer buddyFqnTransformer;
-
- @Inject
- public void injectComponents(BuddyManager buddyManager, DataContainer d=
ataContainer, CommandsFactory commandsFactory, CacheSPI cacheSPI, BuddyFqnT=
ransformer transformer)
- {
- this.buddyManager =3D buddyManager;
- this.dataContainer =3D dataContainer;
- this.commandsFactory =3D commandsFactory;
- this.cacheSPI =3D cacheSPI;
- buddyFqnTransformer =3D transformer;
- }
-
- @Override
- public Object visitGetChildrenNamesCommand(InvocationContext ctx, GetCh=
ildrenNamesCommand command) throws Throwable
- {
- return handleGetMethod(ctx, command);
- }
-
- @Override
- public Object visitGetDataMapCommand(InvocationContext ctx, GetDataMapC=
ommand command) throws Throwable
- {
- return handleGetMethod(ctx, command);
- }
-
- @Override
- public Object visitExistsNodeCommand(InvocationContext ctx, ExistsComma=
nd command) throws Throwable
- {
- return handleGetMethod(ctx, command);
- }
-
- @Override
- public Object visitGetKeysCommand(InvocationContext ctx, GetKeysCommand=
command) throws Throwable
- {
- return handleGetMethod(ctx, command);
- }
-
- @Override
- public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValu=
eCommand command) throws Throwable
- {
- return handleGetMethod(ctx, command);
- }
-
- @Override
- public Object visitGetNodeCommand(InvocationContext ctx, GetNodeCommand=
command) throws Throwable
- {
- return handleGetMethod(ctx, command);
- }
-
- @Override
- public Object visitRollbackCommand(InvocationContext ctx, RollbackComma=
nd command) throws Throwable
- {
- try
- {
- return invokeNextInterceptor(ctx, command);
- }
- finally
- {
- cleanupCommands.remove(ctx.getGlobalTransaction());
- }
- }
-
- @Override
- public Object visitCommitCommand(InvocationContext ctx, CommitCommand c=
ommand) throws Throwable
- {
- GlobalTransaction gtx =3D ctx.getGlobalTransaction();
- try
- {
- doCommit(gtx);
- return invokeNextInterceptor(ctx, command);
- }
- finally
- {
- cleanupCommands.remove(gtx);
- }
- }
-
- private Object handleGetMethod(InvocationContext ctx, DataCommand comma=
nd) throws Throwable
- {
- if (isGravitationEnabled(ctx))
- {
- // test that the Fqn being requested exists locally in the cache.
- if (trace) log.trace("Checking local existence of requested fqn "=
+ command.getFqn());
- if (buddyFqnTransformer.isBackupFqn(command.getFqn()))
- {
- log.info("Is call for a backup Fqn, not performing any gravita=
tion. Direct calls on internal backup nodes are *not* supported.");
- }
- else
- {
- if (!dataContainer.exists(command.getFqn()))
- {
- // gravitation is necessary.
-
- if (trace) log.trace("Gravitating from local backup tree");
- BackupData data =3D localBackupGet(command.getFqn(), ctx);
-
- if (data =3D=3D null)
- {
- if (trace) log.trace("Gravitating from remote backup tre=
e");
- // gravitate remotely.
- data =3D remoteBackupGet(command.getFqn());
- }
-
- if (data !=3D null)
- {
- if (trace)
- log.trace("Passing the put call locally to make sure =
state is persisted and ownership is correctly established.");
- // store the gravitated node locally. This will cause i=
t being backed up in the current instance's buddy.
- createNode(data.backupData);
-
- cleanBackupData(data, ctx);
- }
- }
- else
- {
- if (trace) log.trace("No need to gravitate; have this alrea=
dy.");
- }
- }
- }
- else
- {
- if (trace)
- {
- log.trace("Suppressing data gravitation for this call.");
- }
- }
- return invokeNextInterceptor(ctx, command);
- }
-
- private boolean isGravitationEnabled(InvocationContext ctx)
- {
- boolean enabled =3D ctx.isOriginLocal();
- if (enabled)
- {
- if (!buddyManager.isAutoDataGravitation())
- {
- enabled =3D ctx.getOptionOverrides().getForceDataGravitation();
- }
- }
- return enabled;
- }
-
- private void doCommit(GlobalTransaction gtx) throws Throwable
- {
- if (cleanupCommands.containsKey(gtx))
- {
- if (trace) log.trace("Broadcasting cleanup commands for gtx " + g=
tx);
-
- for (ReplicableCommand command : cleanupCommands.get(gtx))
- {
- try
- {
- doCleanup(command);
- }
- catch (Throwable th)
- {
- log.warn("Problems performing gravitation cleanup. Cleanup=
command: " + command, th);
- }
- }
- }
- else
- {
- if (trace) log.trace("No cleanups to broadcast in commit phase fo=
r gtx " + gtx);
- }
- }
-
- private BackupData remoteBackupGet(Fqn name) throws Exception
- {
- BackupData result =3D null;
- GravitateResult gr =3D gravitateData(name);
- if (gr.isDataFound())
- {
- if (trace)
- {
- log.trace("Got response " + gr);
- }
-
- result =3D new BackupData(name, gr);
- }
- return result;
- }
-
- private void cleanBackupData(BackupData backup, InvocationContext ctx) =
throws Throwable
- {
-
- DataGravitationCleanupCommand cleanupCommand =3D commandsFactory.bui=
ldDataGravitationCleanupCommand(backup.primaryFqn, backup.backupFqn);
- GlobalTransaction gtx =3D ctx.getGlobalTransaction();
-
- if (gtx =3D=3D null)
- {
- // broadcast removes
- // remove main Fqn
- if (trace) log.trace("Performing cleanup on [" + backup.primaryFq=
n + "]");
- // remove backup Fqn
- doCleanup(cleanupCommand);
- }
- else
- {
- if (trace)
- log.trace("Data gravitation performed under global transaction=
" + gtx + ". Not broadcasting cleanups until the tx commits. Recording c=
leanup command for later use.");
- List commands;
- if (cleanupCommands.containsKey(gtx))
- {
- commands =3D cleanupCommands.get(gtx);
- }
- else
- {
- commands =3D new LinkedList();
- }
-
- commands.add(cleanupCommand);
- cleanupCommands.put(gtx, commands);
- }
- }
-
- private void doCleanup(ReplicableCommand cleanupCommand) throws Throwab=
le
- {
- // cleanup commands are always ASYNCHRONOUS and is broadcast to *eve=
ryone* (even members of the current buddy
- // group as they may be members of > 1 buddy group)
- replicateCall(null, cleanupCommand, false, false, false, true, -1);
- }
-
- @SuppressWarnings("deprecation")
- private GravitateResult gravitateData(Fqn fqn) throws Exception
- {
- if (trace) log.trace("Requesting data gravitation for Fqn " + fqn);
-
- List mbrs =3D rpcManager.getMembers();
- Boolean searchSubtrees =3D buddyManager.isDataGravitationSearchBacku=
pTrees() ? Boolean.TRUE : Boolean.FALSE;
- GravitateDataCommand command =3D commandsFactory.buildGravitateDataC=
ommand(fqn, searchSubtrees);
- // doing a GET_ALL is crappy but necessary since JGroups' GET_FIRST =
could return null results from nodes that do
- // not have either the primary OR backup, and stop polling other val=
id nodes.
- List resps =3D rpcManager.callRemoteMethods(null, command, GroupRequ=
est.GET_ALL, buddyManager.getBuddyCommunicationTimeout(), new ResponseValid=
ityFilter(mbrs, rpcManager.getLocalAddress()), false);
-
- if (trace) log.trace("got responses " + resps);
-
- if (resps =3D=3D null)
- {
- if (mbrs.size() > 1) log.error("No replies to call " + command);
- return GravitateResult.noDataFound();
- }
-
- // test for and remove exceptions
- GravitateResult result =3D GravitateResult.noDataFound();
- for (Object o : resps)
- {
- if (o instanceof Throwable)
- {
- if (log.isDebugEnabled())
- {
- log.debug("Found remote Throwable among responses - removin=
g from responses list", (Exception) o);
- }
- }
- else if (o !=3D null)
- {
- result =3D (GravitateResult) o;
- if (result.isDataFound())
- {
- break;
- }
- }
- else if (!configuration.isUseRegionBasedMarshalling())
- {
- // Null is OK if we are using region based marshalling; it
- // is what is returned if a region is inactive. Otherwise
- // getting a null is an error condition
- log.error("Unexpected null response to call " + command + ".");
- }
-
- }
-
- return result;
- }
-
- @SuppressWarnings("unchecked")
- private void createNode(List nodeData) throws CacheException
- {
- for (NodeData data : nodeData)
- {
- cacheSPI.put(data.getFqn(), data.getAttributes());
- }
- }
-
- private BackupData localBackupGet(Fqn fqn, InvocationContext ctx) throw=
s CacheException
- {
- GravitateResult result =3D cacheSPI.gravitateData(fqn, true, ctx);//=
a "local" gravitation
- boolean found =3D result.isDataFound();
- BackupData data =3D null;
-
- if (found)
- {
- Fqn backupFqn =3D result.getBuddyBackupFqn();
- data =3D new BackupData(fqn, result);
- // now the cleanup
- if (buddyManager.isDataGravitationRemoveOnFind())
- {
- // Remove locally only; the remote call will
- // be broadcast later
- ctx.getOptionOverrides().setCacheModeLocal(true);
- cacheSPI.removeNode(backupFqn);
- }
- else
- {
- cacheSPI.evict(backupFqn, true);
- }
- }
-
- if (trace) log.trace("Retrieved data " + data + " found =3D " + foun=
d);
- return data;
- }
-
- private static class BackupData
- {
- Fqn primaryFqn;
- Fqn backupFqn;
- List backupData;
-
- public BackupData(Fqn primaryFqn, GravitateResult gr)
- {
- this.primaryFqn =3D primaryFqn;
- this.backupFqn =3D gr.getBuddyBackupFqn();
- this.backupData =3D gr.getNodeData();
- }
-
- public String toString()
- {
- return "BackupData{" +
- "primaryFqn=3D" + primaryFqn +
- ", backupFqn=3D" + backupFqn +
- ", backupData=3D" + backupData +
- '}';
- }
- }
-
- public static class ResponseValidityFilter implements RspFilter
- {
- private int numValidResponses =3D 0;
- private List pendingResponders;
-
- public ResponseValidityFilter(List expected, Address localA=
ddress)
- {
- // so for now I used a list to keep it consistent
- this.pendingResponders =3D new ArrayList(expected);
- // We'll never get a response from ourself
- this.pendingResponders.remove(localAddress);
- }
-
- public boolean isAcceptable(Object object, Address address)
- {
- pendingResponders.remove(address);
-
- if (object instanceof GravitateResult)
- {
- GravitateResult response =3D (GravitateResult) object;
- if (response.isDataFound()) numValidResponses++;
- }
- // always return true to make sure a response is logged by the JG=
roups RpcDispatcher.
- return true;
- }
-
- public boolean needMoreResponses()
- {
- return numValidResponses < 1 && pendingResponders.size() > 0;
- }
- }
-}
Added: core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitator=
Interceptor.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInt=
erceptor.java (rev 0)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/DataGravitatorInt=
erceptor.java 2008-08-06 14:42:03 UTC (rev 6529)
@@ -0,0 +1,29 @@
+package org.jboss.cache.interceptors;
+
+import org.jboss.cache.Fqn;
+import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.invocation.InvocationContext;
+import org.jboss.cache.mvcc.MVCCNodeHelper;
+
+/**
+ * MVCC specific version of the LegacyDataGravitatorInterceptor
+ *
+ * @author Manik Surtani (manik(a)jbo=
ss.org)
+ * @since 3.0
+ */
+public class DataGravitatorInterceptor extends LegacyDataGravitatorInterce=
ptor
+{
+ MVCCNodeHelper helper;
+
+ @Inject
+ public void injectMvccNodeHelper(MVCCNodeHelper helper)
+ {
+ this.helper =3D helper;
+ }
+
+ @Override
+ protected void wrapIfNeeded(InvocationContext ctx, Fqn fqnToWrap) throw=
s InterruptedException
+ {
+ helper.wrapNodeForReading(ctx, fqnToWrap);
+ }
+}
Copied: core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyDataGra=
vitatorInterceptor.java (from rev 6527, core/trunk/src/main/java/org/jboss/=
cache/interceptors/DataGravitatorInterceptor.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyDataGravita=
torInterceptor.java (rev 0)
+++ core/trunk/src/main/java/org/jboss/cache/interceptors/LegacyDataGravita=
torInterceptor.java 2008-08-06 14:42:03 UTC (rev 6529)
@@ -0,0 +1,446 @@
+/*
+ * JBoss, Home of Professional Open Source
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package org.jboss.cache.interceptors;
+
+import org.jboss.cache.CacheException;
+import org.jboss.cache.CacheSPI;
+import org.jboss.cache.DataContainer;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.buddyreplication.BuddyFqnTransformer;
+import org.jboss.cache.buddyreplication.BuddyManager;
+import org.jboss.cache.buddyreplication.GravitateResult;
+import org.jboss.cache.commands.CommandsFactory;
+import org.jboss.cache.commands.DataCommand;
+import org.jboss.cache.commands.ReplicableCommand;
+import org.jboss.cache.commands.read.ExistsCommand;
+import org.jboss.cache.commands.read.GetChildrenNamesCommand;
+import org.jboss.cache.commands.read.GetDataMapCommand;
+import org.jboss.cache.commands.read.GetKeyValueCommand;
+import org.jboss.cache.commands.read.GetKeysCommand;
+import org.jboss.cache.commands.read.GetNodeCommand;
+import org.jboss.cache.commands.read.GravitateDataCommand;
+import org.jboss.cache.commands.remote.DataGravitationCleanupCommand;
+import org.jboss.cache.commands.tx.CommitCommand;
+import org.jboss.cache.commands.tx.RollbackCommand;
+import org.jboss.cache.factories.annotations.Inject;
+import org.jboss.cache.invocation.InvocationContext;
+import org.jboss.cache.marshall.NodeData;
+import org.jboss.cache.transaction.GlobalTransaction;
+import org.jgroups.Address;
+import org.jgroups.blocks.GroupRequest;
+import org.jgroups.blocks.RspFilter;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * The Data Gravitator interceptor intercepts cache misses and attempts to
+ * gravitate data from other parts of the cluster.
+ *
+ * Only used if Buddy Replication is enabled. Also, the interceptor only =
kicks
+ * in if an {@link org.jboss.cache.config.Option} is passed in to force Da=
ta
+ * Gravitation for a specific invocation or if autoDataGravitation =
is
+ * set to true when configuring Buddy Replication.
+ *
+ * See the JBoss Cache User Guide for more details on configuration option=
s.
+ * There is a section dedicated to Buddy Replication in the Replication
+ * chapter.
+ *
+ * In terms of functionality, if a gravitation call has occured and a clea=
nup call is needed (based on
+ * how BR is configured), a cleanup call will be broadcast immediately aft=
er the gravitation call (no txs)
+ * or if txs are used, an asynchronous call is made to perform the =
cleanup outside the scope
+ * of the tx that caused the gravitation event.
+ *
+ *
+ * @author Manik Surtani (manik(a)jbo=
ss.org)
+ * @deprecated will be removed with optimistic and pessimistic locking.
+ */
+(a)Deprecated
+public class LegacyDataGravitatorInterceptor extends BaseRpcInterceptor
+{
+ private BuddyManager buddyManager;
+ /**
+ * Map that contains commands that need cleaning up. This is keyed on =
global transaction, and contains a list of
+ * cleanup commands corresponding to all gravitate calls made during th=
e course of the transaction in question.
+ */
+ private Map> cleanupCommands=
=3D new ConcurrentHashMap>();
+ private DataContainer dataContainer;
+ private CommandsFactory commandsFactory;
+ private CacheSPI cacheSPI;
+ private BuddyFqnTransformer buddyFqnTransformer;
+
+ @Inject
+ public void injectComponents(BuddyManager buddyManager, DataContainer d=
ataContainer, CommandsFactory commandsFactory, CacheSPI cacheSPI, BuddyFqnT=
ransformer transformer)
+ {
+ this.buddyManager =3D buddyManager;
+ this.dataContainer =3D dataContainer;
+ this.commandsFactory =3D commandsFactory;
+ this.cacheSPI =3D cacheSPI;
+ buddyFqnTransformer =3D transformer;
+ }
+
+ @Override
+ public Object visitGetChildrenNamesCommand(InvocationContext ctx, GetCh=
ildrenNamesCommand command) throws Throwable
+ {
+ return handleGetMethod(ctx, command);
+ }
+
+ @Override
+ public Object visitGetDataMapCommand(InvocationContext ctx, GetDataMapC=
ommand command) throws Throwable
+ {
+ return handleGetMethod(ctx, command);
+ }
+
+ @Override
+ public Object visitExistsNodeCommand(InvocationContext ctx, ExistsComma=
nd command) throws Throwable
+ {
+ return handleGetMethod(ctx, command);
+ }
+
+ @Override
+ public Object visitGetKeysCommand(InvocationContext ctx, GetKeysCommand=
command) throws Throwable
+ {
+ return handleGetMethod(ctx, command);
+ }
+
+ @Override
+ public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValu=
eCommand command) throws Throwable
+ {
+ return handleGetMethod(ctx, command);
+ }
+
+ @Override
+ public Object visitGetNodeCommand(InvocationContext ctx, GetNodeCommand=
command) throws Throwable
+ {
+ return handleGetMethod(ctx, command);
+ }
+
+ @Override
+ public Object visitRollbackCommand(InvocationContext ctx, RollbackComma=
nd command) throws Throwable
+ {
+ try
+ {
+ return invokeNextInterceptor(ctx, command);
+ }
+ finally
+ {
+ cleanupCommands.remove(ctx.getGlobalTransaction());
+ }
+ }
+
+ @Override
+ public Object visitCommitCommand(InvocationContext ctx, CommitCommand c=
ommand) throws Throwable
+ {
+ GlobalTransaction gtx =3D ctx.getGlobalTransaction();
+ try
+ {
+ doCommit(gtx);
+ return invokeNextInterceptor(ctx, command);
+ }
+ finally
+ {
+ cleanupCommands.remove(gtx);
+ }
+ }
+
+ private Object handleGetMethod(InvocationContext ctx, DataCommand comma=
nd) throws Throwable
+ {
+ if (isGravitationEnabled(ctx))
+ {
+ // test that the Fqn being requested exists locally in the cache.
+ if (trace) log.trace("Checking local existence of requested fqn "=
+ command.getFqn());
+ if (buddyFqnTransformer.isBackupFqn(command.getFqn()))
+ {
+ log.info("Is call for a backup Fqn, not performing any gravita=
tion. Direct calls on internal backup nodes are *not* supported.");
+ }
+ else
+ {
+ if (!dataContainer.exists(command.getFqn()))
+ {
+ // gravitation is necessary.
+
+ if (trace) log.trace("Gravitating from local backup tree");
+ BackupData data =3D localBackupGet(command.getFqn(), ctx);
+
+ if (data =3D=3D null)
+ {
+ if (trace) log.trace("Gravitating from remote backup tre=
e");
+ // gravitate remotely.
+ data =3D remoteBackupGet(command.getFqn());
+ }
+
+ if (data !=3D null)
+ {
+ if (trace)
+ log.trace("Passing the put call locally to make sure =
state is persisted and ownership is correctly established.");
+ // store the gravitated node locally. This will cause i=
t being backed up in the current instance's buddy.
+ createNode(data.backupData);
+ cleanBackupData(data, ctx);
+ wrapIfNeeded(ctx, data.primaryFqn);
+ }
+ }
+ else
+ {
+ if (trace) log.trace("No need to gravitate; have this alrea=
dy.");
+ }
+ }
+ }
+ else
+ {
+ if (trace)
+ {
+ log.trace("Suppressing data gravitation for this call.");
+ }
+ }
+ return invokeNextInterceptor(ctx, command);
+ }
+
+ protected void wrapIfNeeded(InvocationContext ctx, Fqn fqnToWrap) throw=
s InterruptedException
+ {
+ // no op
+ }
+
+ private boolean isGravitationEnabled(InvocationContext ctx)
+ {
+ boolean enabled =3D ctx.isOriginLocal();
+ if (enabled)
+ {
+ if (!buddyManager.isAutoDataGravitation())
+ {
+ enabled =3D ctx.getOptionOverrides().getForceDataGravitation();
+ }
+ }
+ return enabled;
+ }
+
+ private void doCommit(GlobalTransaction gtx) throws Throwable
+ {
+ if (cleanupCommands.containsKey(gtx))
+ {
+ if (trace) log.trace("Broadcasting cleanup commands for gtx " + g=
tx);
+
+ for (ReplicableCommand command : cleanupCommands.get(gtx))
+ {
+ try
+ {
+ doCleanup(command);
+ }
+ catch (Throwable th)
+ {
+ log.warn("Problems performing gravitation cleanup. Cleanup=
command: " + command, th);
+ }
+ }
+ }
+ else
+ {
+ if (trace) log.trace("No cleanups to broadcast in commit phase fo=
r gtx " + gtx);
+ }
+ }
+
+ private BackupData remoteBackupGet(Fqn name) throws Exception
+ {
+ BackupData result =3D null;
+ GravitateResult gr =3D gravitateData(name);
+ if (gr.isDataFound())
+ {
+ if (trace)
+ {
+ log.trace("Got response " + gr);
+ }
+
+ result =3D new BackupData(name, gr);
+ }
+ return result;
+ }
+
+ private void cleanBackupData(BackupData backup, InvocationContext ctx) =
throws Throwable
+ {
+
+ DataGravitationCleanupCommand cleanupCommand =3D commandsFactory.bui=
ldDataGravitationCleanupCommand(backup.primaryFqn, backup.backupFqn);
+ GlobalTransaction gtx =3D ctx.getGlobalTransaction();
+
+ if (gtx =3D=3D null)
+ {
+ // broadcast removes
+ // remove main Fqn
+ if (trace) log.trace("Performing cleanup on [" + backup.primaryFq=
n + "]");
+ // remove backup Fqn
+ doCleanup(cleanupCommand);
+ }
+ else
+ {
+ if (trace)
+ log.trace("Data gravitation performed under global transaction=
" + gtx + ". Not broadcasting cleanups until the tx commits. Recording c=
leanup command for later use.");
+ List commands;
+ if (cleanupCommands.containsKey(gtx))
+ {
+ commands =3D cleanupCommands.get(gtx);
+ }
+ else
+ {
+ commands =3D new LinkedList();
+ }
+
+ commands.add(cleanupCommand);
+ cleanupCommands.put(gtx, commands);
+ }
+ }
+
+ private void doCleanup(ReplicableCommand cleanupCommand) throws Throwab=
le
+ {
+ // cleanup commands are always ASYNCHRONOUS and is broadcast to *eve=
ryone* (even members of the current buddy
+ // group as they may be members of > 1 buddy group)
+ replicateCall(null, cleanupCommand, false, false, false, true, -1);
+ }
+
+ @SuppressWarnings("deprecation")
+ private GravitateResult gravitateData(Fqn fqn) throws Exception
+ {
+ if (trace) log.trace("Requesting data gravitation for Fqn " + fqn);
+
+ List mbrs =3D rpcManager.getMembers();
+ Boolean searchSubtrees =3D buddyManager.isDataGravitationSearchBacku=
pTrees() ? Boolean.TRUE : Boolean.FALSE;
+ GravitateDataCommand command =3D commandsFactory.buildGravitateDataC=
ommand(fqn, searchSubtrees);
+ // doing a GET_ALL is crappy but necessary since JGroups' GET_FIRST =
could return null results from nodes that do
+ // not have either the primary OR backup, and stop polling other val=
id nodes.
+ List resps =3D rpcManager.callRemoteMethods(null, command, GroupRequ=
est.GET_ALL, buddyManager.getBuddyCommunicationTimeout(), new ResponseValid=
ityFilter(mbrs, rpcManager.getLocalAddress()), false);
+
+ if (trace) log.trace("got responses " + resps);
+
+ if (resps =3D=3D null)
+ {
+ if (mbrs.size() > 1) log.error("No replies to call " + command);
+ return GravitateResult.noDataFound();
+ }
+
+ // test for and remove exceptions
+ GravitateResult result =3D GravitateResult.noDataFound();
+ for (Object o : resps)
+ {
+ if (o instanceof Throwable)
+ {
+ if (log.isDebugEnabled())
+ {
+ log.debug("Found remote Throwable among responses - removin=
g from responses list", (Exception) o);
+ }
+ }
+ else if (o !=3D null)
+ {
+ result =3D (GravitateResult) o;
+ if (result.isDataFound())
+ {
+ break;
+ }
+ }
+ else if (!configuration.isUseRegionBasedMarshalling())
+ {
+ // Null is OK if we are using region based marshalling; it
+ // is what is returned if a region is inactive. Otherwise
+ // getting a null is an error condition
+ log.error("Unexpected null response to call " + command + ".");
+ }
+
+ }
+
+ return result;
+ }
+
+ @SuppressWarnings("unchecked")
+ private void createNode(List nodeData) throws CacheException
+ {
+ for (NodeData data : nodeData)
+ {
+ cacheSPI.put(data.getFqn(), data.getAttributes());
+ }
+ }
+
+ private BackupData localBackupGet(Fqn fqn, InvocationContext ctx) throw=
s CacheException
+ {
+ GravitateResult result =3D cacheSPI.gravitateData(fqn, true, ctx);//=
a "local" gravitation
+ boolean found =3D result.isDataFound();
+ BackupData data =3D null;
+
+ if (found)
+ {
+ Fqn backupFqn =3D result.getBuddyBackupFqn();
+ data =3D new BackupData(fqn, result);
+ // now the cleanup
+ if (buddyManager.isDataGravitationRemoveOnFind())
+ {
+ // Remove locally only; the remote call will
+ // be broadcast later
+ ctx.getOptionOverrides().setCacheModeLocal(true);
+ cacheSPI.removeNode(backupFqn);
+ }
+ else
+ {
+ cacheSPI.evict(backupFqn, true);
+ }
+ }
+
+ if (trace) log.trace("Retrieved data " + data + " found =3D " + foun=
d);
+ return data;
+ }
+
+ private static class BackupData
+ {
+ Fqn primaryFqn;
+ Fqn backupFqn;
+ List backupData;
+
+ public BackupData(Fqn primaryFqn, GravitateResult gr)
+ {
+ this.primaryFqn =3D primaryFqn;
+ this.backupFqn =3D gr.getBuddyBackupFqn();
+ this.backupData =3D gr.getNodeData();
+ }
+
+ public String toString()
+ {
+ return "BackupData{" +
+ "primaryFqn=3D" + primaryFqn +
+ ", backupFqn=3D" + backupFqn +
+ ", backupData=3D" + backupData +
+ '}';
+ }
+ }
+
+ public static class ResponseValidityFilter implements RspFilter
+ {
+ private int numValidResponses =3D 0;
+ private List pendingResponders;
+
+ public ResponseValidityFilter(List expected, Address localA=
ddress)
+ {
+ // so for now I used a list to keep it consistent
+ this.pendingResponders =3D new ArrayList(expected);
+ // We'll never get a response from ourself
+ this.pendingResponders.remove(localAddress);
+ }
+
+ public boolean isAcceptable(Object object, Address address)
+ {
+ pendingResponders.remove(address);
+
+ if (object instanceof GravitateResult)
+ {
+ GravitateResult response =3D (GravitateResult) object;
+ if (response.isDataFound()) numValidResponses++;
+ }
+ // always return true to make sure a response is logged by the JG=
roups RpcDispatcher.
+ return true;
+ }
+
+ public boolean needMoreResponses()
+ {
+ return numValidResponses < 1 && pendingResponders.size() > 0;
+ }
+ }
+}
Property changes on: core/trunk/src/main/java/org/jboss/cache/interceptors/=
LegacyDataGravitatorInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyRe=
plicationConfigTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicat=
ionConfigTest.java 2008-08-06 14:37:50 UTC (rev 6528)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyReplicat=
ionConfigTest.java 2008-08-06 14:42:03 UTC (rev 6529)
@@ -14,7 +14,7 @@
import org.jboss.cache.config.parsing.XmlConfigHelper;
import org.jboss.cache.config.parsing.XmlConfigurationParser;
import org.jboss.cache.config.parsing.element.BuddyElementParser;
-import org.jboss.cache.interceptors.DataGravitatorInterceptor;
+import org.jboss.cache.interceptors.LegacyDataGravitatorInterceptor;
import org.jboss.cache.interceptors.base.CommandInterceptor;
import static org.testng.AssertJUnit.*;
import org.testng.annotations.AfterMethod;
@@ -102,7 +102,7 @@
boolean hasDG =3D false;
for (CommandInterceptor interceptor : cache.getInterceptorChain())
{
- hasDG =3D hasDG || (interceptor instanceof DataGravitatorIntercep=
tor);
+ hasDG =3D hasDG || (interceptor instanceof LegacyDataGravitatorIn=
terceptor);
}
=
System.out.println(cache.getInterceptorChain());
Modified: core/trunk/src/test/java/org/jboss/cache/factories/InterceptorCha=
inFactoryTest.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFact=
oryTest.java 2008-08-06 14:37:50 UTC (rev 6528)
+++ core/trunk/src/test/java/org/jboss/cache/factories/InterceptorChainFact=
oryTest.java 2008-08-06 14:42:03 UTC (rev 6529)
@@ -503,7 +503,7 @@
assertEquals(OptimisticTxInterceptor.class, interceptors.next().getC=
lass());
assertEquals(NotificationInterceptor.class, interceptors.next().getC=
lass());
assertEquals(OptimisticReplicationInterceptor.class, interceptors.ne=
xt().getClass());
- assertEquals(DataGravitatorInterceptor.class, interceptors.next().ge=
tClass());
+ assertEquals(LegacyDataGravitatorInterceptor.class, interceptors.nex=
t().getClass());
assertEquals(OptimisticLockingInterceptor.class, interceptors.next()=
.getClass());
assertEquals(OptimisticValidatorInterceptor.class, interceptors.next=
().getClass());
assertEquals(OptimisticCreateIfNotExistsInterceptor.class, intercept=
ors.next().getClass());
@@ -534,7 +534,7 @@
assertEquals(NotificationInterceptor.class, interceptors.next().getC=
lass());
assertEquals(ReplicationInterceptor.class, interceptors.next().getCl=
ass());
assertEquals(PessimisticLockInterceptor.class, interceptors.next().g=
etClass());
- assertEquals(DataGravitatorInterceptor.class, interceptors.next().ge=
tClass());
+ assertEquals(LegacyDataGravitatorInterceptor.class, interceptors.nex=
t().getClass());
assertEquals(CallInterceptor.class, interceptors.next().getClass());
=
assertInterceptorLinkage(list);
--===============8739036797077814852==--
From jbosscache-commits at lists.jboss.org Wed Aug 6 10:57:48 2008
Content-Type: multipart/mixed; boundary="===============3496960493947459119=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6530 - in
core/trunk/src/main/java/org/jboss/cache/factories: context and 1 other
directory.
Date: Wed, 06 Aug 2008 10:57:47 -0400
Message-ID:
--===============3496960493947459119==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-06 10:57:47 -0400 (Wed, 06 Aug 2008)
New Revision: 6530
Added:
core/trunk/src/main/java/org/jboss/cache/factories/ContextMetaFactory.ja=
va
Removed:
core/trunk/src/main/java/org/jboss/cache/factories/context/ContextMetaFa=
ctory.java
Modified:
core/trunk/src/main/java/org/jboss/cache/factories/CommandsMetaFactory.j=
ava
core/trunk/src/main/java/org/jboss/cache/factories/EmptyConstructorFacto=
ry.java
core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFacto=
ry.java
core/trunk/src/main/java/org/jboss/cache/factories/LockManagerFactory.ja=
va
core/trunk/src/main/java/org/jboss/cache/factories/NodeMetaFactory.java
core/trunk/src/main/java/org/jboss/cache/factories/RegionManagerFactory.=
java
core/trunk/src/main/java/org/jboss/cache/factories/RuntimeConfigAwareFac=
tory.java
core/trunk/src/main/java/org/jboss/cache/factories/StateTransferFactory.=
java
core/trunk/src/main/java/org/jboss/cache/factories/StateTransferManagerF=
actory.java
core/trunk/src/main/java/org/jboss/cache/factories/TransactionManagerFac=
tory.java
core/trunk/src/main/java/org/jboss/cache/factories/context/OptimisticCon=
textFactory.java
core/trunk/src/main/java/org/jboss/cache/factories/context/PessimisticCo=
ntextFactory.java
Log:
Cleaned up ugly generic casts in factories
Modified: core/trunk/src/main/java/org/jboss/cache/factories/CommandsMetaFa=
ctory.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/factories/CommandsMetaFactory.=
java 2008-08-06 14:42:03 UTC (rev 6529)
+++ core/trunk/src/main/java/org/jboss/cache/factories/CommandsMetaFactory.=
java 2008-08-06 14:57:47 UTC (rev 6530)
@@ -16,17 +16,17 @@
@DefaultFactoryFor(classes =3D CommandsFactory.class)
public class CommandsMetaFactory extends ComponentFactory
{
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("deprecation")
protected T construct(Class componentType)
{
switch (configuration.getNodeLockingScheme())
{
case MVCC:
- return (T) new CommandsFactoryImpl();
+ return componentType.cast(new CommandsFactoryImpl());
case OPTIMISTIC:
- return (T) new OptimisticCommandsFactoryImpl();
+ return componentType.cast(new OptimisticCommandsFactoryImpl());
case PESSIMISTIC:
- return (T) new PessimisticCommandsFactoryImpl();
+ return componentType.cast(new PessimisticCommandsFactoryImpl()=
);
}
throw new ConfigurationException("Unknown locking scheme " + configu=
ration.getNodeLockingScheme());
}
Copied: core/trunk/src/main/java/org/jboss/cache/factories/ContextMetaFacto=
ry.java (from rev 6527, core/trunk/src/main/java/org/jboss/cache/factories/=
context/ContextMetaFactory.java)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/factories/ContextMetaFactory.j=
ava (rev 0)
+++ core/trunk/src/main/java/org/jboss/cache/factories/ContextMetaFactory.j=
ava 2008-08-06 14:57:47 UTC (rev 6530)
@@ -0,0 +1,37 @@
+package org.jboss.cache.factories;
+
+import org.jboss.cache.config.ConfigurationException;
+import org.jboss.cache.factories.annotations.DefaultFactoryFor;
+import org.jboss.cache.factories.context.ContextFactory;
+import org.jboss.cache.factories.context.MVCCContextFactory;
+import org.jboss.cache.factories.context.OptimisticContextFactory;
+import org.jboss.cache.factories.context.PessimisticContextFactory;
+
+/**
+ * Responsible for creating the appropriate {@link org.jboss.cache.factori=
es.context.ContextFactory} based on configuration used.
+ *
+ * @author Manik Surtani (manik(a)jbo=
ss.org)
+ * @since 3.0
+ */
+(a)DefaultFactoryFor(classes =3D ContextFactory.class)
+public class ContextMetaFactory extends ComponentFactory
+{
+ @SuppressWarnings("deprecation")
+ protected T construct(Class componentType)
+ {
+ if (log.isTraceEnabled()) log.trace("Cache configuration is " + conf=
iguration.getNodeLockingScheme());
+ switch (configuration.getNodeLockingScheme())
+ {
+ case MVCC:
+ if (log.isTraceEnabled()) log.trace("Creating an MVCC context =
factory");
+ return componentType.cast(new MVCCContextFactory());
+ case OPTIMISTIC:
+ if (log.isTraceEnabled()) log.trace("Creating an optimistic co=
ntext factory");
+ return componentType.cast(new OptimisticContextFactory());
+ case PESSIMISTIC:
+ if (log.isTraceEnabled()) log.trace("Creating a pessimistic co=
ntext factory");
+ return componentType.cast(new PessimisticContextFactory());
+ }
+ throw new ConfigurationException("Unknown configuration node locking=
scheme");
+ }
+}
Modified: core/trunk/src/main/java/org/jboss/cache/factories/EmptyConstruct=
orFactory.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/factories/EmptyConstructorFact=
ory.java 2008-08-06 14:42:03 UTC (rev 6529)
+++ core/trunk/src/main/java/org/jboss/cache/factories/EmptyConstructorFact=
ory.java 2008-08-06 14:57:47 UTC (rev 6530)
@@ -29,7 +29,6 @@
public class EmptyConstructorFactory extends ComponentFactory
{
@Override
- @SuppressWarnings("unchecked")
protected T construct(Class componentType)
{
try
@@ -47,7 +46,7 @@
componentImpl =3D getClass().getClassLoader().loadClass(com=
ponentType.getName() + "Impl");
}
=
- return (T) componentImpl.newInstance();
+ return componentType.cast(componentImpl.newInstance());
}
else
{
Modified: core/trunk/src/main/java/org/jboss/cache/factories/InterceptorCha=
inFactory.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFact=
ory.java 2008-08-06 14:42:03 UTC (rev 6529)
+++ core/trunk/src/main/java/org/jboss/cache/factories/InterceptorChainFact=
ory.java 2008-08-06 14:57:47 UTC (rev 6530)
@@ -193,12 +193,11 @@
}
=
@Override
- @SuppressWarnings("unchecked")
protected T construct(Class componentType)
{
try
{
- return (T) buildInterceptorChain();
+ return componentType.cast(buildInterceptorChain());
}
catch (Exception e)
{
Modified: core/trunk/src/main/java/org/jboss/cache/factories/LockManagerFac=
tory.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/factories/LockManagerFactory.j=
ava 2008-08-06 14:42:03 UTC (rev 6529)
+++ core/trunk/src/main/java/org/jboss/cache/factories/LockManagerFactory.j=
ava 2008-08-06 14:57:47 UTC (rev 6530)
@@ -16,19 +16,19 @@
public class LockManagerFactory extends EmptyConstructorFactory
{
@Override
- @SuppressWarnings({"unchecked", "deprecation"})
+ @SuppressWarnings("deprecation")
protected T construct(Class componentType)
{
if (log.isTraceEnabled()) log.trace("Cache configuration is " + conf=
iguration.getNodeLockingScheme());
switch (configuration.getNodeLockingScheme())
{
case MVCC:
- return (T) super.construct(MVCCLockManager.class);
+ return componentType.cast(super.construct(MVCCLockManager.clas=
s));
case OPTIMISTIC:
- return (T) super.construct(NodeBasedLockManager.class);
+ return componentType.cast(super.construct(NodeBasedLockManager=
.class));
case PESSIMISTIC:
default:
- return (T) super.construct(PessimisticNodeBasedLockManager.cla=
ss);
+ return componentType.cast(super.construct(PessimisticNodeBased=
LockManager.class));
}
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/factories/NodeMetaFactor=
y.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/factories/NodeMetaFactory.java=
2008-08-06 14:42:03 UTC (rev 6529)
+++ core/trunk/src/main/java/org/jboss/cache/factories/NodeMetaFactory.java=
2008-08-06 14:57:47 UTC (rev 6530)
@@ -16,17 +16,17 @@
@DefaultFactoryFor(classes =3D NodeFactory.class)
public class NodeMetaFactory extends ComponentFactory
{
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("deprecation")
protected T construct(Class componentType)
{
switch (configuration.getNodeLockingScheme())
{
case MVCC:
- return (T) new MVCCNodeFactory();
+ return componentType.cast(new MVCCNodeFactory());
case OPTIMISTIC:
- return (T) new OptimisticNodeFactory();
+ return componentType.cast(new OptimisticNodeFactory());
case PESSIMISTIC:
- return (T) new PessimisticNodeFactory();
+ return componentType.cast(new PessimisticNodeFactory());
default:
throw new ConfigurationException("Unknown locking scheme " + c=
onfiguration.getNodeLockingScheme());
}
Modified: core/trunk/src/main/java/org/jboss/cache/factories/RegionManagerF=
actory.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/factories/RegionManagerFactory=
.java 2008-08-06 14:42:03 UTC (rev 6529)
+++ core/trunk/src/main/java/org/jboss/cache/factories/RegionManagerFactory=
.java 2008-08-06 14:57:47 UTC (rev 6530)
@@ -14,15 +14,15 @@
@DefaultFactoryFor(classes =3D RegionManager.class)
public class RegionManagerFactory extends ComponentFactory
{
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("deprecation")
protected T construct(Class componentType)
{
switch (configuration.getNodeLockingScheme())
{
case MVCC:
- return (T) new RegionManagerImpl();
+ return componentType.cast(new RegionManagerImpl());
default:
- return (T) new LegacyRegionManagerImpl();
+ return componentType.cast(new LegacyRegionManagerImpl());
}
}
}
\ No newline at end of file
Modified: core/trunk/src/main/java/org/jboss/cache/factories/RuntimeConfigA=
wareFactory.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/factories/RuntimeConfigAwareFa=
ctory.java 2008-08-06 14:42:03 UTC (rev 6529)
+++ core/trunk/src/main/java/org/jboss/cache/factories/RuntimeConfigAwareFa=
ctory.java 2008-08-06 14:57:47 UTC (rev 6530)
@@ -18,7 +18,6 @@
public class RuntimeConfigAwareFactory extends EmptyConstructorFactory
{
@Override
- @SuppressWarnings("unchecked")
protected T construct(Class componentType)
{
T component =3D super.construct(componentType);
Modified: core/trunk/src/main/java/org/jboss/cache/factories/StateTransferF=
actory.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/factories/StateTransferFactory=
.java 2008-08-06 14:42:03 UTC (rev 6529)
+++ core/trunk/src/main/java/org/jboss/cache/factories/StateTransferFactory=
.java 2008-08-06 14:57:47 UTC (rev 6530)
@@ -28,17 +28,17 @@
@DefaultFactoryFor(classes =3D {StateTransferGenerator.class, StateTransfe=
rIntegrator.class})
public class StateTransferFactory extends ComponentFactory
{
+ @SuppressWarnings("deprecation")
protected T construct(Class componentType)
{
-
if (componentType.equals(StateTransferIntegrator.class))
{
switch (configuration.getNodeLockingScheme())
{
case MVCC:
- return (T) new DefaultStateTransferIntegrator();
+ return componentType.cast(new DefaultStateTransferIntegrato=
r());
default:
- return (T) new LegacyStateTransferIntegrator();
+ return componentType.cast(new LegacyStateTransferIntegrator=
());
}
}
else
@@ -46,9 +46,9 @@
switch (configuration.getNodeLockingScheme())
{
case MVCC:
- return (T) new DefaultStateTransferGenerator();
+ return componentType.cast(new DefaultStateTransferGenerator=
());
default:
- return (T) new LegacyStateTransferGenerator();
+ return componentType.cast(new LegacyStateTransferGenerator(=
));
}
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/factories/StateTransferM=
anagerFactory.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/factories/StateTransferManager=
Factory.java 2008-08-06 14:42:03 UTC (rev 6529)
+++ core/trunk/src/main/java/org/jboss/cache/factories/StateTransferManager=
Factory.java 2008-08-06 14:57:47 UTC (rev 6530)
@@ -14,15 +14,15 @@
@DefaultFactoryFor(classes =3D StateTransferManager.class)
public class StateTransferManagerFactory extends ComponentFactory
{
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("deprecation")
protected T construct(Class componentType)
{
switch (configuration.getNodeLockingScheme())
{
case MVCC:
- return (T) new DefaultStateTransferManager();
+ return componentType.cast(new DefaultStateTransferManager());
default:
- return (T) new LegacyStateTransferManager();
+ return componentType.cast(new LegacyStateTransferManager());
}
}
}
Modified: core/trunk/src/main/java/org/jboss/cache/factories/TransactionMan=
agerFactory.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/factories/TransactionManagerFa=
ctory.java 2008-08-06 14:42:03 UTC (rev 6529)
+++ core/trunk/src/main/java/org/jboss/cache/factories/TransactionManagerFa=
ctory.java 2008-08-06 14:57:47 UTC (rev 6530)
@@ -15,7 +15,6 @@
@DefaultFactoryFor(classes =3D {TransactionManager.class})
public class TransactionManagerFactory extends ComponentFactory
{
- @SuppressWarnings("unchecked")
protected T construct(Class componentType)
{
// See if we had a TransactionManager injected into our config
@@ -53,6 +52,6 @@
log.info("failed looking up TransactionManager, will not use t=
ransactions", e);
}
}
- return (T) transactionManager;
+ return componentType.cast(transactionManager);
}
}
Deleted: core/trunk/src/main/java/org/jboss/cache/factories/context/Context=
MetaFactory.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/factories/context/ContextMetaF=
actory.java 2008-08-06 14:42:03 UTC (rev 6529)
+++ core/trunk/src/main/java/org/jboss/cache/factories/context/ContextMetaF=
actory.java 2008-08-06 14:57:47 UTC (rev 6530)
@@ -1,34 +0,0 @@
-package org.jboss.cache.factories.context;
-
-import org.jboss.cache.config.ConfigurationException;
-import org.jboss.cache.factories.ComponentFactory;
-import org.jboss.cache.factories.annotations.DefaultFactoryFor;
-
-/**
- * Responsible for creating the appropriate {@link ContextFactory} based o=
n configuration used.
- *
- * @author Manik Surtani (manik(a)jbo=
ss.org)
- * @since 3.0
- */
-(a)DefaultFactoryFor(classes =3D ContextFactory.class)
-public class ContextMetaFactory extends ComponentFactory
-{
- @SuppressWarnings("unchecked")
- protected T construct(Class componentType)
- {
- if (log.isTraceEnabled()) log.trace("Cache configuration is " + conf=
iguration.getNodeLockingScheme());
- switch (configuration.getNodeLockingScheme())
- {
- case MVCC:
- if (log.isTraceEnabled()) log.trace("Creating an MVCC context =
factory");
- return (T) new MVCCContextFactory();
- case OPTIMISTIC:
- if (log.isTraceEnabled()) log.trace("Creating an optimistic co=
ntext factory");
- return (T) new OptimisticContextFactory();
- case PESSIMISTIC:
- if (log.isTraceEnabled()) log.trace("Creating a pessimistic co=
ntext factory");
- return (T) new PessimisticContextFactory();
- }
- throw new ConfigurationException("Unknown configuration node locking=
scheme");
- }
-}
Modified: core/trunk/src/main/java/org/jboss/cache/factories/context/Optimi=
sticContextFactory.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/factories/context/OptimisticCo=
ntextFactory.java 2008-08-06 14:42:03 UTC (rev 6529)
+++ core/trunk/src/main/java/org/jboss/cache/factories/context/OptimisticCo=
ntextFactory.java 2008-08-06 14:57:47 UTC (rev 6530)
@@ -12,7 +12,10 @@
*
* @author Manik Surtani (manik(a)jbo=
ss.org)
* @since 3.0
+ * @deprecated will be removed when optimistic locking is removed.
*/
+(a)Deprecated
+(a)SuppressWarnings("deprecation")
public class OptimisticContextFactory extends PessimisticContextFactory
{
@Override
Modified: core/trunk/src/main/java/org/jboss/cache/factories/context/Pessim=
isticContextFactory.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/factories/context/PessimisticC=
ontextFactory.java 2008-08-06 14:42:03 UTC (rev 6529)
+++ core/trunk/src/main/java/org/jboss/cache/factories/context/PessimisticC=
ontextFactory.java 2008-08-06 14:57:47 UTC (rev 6530)
@@ -16,7 +16,10 @@
*
* @author Manik Surtani (manik(a)jbo=
ss.org)
* @since 3.0
+ * @deprecated will be removed when pessimistic locking is removed.
*/
+(a)Deprecated
+(a)SuppressWarnings("deprecation")
public class PessimisticContextFactory implements ContextFactory
{
DataContainer container;
--===============3496960493947459119==--
From jbosscache-commits at lists.jboss.org Wed Aug 6 10:58:15 2008
Content-Type: multipart/mixed; boundary="===============5345397349852635456=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6531 -
core/trunk/src/main/java/org/jboss/cache/factories.
Date: Wed, 06 Aug 2008 10:58:15 -0400
Message-ID:
--===============5345397349852635456==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: manik.surtani(a)jboss.com
Date: 2008-08-06 10:58:15 -0400 (Wed, 06 Aug 2008)
New Revision: 6531
Modified:
core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.java
Log:
Cleaned up ugly generic casts in factories
Modified: core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegis=
try.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.ja=
va 2008-08-06 14:57:47 UTC (rev 6530)
+++ core/trunk/src/main/java/org/jboss/cache/factories/ComponentRegistry.ja=
va 2008-08-06 14:58:15 UTC (rev 6531)
@@ -15,7 +15,6 @@
import org.jboss.cache.factories.annotations.NonVolatile;
import org.jboss.cache.factories.annotations.Start;
import org.jboss.cache.factories.annotations.Stop;
-import org.jboss.cache.factories.context.ContextMetaFactory;
import org.jboss.cache.util.BeanUtils;
import org.jboss.cache.util.reflect.ReflectionUtil;
=
--===============5345397349852635456==--
From jbosscache-commits at lists.jboss.org Wed Aug 6 11:52:03 2008
Content-Type: multipart/mixed; boundary="===============7010537659095114419=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6532 -
benchmarks/benchmark-fwk/trunk.
Date: Wed, 06 Aug 2008 11:52:03 -0400
Message-ID:
--===============7010537659095114419==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: mircea.markus
Date: 2008-08-06 11:52:03 -0400 (Wed, 06 Aug 2008)
New Revision: 6532
Modified:
benchmarks/benchmark-fwk/trunk/runNode.sh
Log:
increased memory size
Modified: benchmarks/benchmark-fwk/trunk/runNode.sh
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- benchmarks/benchmark-fwk/trunk/runNode.sh 2008-08-06 14:58:15 UTC (rev =
6531)
+++ benchmarks/benchmark-fwk/trunk/runNode.sh 2008-08-06 15:52:03 UTC (rev =
6532)
@@ -2,6 +2,9 @@
# author: Mircea.Markus(a)jboss.com
# cygwin users: add the scripts from :pserver:anoncvs(a)cygwin.com:/cvs/cy=
gwin-apps/wrappers/java to the $cygwin_home/usr/local/bin
# those would make an automatic conversion from unix CLASSPATH to win clas=
spath, needed when executing java -cp
+# todo mmarkus - add another configuration file to set all the jvm params,=
which should be called by this one (phps benchmatrk-jvm.sh)
+# todo mmarkus - move the scripts in an bin directory as there are more an=
d more scrips now
+# todo mmarkus - if allJbossCacheTests.sh is launched with nohup it does n=
ot work, make that work
=
preferIPv4Stack=3Dtrue
DEBUG=3Ddebug
--===============7010537659095114419==--
From jbosscache-commits at lists.jboss.org Wed Aug 6 12:05:01 2008
Content-Type: multipart/mixed; boundary="===============5103622779698443563=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6533 -
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib.
Date: Wed, 06 Aug 2008 12:04:59 -0400
Message-ID:
--===============5103622779698443563==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: mircea.markus
Date: 2008-08-06 12:04:59 -0400 (Wed, 06 Aug 2008)
New Revision: 6533
Modified:
benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/lib/jboss=
cache-core.jar
Log:
updated lib
Modified: benchmarks/benchmark-fwk/trunk/cache-products/jbosscache-3.0.0/li=
b/jbosscache-core.jar
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
(Binary files differ)
--===============5103622779698443563==--
From jbosscache-commits at lists.jboss.org Wed Aug 6 12:14:05 2008
Content-Type: multipart/mixed; boundary="===============3815171948476281274=="
MIME-Version: 1.0
From: jbosscache-commits at lists.jboss.org
To: jbosscache-commits at lists.jboss.org
Subject: [jbosscache-commits] JBoss Cache SVN: r6534 -
core/trunk/src/main/resources/config-samples.
Date: Wed, 06 Aug 2008 12:14:05 -0400
Message-ID:
--===============3815171948476281274==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Author: mircea.markus
Date: 2008-08-06 12:14:04 -0400 (Wed, 06 Aug 2008)
New Revision: 6534
Added:
core/trunk/src/main/resources/config-samples/total-replication.xml
Modified:
core/trunk/src/main/resources/config-samples/buddy-replication.xml
core/trunk/src/main/resources/config-samples/invalidation-async.xml
Log:
updated configuration files
Modified: core/trunk/src/main/resources/config-samples/buddy-replication.xml
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- core/trunk/src/main/resources/config-samples/buddy-replication.xml 2008=
-08-06 16:04:59 UTC (rev 6533)
+++ core/trunk/src/main/resources/config-samples/buddy-replication.xml 2008=
-08-06 16:14:04 UTC (rev 6534)
@@ -28,7 +28,7 @@
-
-
+
+