You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by jb...@apache.org on 2010/10/12 23:19:14 UTC

svn commit: r1021929 - /cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java

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 + ")");