cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [2/3] git commit: only waitForGossip if we're configured for a multinode cluster
Date Wed, 12 Feb 2014 21:48:34 GMT
only waitForGossip if we're configured for a multinode cluster


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/c6c686f4
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/c6c686f4
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/c6c686f4

Branch: refs/heads/trunk
Commit: c6c686f4138e6646bad233e89a630be0aada08ae
Parents: efec07e
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Wed Feb 12 15:48:14 2014 -0600
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Wed Feb 12 15:48:14 2014 -0600

----------------------------------------------------------------------
 .../org/apache/cassandra/service/CassandraDaemon.java   |  5 +++--
 src/java/org/apache/cassandra/utils/FBUtilities.java    | 12 ++++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/c6c686f4/src/java/org/apache/cassandra/service/CassandraDaemon.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/CassandraDaemon.java b/src/java/org/apache/cassandra/service/CassandraDaemon.java
index 5f3c8cc..23bf3e5 100644
--- a/src/java/org/apache/cassandra/service/CassandraDaemon.java
+++ b/src/java/org/apache/cassandra/service/CassandraDaemon.java
@@ -60,6 +60,7 @@ import org.apache.cassandra.metrics.StorageMetrics;
 import org.apache.cassandra.thrift.ThriftServer;
 import org.apache.cassandra.tracing.Tracing;
 import org.apache.cassandra.utils.CLibrary;
+import org.apache.cassandra.utils.FBUtilities;
 import org.apache.cassandra.utils.Mx4jTool;
 import org.apache.cassandra.utils.Pair;
 
@@ -372,7 +373,8 @@ public class CassandraDaemon
             }
         }
 
-        waitForGossipToSettle();
+        if (!FBUtilities.getBroadcastAddress().equals(FBUtilities.getLoopback()))
+            waitForGossipToSettle();
 
         // Thift
         InetAddress rpcAddr = DatabaseDescriptor.getRpcAddress();
@@ -498,7 +500,6 @@ public class CassandraDaemon
         destroy();
     }
 
-
     private void waitForGossipToSettle()
     {
         int forceAfter = Integer.getInteger("cassandra.skip_wait_for_gossip_to_settle", -1);

http://git-wip-us.apache.org/repos/asf/cassandra/blob/c6c686f4/src/java/org/apache/cassandra/utils/FBUtilities.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/utils/FBUtilities.java b/src/java/org/apache/cassandra/utils/FBUtilities.java
index 579f5fa..0cacfe2 100644
--- a/src/java/org/apache/cassandra/utils/FBUtilities.java
+++ b/src/java/org/apache/cassandra/utils/FBUtilities.java
@@ -693,4 +693,16 @@ public class FBUtilities
     {
         return OPERATING_SYSTEM.contains("nix") || OPERATING_SYSTEM.contains("nux") || OPERATING_SYSTEM.contains("aix");
     }
+
+    public static InetAddress getLoopback()
+    {
+        try
+        {
+            return InetAddress.getByName(null);
+        }
+        catch (UnknownHostException e)
+        {
+            throw new AssertionError(e);
+        }
+    }
 }


Mime
View raw message