cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject svn commit: r1063418 - in /cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms: GossipDigestAckVerbHandler.java GossipDigestSynVerbHandler.java Gossiper.java
Date Tue, 25 Jan 2011 19:37:22 GMT
Author: brandonwilliams
Date: Tue Jan 25 19:37:22 2011
New Revision: 1063418

URL: http://svn.apache.org/viewvc?rev=1063418&view=rev
Log:
Do not respond to gossip when gossip is disabled.
Patch by brandonwilliams, reviewed by jbellis for CASSANDRA-1108

Modified:
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/GossipDigestAckVerbHandler.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/GossipDigestSynVerbHandler.java
    cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/Gossiper.java

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/GossipDigestAckVerbHandler.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/GossipDigestAckVerbHandler.java?rev=1063418&r1=1063417&r2=1063418&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/GossipDigestAckVerbHandler.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/GossipDigestAckVerbHandler.java
Tue Jan 25 19:37:22 2011
@@ -45,6 +45,12 @@ public class GossipDigestAckVerbHandler 
         InetAddress from = message.getFrom();
         if (logger_.isTraceEnabled())
             logger_.trace("Received a GossipDigestAckMessage from {}", from);
+        if (!Gossiper.instance.isEnabled())
+        {
+            if (logger_.isTraceEnabled())
+                logger_.trace("Ignoring GossipDigestAckMessage because gossip is disabled");
+            return;
+        }
 
         byte[] bytes = message.getMessageBody();
         DataInputStream dis = new DataInputStream( new ByteArrayInputStream(bytes) );

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/GossipDigestSynVerbHandler.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/GossipDigestSynVerbHandler.java?rev=1063418&r1=1063417&r2=1063418&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/GossipDigestSynVerbHandler.java
(original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/GossipDigestSynVerbHandler.java
Tue Jan 25 19:37:22 2011
@@ -44,6 +44,12 @@ public class GossipDigestSynVerbHandler 
         InetAddress from = message.getFrom();
         if (logger_.isTraceEnabled())
             logger_.trace("Received a GossipDigestSynMessage from {}", from);
+        if (!Gossiper.instance.isEnabled())
+        {
+            if (logger_.isTraceEnabled())
+                logger_.trace("Ignoring GossipDigestSynMessage because gossip is disabled");
+            return;
+        }
 
         byte[] bytes = message.getMessageBody();
         DataInputStream dis = new DataInputStream( new ByteArrayInputStream(bytes) );

Modified: cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/Gossiper.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/Gossiper.java?rev=1063418&r1=1063417&r2=1063418&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/Gossiper.java (original)
+++ cassandra/branches/cassandra-0.7/src/java/org/apache/cassandra/gms/Gossiper.java Tue Jan
25 19:37:22 2011
@@ -897,6 +897,11 @@ public class Gossiper implements IFailur
         scheduledGossipTask.cancel(false);
     }
 
+    public boolean isEnabled()
+    {
+        return !scheduledGossipTask.isCancelled();
+    }
+
     /**
      * This should *only* be used for testing purposes.
      */



Mime
View raw message