cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brandonwilli...@apache.org
Subject svn commit: r1156254 - in /cassandra/trunk/src/java/org/apache/cassandra: gms/Gossiper.java net/MessagingService.java net/OutboundTcpConnection.java service/StorageProxy.java service/StorageService.java utils/FBUtilities.java
Date Wed, 10 Aug 2011 16:28:36 GMT
Author: brandonwilliams
Date: Wed Aug 10 16:28:35 2011
New Revision: 1156254

URL: http://svn.apache.org/viewvc?rev=1156254&view=rev
Log:
Use broadcastAddress instead of localAddress.
Patch by Vijay, reviewed by brandonwilliams for CASSANDRA-3000

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
    cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
    cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
    cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java

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=1156254&r1=1156253&r2=1156254&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java Wed Aug 10 16:28:35 2011
@@ -983,7 +983,7 @@ public class Gossiper implements IFailur
         EndpointState epState = endpointStateMap.get(FBUtilities.getBroadcastAddress());
         assert epState != null;
         epState.addApplicationState(state, value);
-        doNotifications(FBUtilities.getLocalAddress(), state, value);
+        doNotifications(FBUtilities.getBroadcastAddress(), state, value);
     }
 
     public void stop()

Modified: cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java?rev=1156254&r1=1156253&r2=1156254&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/net/MessagingService.java Wed Aug 10 16:28:35
2011
@@ -442,7 +442,7 @@ public final class MessagingService impl
     public void receive(Message message, String id)
     {
         if (logger_.isTraceEnabled())
-            logger_.trace(FBUtilities.getLocalAddress() + " received " + message.getVerb()
+            logger_.trace(FBUtilities.getBroadcastAddress() + " received " + message.getVerb()
                           + " from " + id + "@" + message.getFrom());
 
         message = SinkManager.processServerMessage(message, id);

Modified: cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnection.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnection.java?rev=1156254&r1=1156253&r2=1156254&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnection.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/net/OutboundTcpConnection.java Wed Aug 10
16:28:35 2011
@@ -45,7 +45,7 @@ public class OutboundTcpConnection exten
 {
     private static final Logger logger = LoggerFactory.getLogger(OutboundTcpConnection.class);
 
-    private static final Message CLOSE_SENTINEL = new Message(FBUtilities.getLocalAddress(),
+    private static final Message CLOSE_SENTINEL = new Message(FBUtilities.getBroadcastAddress(),
                                                               StorageService.Verb.INTERNAL_RESPONSE,
                                                               ArrayUtils.EMPTY_BYTE_ARRAY,
                                                               MessagingService.version_);

Modified: cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java?rev=1156254&r1=1156253&r2=1156254&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageProxy.java Wed Aug 10 16:28:35
2011
@@ -446,7 +446,7 @@ public class StorageProxy implements Sto
                 responseHandler.response(null);
 
                 // then send to replicas, if any
-                hintedEndpoints.removeAll(FBUtilities.getLocalAddress());
+                hintedEndpoints.removeAll(FBUtilities.getBroadcastAddress());
                 if (cm.shouldReplicateOnWrite() && !hintedEndpoints.isEmpty())
                 {
                     // We do the replication on another stage because it involves a read
(see CM.makeReplicationMutation)

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=1156254&r1=1156253&r2=1156254&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Wed Aug 10 16:28:35
2011
@@ -595,7 +595,7 @@ public class StorageService implements I
             List<String> rpcaddrs = new ArrayList<String>();
             for (InetAddress endpoint: entry.getValue())
             {
-                if (endpoint.equals(FBUtilities.getLocalAddress()))
+                if (endpoint.equals(FBUtilities.getBroadcastAddress()))
                     rpcaddrs.add(DatabaseDescriptor.getRpcAddress().getHostAddress());
                 else
                     rpcaddrs.add(Gossiper.instance.getEndpointStateForEndpoint(endpoint).getApplicationState(ApplicationState.RPC_ADDRESS).value);

Modified: cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java
URL: http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java?rev=1156254&r1=1156253&r2=1156254&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/utils/FBUtilities.java Wed Aug 10 16:28:35
2011
@@ -168,6 +168,9 @@ public class FBUtilities
         }
     }
 
+    /**
+     * Please use getBroadcastAddress instead. You need this only when you have to listen/connect.
+     */
     public static InetAddress getLocalAddress()
     {
         if (localInetAddress_ == null)



Mime
View raw message