[jboss-user] [JBoss Cache: Core Edition] - Re: State transfer errors
manik.surtani@jboss.com
do-not-reply at jboss.com
Wed May 21 12:40:05 EDT 2008
Sorry for being so slow with this.
I don't see a problem here. Yes, your test fails, but that is due to a few minor issues.
1. Make sure you have the following enabled in your buddy replication config:
| <autoDataGravitation>true</autoDataGravitation>
|
2. After starting cache2, the BR organisation code takes a short while to assign buddies, etc. So calling switchCache() immediately after starting is a problem. You could either (1) wait for a short while, or much better, (2) register a listener on cache2 so you know when it has been assigned to a buddy group. I created a listener like:
| private void doTest()
| {
| ...
| final CountDownLatch latch = new CountDownLatch(1);
| cache2.addCacheListener(new BRListener(latch));
| cache2.start();
| latch.await();
|
| switchCache(OBJECTS / 2, OBJECTS, workers);
| ...
| }
|
| @CacheListener
| public static class BRListener
| {
| CountDownLatch latch;
|
| public BRListener(CountDownLatch latch)
| {
| this.latch = latch;
| }
|
| @BuddyGroupChanged
| public void releaseLatch(BuddyGroupChangedEvent event)
| {
| latch.countDown();
| }
| }
|
|
HTH,
Manik
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4152432#4152432
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4152432
More information about the jboss-user
mailing list