[hornetq-commits] JBoss hornetq SVN: r9396 - in branches/2_2_0_HA_Improvements/src/main/org/hornetq/core: server/cluster and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Sun Jul 11 06:11:09 EDT 2010


Author: timfox
Date: 2010-07-11 06:11:08 -0400 (Sun, 11 Jul 2010)
New Revision: 9396

Modified:
   branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java
   branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/server/cluster/ClusterManager.java
   branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
Log:
HA improvements

Modified: branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java
===================================================================
--- branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java	2010-07-09 20:31:38 UTC (rev 9395)
+++ branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/protocol/core/impl/CoreProtocolManager.java	2010-07-11 10:11:08 UTC (rev 9396)
@@ -133,12 +133,12 @@
                   }
                });
             }
-            else if (packet.getType() == PacketImpl.NODE_ANNOUNCE)
-            {
-               NodeAnnounceMessage msg = (NodeAnnounceMessage)packet;
-               
-               server.getClusterManager().announceNode(msg.getNodeID(), msg.isBackup(), msg.getConnector());
-            }
+//            else if (packet.getType() == PacketImpl.NODE_ANNOUNCE)
+//            {
+//               NodeAnnounceMessage msg = (NodeAnnounceMessage)packet;
+//               
+//               server.getClusterManager().announceNode(msg.getNodeID(), msg.isBackup(), msg.getConnector());
+//            }
          }
       });
       

Modified: branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/server/cluster/ClusterManager.java
===================================================================
--- branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/server/cluster/ClusterManager.java	2010-07-09 20:31:38 UTC (rev 9395)
+++ branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/server/cluster/ClusterManager.java	2010-07-11 10:11:08 UTC (rev 9396)
@@ -41,10 +41,6 @@
 
    void activate();
    
-   void startAnnouncement();
-   
-   void stopAnnouncement();
-   
    void registerTopologyListener(ClusterTopologyListener listener, boolean clusterConnection);
    
    void unregisterTopologyListener(ClusterTopologyListener listener, boolean clusterConnection);

Modified: branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java	2010-07-09 20:31:38 UTC (rev 9395)
+++ branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java	2010-07-11 10:11:08 UTC (rev 9396)
@@ -43,9 +43,6 @@
 import org.hornetq.api.core.HornetQException;
 import org.hornetq.api.core.Pair;
 import org.hornetq.api.core.SimpleString;
-import org.hornetq.api.core.TransportConfiguration;
-import org.hornetq.api.core.client.ClientSessionFactory;
-import org.hornetq.api.core.client.HornetQClient;
 import org.hornetq.core.client.impl.ClientSessionFactoryImpl;
 import org.hornetq.core.config.Configuration;
 import org.hornetq.core.config.CoreQueueConfiguration;
@@ -368,6 +365,10 @@
             initialisePart1();
 
             initialisePart2();
+            
+            // Announce presence of live node to cluster
+            
+            clusterManager.announceNode(nodeID, false, connector);
 
             log.info("Server is now live");
          }
@@ -488,14 +489,14 @@
             log.info("Read node id " + nodeID);
 
             initialisePart1();
-
-            // TODO - now send announcement message to cluster
-
+            
+            //Announce presence of this backup to rest of cluster
+            
+            clusterManager.announceNode(nodeID, true, connector);
+            
             // We now look for the live.lock file - if it doesn't exist it means the live isn't started yet, so we wait
             // for that
             
-            clusterManager.startAnnouncement();
-
             while (true)
             {
                File liveLockFile = new File(configuration.getJournalDirectory(), "live.lock");
@@ -522,6 +523,10 @@
                }
 
                log.info("Obtained live lock");
+               
+               // Announce presence of live node to cluster
+               
+               clusterManager.announceNode(nodeID, false, connector);
 
                break;
             }
@@ -655,32 +660,6 @@
          backupActivationThread.start();
       }
 
-      // initialisePart1();
-      //
-      // if (configuration.isBackup())
-      // {
-      // if (!configuration.isSharedStore())
-      // {
-      // replicationEndpoint = new ReplicationEndpointImpl(this);
-      // replicationEndpoint.start();
-      // }
-      // else
-      // {
-      // backupLock = new FailoverLockFileImpl("backup.lock", configuration.getJournalDirectory());
-      // liveLock = new FailoverLockFileImpl("live.lock", configuration.getJournalDirectory());
-      // }
-      //         
-      // // We defer actually initialisation until the live node has contacted the backup
-      // //HornetQServerImpl.log.info("Backup server initialised");
-      // }
-      // else
-      // {
-      // initialisePart2();
-      // }
-      //
-      //      
-      // remotingService.start();
-
    }
 
    @Override



More information about the hornetq-commits mailing list