cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r905427 - in /incubator/cassandra/trunk/src/java/org/apache/cassandra: gms/EndPointState.java gms/Gossiper.java service/LoadDisseminator.java service/StorageService.java
Date Mon, 01 Feb 2010 22:05:38 GMT
Author: jbellis
Date: Mon Feb  1 22:05:37 2010
New Revision: 905427

URL: http://svn.apache.org/viewvc?rev=905427&view=rev
Log:
fix buggy assertion in client mode.  patch by jbellis

Modified:
    incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/EndPointState.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/LoadDisseminator.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/EndPointState.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/EndPointState.java?rev=905427&r1=905426&r2=905427&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/EndPointState.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/EndPointState.java Mon Feb
 1 22:05:37 2010
@@ -91,7 +91,6 @@
     
     void addApplicationState(String key, ApplicationState appState)
     {
-        assert !StorageService.instance.isClientMode();
         applicationState_.put(key, appState);        
     }
     

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java?rev=905427&r1=905426&r2=905427&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/gms/Gossiper.java Mon Feb  1 22:05:37
2010
@@ -851,8 +851,9 @@
         gossipTimer_.schedule( new GossipTimerTask(), Gossiper.intervalInMillis_, Gossiper.intervalInMillis_);
     }
 
-    public synchronized void addApplicationState(String key, ApplicationState appState)
+    public synchronized void addLocalApplicationState(String key, ApplicationState appState)
     {
+        assert !StorageService.instance.isClientMode();
         EndPointState epState = endPointStateMap_.get(localEndPoint_);
         assert epState != null;
         epState.addApplicationState(key, appState);

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/LoadDisseminator.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/LoadDisseminator.java?rev=905427&r1=905426&r2=905427&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/LoadDisseminator.java
(original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/LoadDisseminator.java
Mon Feb  1 22:05:37 2010
@@ -34,6 +34,6 @@
         String diskUtilization = String.valueOf(StorageService.instance.getLoad());
         if (logger_.isDebugEnabled())
           logger_.debug("Disseminating load info ...");
-        Gossiper.instance.addApplicationState(LoadDisseminator.loadInfo_, new ApplicationState(diskUtilization));
+        Gossiper.instance.addLocalApplicationState(LoadDisseminator.loadInfo_, new ApplicationState(diskUtilization));
     }
 }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java?rev=905427&r1=905426&r2=905427&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/StorageService.java Mon
Feb  1 22:05:37 2010
@@ -174,7 +174,7 @@
         isBootstrapMode = false;
         SystemTable.setBootstrapped(true);
         setToken(getLocalToken());
-        Gossiper.instance.addApplicationState(MOVE_STATE, new ApplicationState(STATE_NORMAL
+ Delimiter + partitioner_.getTokenFactory().toString(getLocalToken())));
+        Gossiper.instance.addLocalApplicationState(MOVE_STATE, new ApplicationState(STATE_NORMAL
+ Delimiter + partitioner_.getTokenFactory().toString(getLocalToken())));
         logger_.info("Bootstrap/move completed! Now serving reads.");
     }
 
@@ -307,7 +307,7 @@
             SystemTable.setBootstrapped(true);
             Token token = storageMetadata_.getToken();
             tokenMetadata_.updateNormalToken(token, FBUtilities.getLocalAddress());
-            Gossiper.instance.addApplicationState(MOVE_STATE, new ApplicationState(STATE_NORMAL
+ Delimiter + partitioner_.getTokenFactory().toString(token)));
+            Gossiper.instance.addLocalApplicationState(MOVE_STATE, new ApplicationState(STATE_NORMAL
+ Delimiter + partitioner_.getTokenFactory().toString(token)));
         }
 
         assert tokenMetadata_.sortedTokens().size() > 0;
@@ -317,7 +317,7 @@
     {
         isBootstrapMode = true;
         SystemTable.updateToken(token); // DON'T use setToken, that makes us part of the
ring locally which is incorrect until we are done bootstrapping
-        Gossiper.instance.addApplicationState(MOVE_STATE, new ApplicationState(STATE_BOOTSTRAPPING
+ Delimiter + partitioner_.getTokenFactory().toString(token)));
+        Gossiper.instance.addLocalApplicationState(MOVE_STATE, new ApplicationState(STATE_BOOTSTRAPPING
+ Delimiter + partitioner_.getTokenFactory().toString(token)));
         logger_.info("bootstrap sleeping " + RING_DELAY);
         try
         {
@@ -1251,7 +1251,7 @@
      */
     private void startLeaving()
     {
-        Gossiper.instance.addApplicationState(MOVE_STATE, new ApplicationState(STATE_LEAVING
+ Delimiter + getLocalToken().toString()));
+        Gossiper.instance.addLocalApplicationState(MOVE_STATE, new ApplicationState(STATE_LEAVING
+ Delimiter + getLocalToken().toString()));
         tokenMetadata_.addLeavingEndPoint(FBUtilities.getLocalAddress());
         calculatePendingRanges();
     }
@@ -1291,7 +1291,7 @@
 
         if (logger_.isDebugEnabled())
             logger_.debug("");
-        Gossiper.instance.addApplicationState(MOVE_STATE, new ApplicationState(STATE_LEFT
+ Delimiter + LEFT_NORMALLY + Delimiter + getLocalToken().toString()));
+        Gossiper.instance.addLocalApplicationState(MOVE_STATE, new ApplicationState(STATE_LEFT
+ Delimiter + LEFT_NORMALLY + Delimiter + getLocalToken().toString()));
         try
         {
             Thread.sleep(2 * Gossiper.intervalInMillis_);
@@ -1413,7 +1413,7 @@
         // not good. REMOVE_TOKEN|LEFT_NORMALLY is used to distinguish
         // between removetoken command and normal state left, so it is
         // not so bad.
-        Gossiper.instance.addApplicationState(MOVE_STATE, new ApplicationState(STATE_LEFT
+ Delimiter + REMOVE_TOKEN + Delimiter + token.toString()));
+        Gossiper.instance.addLocalApplicationState(MOVE_STATE, new ApplicationState(STATE_LEFT
+ Delimiter + REMOVE_TOKEN + Delimiter + token.toString()));
     }
 
     public WriteResponseHandler getWriteResponseHandler(int blockFor, ConsistencyLevel consistency_level)



Mime
View raw message