cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r1021929 - /cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
Date Tue, 12 Oct 2010 21:19:14 GMT
Author: jbellis
Date: Tue Oct 12 21:19:14 2010
New Revision: 1021929

URL: http://svn.apache.org/viewvc?rev=1021929&view=rev
Log:
cleanup parameters to handleStateRemoving.  patch by jbellis

Modified:
    cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java

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=1021929&r1=1021928&r2=1021929&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Tue Oct 12 21:19:14
2010
@@ -676,8 +676,10 @@ public class StorageService implements I
                                        endpoint, currentNode, token, endpoint));
         }
 
-        if(pieces.length > 2) {
-            handleStateRemoving(endpoint, pieces);
+        if (pieces.length > 2)
+        {
+            assert pieces.length == 4;
+            handleStateRemoving(endpoint, getPartitioner().getTokenFactory().fromString(pieces[3]),
pieces[2]);
         }
 
         calculatePendingRanges();
@@ -753,12 +755,9 @@ public class StorageService implements I
      * Handle node being actively removed from the ring.
      *
      * @param endpoint node
-     * @param pieces (token to notify of removal)(token to remove)(unused)(unused)
      */
-    private void handleStateRemoving(InetAddress endpoint, String[] pieces)
+    private void handleStateRemoving(InetAddress endpoint, Token removeToken, String state)
     {
-        assert pieces.length == 4;
-        Token removeToken = getPartitioner().getTokenFactory().fromString(pieces[3]);
         InetAddress removeEndpoint = tokenMetadata_.getEndpoint(removeToken);
         
         if (removeEndpoint == null)
@@ -770,14 +769,14 @@ public class StorageService implements I
             return;
         }
 
-        if (VersionedValue.REMOVED_TOKEN.equals(pieces[2]))
+        if (VersionedValue.REMOVED_TOKEN.equals(state))
         {
             Gossiper.instance.removeEndpoint(removeEndpoint);
             tokenMetadata_.removeEndpoint(removeEndpoint);
             HintedHandOffManager.deleteHintsForEndPoint(removeEndpoint);
             tokenMetadata_.removeBootstrapToken(removeToken);
         }
-        else if (VersionedValue.REMOVING_TOKEN.equals(pieces[2]))
+        else if (VersionedValue.REMOVING_TOKEN.equals(state))
         {
             if (logger_.isDebugEnabled())
                 logger_.debug("Token " + removeToken + " removed manually (endpoint was "
+ removeEndpoint + ")");



Mime
View raw message