cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdusba...@apache.org
Subject svn commit: r931197 - in /cassandra/trunk/src/java/org/apache/cassandra: gms/GossipDigestAckMessage.java gms/Gossiper.java gms/JoinMessage.java service/StorageService.java
Date Tue, 06 Apr 2010 16:01:18 GMT
Author: gdusbabek
Date: Tue Apr  6 16:01:17 2010
New Revision: 931197

URL: http://svn.apache.org/viewvc?rev=931197&view=rev
Log:
remove unused JoinMessage.  Patch by Gary Dusbabek, reviewed by Jonthan Ellis. CASSANDRA-827

Removed:
    cassandra/trunk/src/java/org/apache/cassandra/gms/JoinMessage.java
Modified:
    cassandra/trunk/src/java/org/apache/cassandra/gms/GossipDigestAckMessage.java
    cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java

Modified: cassandra/trunk/src/java/org/apache/cassandra/gms/GossipDigestAckMessage.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/gms/GossipDigestAckMessage.java?rev=931197&r1=931196&r2=931197&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/gms/GossipDigestAckMessage.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/gms/GossipDigestAckMessage.java Tue Apr
 6 16:01:17 2010
@@ -55,11 +55,6 @@ class GossipDigestAckMessage
         epStateMap_ = epStateMap;
     }
     
-    void addGossipDigest(InetAddress ep, int generation, int version)
-    {
-        gDigestList_.add( new GossipDigest(ep, generation, version) );
-    }
-    
     List<GossipDigest> getGossipDigestList()
     {
         return gDigestList_;

Modified: cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java?rev=931197&r1=931196&r2=931197&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java Tue Apr  6 16:01:17 2010
@@ -177,7 +177,7 @@ public class Gossiper implements IFailur
         EndPointState epState = endPointStateMap_.get(endpoint);
         if (epState.isAlive())
         {
-            logger_.info("InetAddress {} is now dead.", endpoint);;
+            logger_.info("InetAddress {} is now dead.", endpoint);
             isAlive(endpoint, epState, false);
         }
     }
@@ -318,7 +318,7 @@ public class Gossiper implements IFailur
         int index = (size == 1) ? 0 : random_.nextInt(size);
         InetAddress to = liveEndPoints.get(index);
         if (logger_.isTraceEnabled())
-            logger_.trace("Sending a GossipDigestSynMessage to {} ...", to);;
+            logger_.trace("Sending a GossipDigestSynMessage to {} ...", to);
         MessagingService.instance.sendOneWay(message, to);
         return seeds_.contains(to);
     }
@@ -474,21 +474,6 @@ public class Gossiper implements IFailur
         return reqdEndPointState;
     }
 
-    /*
-     * This method is called only from the JoinVerbHandler. This happens
-     * when a new node coming up multicasts the JoinMessage. Here we need
-     * to add the endPoint to the list of live endpoints.
-    */
-    synchronized void join(InetAddress from)
-    {
-        if ( !from.equals( localEndPoint_ ) )
-        {
-            /* Mark this endpoint as "live" */
-        	liveEndpoints_.add(from);
-            unreachableEndpoints_.remove(from);
-        }
-    }
-
     void notifyFailureDetector(List<GossipDigest> gDigests)
     {
         IFailureDetector fd = FailureDetector.instance;
@@ -566,7 +551,7 @@ public class Gossiper implements IFailur
         if ( !localState.isAlive() )
         {
             isAlive(addr, localState, true);
-            logger_.info("InetAddress {} is now UP", addr);;
+            logger_.info("InetAddress {} is now UP", addr);
         }
     }
 
@@ -574,13 +559,13 @@ public class Gossiper implements IFailur
     {
         if (justRemovedEndPoints_.containsKey(ep))
             return;
-    	logger_.info("Node {} is now part of the cluster", ep);;
+    	logger_.info("Node {} is now part of the cluster", ep);
         handleMajorStateChange(ep, epState, false);
     }
 
     private void handleGenerationChange(InetAddress ep, EndPointState epState)
     {
-        logger_.info("Node {} has restarted, now UP again", ep);;
+        logger_.info("Node {} has restarted, now UP again", ep);
         handleMajorStateChange(ep, epState, true);
     }
 
@@ -866,39 +851,6 @@ public class Gossiper implements IFailur
         gossipTimer_ = new Timer(false); // makes the Gossiper reentrant.
     }
 
-    public static class JoinVerbHandler implements IVerbHandler
-    {
-        private static Logger logger_ = LoggerFactory.getLogger( JoinVerbHandler.class);
-
-        public void doVerb(Message message)
-        {
-            InetAddress from = message.getFrom();
-            if (logger_.isDebugEnabled())
-              logger_.debug("Received a JoinMessage from {}", from);
-
-            byte[] bytes = message.getMessageBody();
-            DataInputStream dis = new DataInputStream( new ByteArrayInputStream(bytes) );
-
-            JoinMessage joinMessage;
-            try
-            {
-                joinMessage = JoinMessage.serializer().deserialize(dis);
-            }
-            catch (IOException e)
-            {
-                throw new RuntimeException(e);
-            }
-            if ( joinMessage.clusterId_.equals( DatabaseDescriptor.getClusterName() ) )
-            {
-                Gossiper.instance.join(from);
-            }
-            else
-            {
-                logger_.warn("ClusterName mismatch from " + from + " " + joinMessage.clusterId_
 + "!=" + DatabaseDescriptor.getClusterName());
-            }
-        }
-    }
-
     public static class GossipDigestSynVerbHandler implements IVerbHandler
     {
         private static Logger logger_ = LoggerFactory.getLogger( GossipDigestSynVerbHandler.class);

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java?rev=931197&r1=931196&r2=931197&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Tue Apr  6 16:01:17
2010
@@ -103,7 +103,6 @@ public class StorageService implements I
         BOOTSTRAP_TOKEN,
         TREE_REQUEST,
         TREE_RESPONSE,
-        JOIN,
         GOSSIP_DIGEST_SYN,
         GOSSIP_DIGEST_ACK,
         GOSSIP_DIGEST_ACK2,
@@ -224,7 +223,6 @@ public class StorageService implements I
         MessagingService.instance.registerVerbHandlers(Verb.TREE_REQUEST, new TreeRequestVerbHandler());
         MessagingService.instance.registerVerbHandlers(Verb.TREE_RESPONSE, new AntiEntropyService.TreeResponseVerbHandler());
 
-        MessagingService.instance.registerVerbHandlers(Verb.JOIN, new Gossiper.JoinVerbHandler());
         MessagingService.instance.registerVerbHandlers(Verb.GOSSIP_DIGEST_SYN, new Gossiper.GossipDigestSynVerbHandler());
         MessagingService.instance.registerVerbHandlers(Verb.GOSSIP_DIGEST_ACK, new Gossiper.GossipDigestAckVerbHandler());
         MessagingService.instance.registerVerbHandlers(Verb.GOSSIP_DIGEST_ACK2, new Gossiper.GossipDigestAck2VerbHandler());



Mime
View raw message