[jboss-cvs] JBossCache/src/org/jboss/cache/buddyreplication ...

Manik Surtani manik at jboss.org
Fri May 25 12:34:51 EDT 2007


  User: msurtani
  Date: 07/05/25 12:34:51

  Modified:    src/org/jboss/cache/buddyreplication  BuddyManager.java
  Log:
  Fixed some pretty nasty BR issues
  
  Revision  Changes    Path
  1.75      +27 -20    JBossCache/src/org/jboss/cache/buddyreplication/BuddyManager.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BuddyManager.java
  ===================================================================
  RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/buddyreplication/BuddyManager.java,v
  retrieving revision 1.74
  retrieving revision 1.75
  diff -u -b -r1.74 -r1.75
  --- BuddyManager.java	23 May 2007 10:28:58 -0000	1.74
  +++ BuddyManager.java	25 May 2007 16:34:51 -0000	1.75
  @@ -43,7 +43,6 @@
   import java.util.concurrent.CountDownLatch;
   import java.util.concurrent.LinkedBlockingQueue;
   import java.util.concurrent.TimeUnit;
  -import java.util.concurrent.atomic.AtomicInteger;
   
   /**
    * Class that manages buddy replication groups.
  @@ -104,7 +103,6 @@
       * Async thread that handles items on the view change queue
       */
      private AsyncViewChangeHandlerThread asyncViewChangeHandler = new AsyncViewChangeHandlerThread();
  -   private static AtomicInteger threadId = new AtomicInteger(0);
   
      /**
       * Constants representng the buddy backup subtree
  @@ -269,7 +267,7 @@
         }
      }
   
  -   private void enqueueViewChange(List<Address> oldMembers, List<Address> newMembers)
  +   private synchronized void enqueueViewChange(List<Address> oldMembers, List<Address> newMembers)
      {
         // put this on a queue
         try
  @@ -404,15 +402,24 @@
         buddyGroupsIParticipateIn.remove(groupName);
   
         // remove backup data for this group
  -      if (log.isInfoEnabled()) log.info("Removing backup data for group " + groupName);
  -      try
  -      {
  -         cache.remove(new Fqn(BUDDY_BACKUP_SUBTREE_FQN, groupName));
  -      }
  -      catch (CacheException e)
  -      {
  -         log.error("Unable to remove backup data for group " + groupName, e);
  -      }
  +      // TODO: should we REALLY be doing this?  How do we know that this node didn't die and by removing this data we're deleting bkups?
  +//      if (log.isInfoEnabled()) log.info("Removing backup data for group " + groupName);
  +//
  +//      try
  +//      {
  +//         // should be a LOCAL call.
  +//         // cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
  +//          
  +//         // cache.remove(new Fqn(BUDDY_BACKUP_SUBTREE_FQN, groupName));
  +//      }
  +//      catch (CacheException e)
  +//      {
  +//         log.error("Unable to remove backup data for group " + groupName, e);
  +//      }
  +//      finally
  +//      {
  +//         cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(false);
  +//      }
      }
   
      /**
  @@ -595,7 +602,7 @@
         {
            try
            {
  -            makeRemoteCall(buddies, replicateCall);
  +            makeRemoteCall(buddies, replicateCall, true);
               break;
            }
            catch (Exception e)
  @@ -694,7 +701,7 @@
         {
            try
            {
  -            makeRemoteCall(buddies, replicateCall);
  +            makeRemoteCall(buddies, replicateCall, true);
               break;
            }
            catch (Exception e)
  @@ -848,7 +855,7 @@
   
         try
         {
  -         makeRemoteCall(recipients, replicateCall);
  +         makeRemoteCall(recipients, replicateCall, true);
         }
         catch (Exception e)
         {
  @@ -856,7 +863,7 @@
         }
      }
   
  -   private void makeRemoteCall(List<Address> recipients, MethodCall call) throws Exception
  +   private void makeRemoteCall(List<Address> recipients, MethodCall call, boolean sync) throws Exception
      {
         // remove non-members from dest list
         if (recipients != null)
  @@ -873,7 +880,7 @@
            }
         }
   
  -      cache.callRemoteMethods(recipients, call, true, true, config.getBuddyCommunicationTimeout());
  +      cache.callRemoteMethods(recipients, call, sync, true, config.getBuddyCommunicationTimeout());
      }
   
   
  @@ -942,7 +949,7 @@
            if (t == null || !t.isAlive())
            {
               t = new Thread(this);
  -            t.setName("AsyncViewChangeHandlerThread-" + threadId.getAndIncrement());
  +            t.setName("AsyncViewChangeHandlerThread," + cache.getLocalAddress());
               t.setDaemon(true);
               t.start();
            }
  
  
  



More information about the jboss-cvs-commits mailing list