[jbosscache-commits] JBoss Cache SVN: r8190 - core/trunk/src/main/java/org/jboss/cache/buddyreplication.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Tue Aug 18 05:36:46 EDT 2009


Author: manik.surtani at jboss.com
Date: 2009-08-18 05:36:45 -0400 (Tue, 18 Aug 2009)
New Revision: 8190

Modified:
   core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
Log:
[JBCACHE-1531] ( Replication is allowed when buddy group state is inconsistent ) backing out fix

Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java	2009-08-18 05:55:29 UTC (rev 8189)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java	2009-08-18 09:36:45 UTC (rev 8190)
@@ -23,16 +23,7 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.jboss.cache.CacheException;
-import org.jboss.cache.CacheSPI;
-import org.jboss.cache.DataContainer;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.Node;
-import org.jboss.cache.NodeSPI;
-import org.jboss.cache.RPCManager;
-import org.jboss.cache.Region;
-import org.jboss.cache.RegionEmptyException;
-import org.jboss.cache.RegionManager;
+import org.jboss.cache.*;
 import org.jboss.cache.commands.CommandsFactory;
 import org.jboss.cache.commands.ReplicableCommand;
 import org.jboss.cache.commands.VisitableCommand;
@@ -56,7 +47,6 @@
 import org.jboss.cache.notifications.event.ViewChangedEvent;
 import org.jboss.cache.statetransfer.StateTransferManager;
 import org.jboss.cache.util.concurrent.ConcurrentHashSet;
-import org.jboss.cache.util.concurrent.ReclosableLatch;
 import org.jboss.cache.util.reflect.ReflectionUtil;
 import org.jboss.util.stream.MarshalledValueInputStream;
 import org.jboss.util.stream.MarshalledValueOutputStream;
@@ -66,19 +56,7 @@
 import org.jgroups.util.Util;
 
 import java.io.ByteArrayInputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-import java.util.Vector;
+import java.util.*;
 import java.util.concurrent.BlockingQueue;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
@@ -179,8 +157,11 @@
    private BuddyFqnTransformer buddyFqnTransformer;
    
    private ConcurrentMap<String, Set<DefunctDataHistory>> defunctDataHistory = new ConcurrentHashMap<String, Set<DefunctDataHistory>>();
-   private final ReclosableLatch buddyMembershipInFluxLatch = new ReclosableLatch(true);
+   // Backing out fix for JBCACHE-1531 for 3.2.0.  Maybe this can come in in a future release, after more thought and
+   // analysis.  - Manik, 18 Aug 2009
+//   private final ReclosableLatch buddyMembershipInFluxLatch = new ReclosableLatch(true);
 
+
    public BuddyManager()
    {
    }
@@ -448,9 +429,9 @@
     */
    private void reassignBuddies(List<Address> members) throws CacheException
    {
-      buddyMembershipInFluxLatch.close();
-      try
-      {
+//      buddyMembershipInFluxLatch.close();
+//      try
+//      {
          List<Address> membership = new ArrayList<Address>(members); // defensive copy
 
          if (log.isDebugEnabled())
@@ -517,11 +498,11 @@
          }
          else
             log.debug("Nothing has changed; new buddy list is identical to the old one.");
-      }
-      finally
-      {
-         buddyMembershipInFluxLatch.open();
-      }
+//      }
+//      finally
+//      {
+//         buddyMembershipInFluxLatch.open();
+//      }
    }
 
    /**
@@ -781,14 +762,14 @@
     */
    public List<Address> getBuddyAddresses()
    {
-      try
-      {
-         buddyMembershipInFluxLatch.await();
-      }
-      catch (InterruptedException e)
-      {
-         Thread.currentThread().interrupt();
-      }
+//      try
+//      {
+//         buddyMembershipInFluxLatch.await();
+//      }
+//      catch (InterruptedException e)
+//      {
+//         Thread.currentThread().interrupt();
+//      }
       return buddyGroup.getBuddies();
    }
 
@@ -799,14 +780,14 @@
     */
    public Vector<Address> getBuddyAddressesAsVector()
    {
-      try
-      {
-         buddyMembershipInFluxLatch.await();
-      }
-      catch (InterruptedException e)
-      {
-         Thread.currentThread().interrupt();
-      }
+//      try
+//      {
+//         buddyMembershipInFluxLatch.await();
+//      }
+//      catch (InterruptedException e)
+//      {
+//         Thread.currentThread().interrupt();
+//      }
       return buddyGroup.getBuddiesAsVector();
    }
 



More information about the jbosscache-commits mailing list