cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1171744 - /cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/service/StorageService.java
Date Fri, 16 Sep 2011 19:31:43 GMT
Author: jbellis
Date: Fri Sep 16 19:31:43 2011
New Revision: 1171744

URL: http://svn.apache.org/viewvc?rev=1171744&view=rev
Log:
update code style

Modified:
    cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/service/StorageService.java

Modified: cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/service/StorageService.java?rev=1171744&r1=1171743&r2=1171744&view=diff
==============================================================================
--- cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/service/StorageService.java
(original)
+++ cassandra/branches/cassandra-1.0.0/src/java/org/apache/cassandra/service/StorageService.java
Fri Sep 16 19:31:43 2011
@@ -506,11 +506,22 @@ public class StorageService implements I
             }
             if (logger_.isDebugEnabled())
                 logger_.debug("... got ring + schema info");
-            if (null != DatabaseDescriptor.getReplaceToken())
+
+            if (DatabaseDescriptor.getReplaceToken() == null)
+            {
+                if (tokenMetadata_.isMember(FBUtilities.getBroadcastAddress()))
+                {
+                    String s = "This node is already a member of the token ring; bootstrap
aborted. (If replacing a dead node, remove the old one from the ring first.)";
+                    throw new UnsupportedOperationException(s);
+                }
+                setMode("Joining: getting bootstrap token", true);
+                token = BootStrapper.getBootstrapToken(tokenMetadata_, LoadBroadcaster.instance.getLoadInfo());
+            }
+            else
             {
                 try
                 {
-                    // Sleeping additionally to make sure that the server actually is not
alive 
+                    // Sleeping additionally to make sure that the server actually is not
alive
                     // and giving it more time to gossip if alive.
                     Thread.sleep(LoadBroadcaster.BROADCAST_INTERVAL);
                 }
@@ -525,16 +536,7 @@ public class StorageService implements I
                     throw new UnsupportedOperationException("Cannnot replace a token for
a Live node... ");
                 setMode("Joining: Replacing a node with token: " + token, true);
             }
-            else
-            {
-                if (tokenMetadata_.isMember(FBUtilities.getBroadcastAddress()))
-                {
-                    String s = "This node is already a member of the token ring; bootstrap
aborted. (If replacing a dead node, remove the old one from the ring first.)";
-                    throw new UnsupportedOperationException(s);
-                }
-                setMode("Joining: getting bootstrap token", true);
-                token = BootStrapper.getBootstrapToken(tokenMetadata_, LoadBroadcaster.instance.getLoadInfo());
-            }
+
             // don't bootstrap if there are no tables defined.
             if (Schema.instance.getNonSystemTables().size() > 0)
             {



Mime
View raw message