cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r893539 - /incubator/cassandra/branches/cassandra-0.5/src/java/org/apache/cassandra/locator/RackAwareStrategy.java
Date Wed, 23 Dec 2009 15:02:19 GMT
Author: jbellis
Date: Wed Dec 23 15:02:18 2009
New Revision: 893539

URL: http://svn.apache.org/viewvc?rev=893539&view=rev
Log:
fix circular initialization regression.  patch by jbellis for CASSANDRA-650

Modified:
    incubator/cassandra/branches/cassandra-0.5/src/java/org/apache/cassandra/locator/RackAwareStrategy.java

Modified: incubator/cassandra/branches/cassandra-0.5/src/java/org/apache/cassandra/locator/RackAwareStrategy.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/branches/cassandra-0.5/src/java/org/apache/cassandra/locator/RackAwareStrategy.java?rev=893539&r1=893538&r2=893539&view=diff
==============================================================================
--- incubator/cassandra/branches/cassandra-0.5/src/java/org/apache/cassandra/locator/RackAwareStrategy.java
(original)
+++ incubator/cassandra/branches/cassandra-0.5/src/java/org/apache/cassandra/locator/RackAwareStrategy.java
Wed Dec 23 15:02:18 2009
@@ -39,12 +39,9 @@
  */
 public class RackAwareStrategy extends AbstractReplicationStrategy
 {
-    private final EndPointSnitch endPointSnitch;
-
     public RackAwareStrategy(TokenMetadata tokenMetadata, IPartitioner partitioner, int replicas)
     {
         super(tokenMetadata, partitioner, replicas);
-        endPointSnitch = (EndPointSnitch) StorageService.instance().getEndPointSnitch();
     }
 
     public ArrayList<InetAddress> getNaturalEndpoints(Token token, TokenMetadata metadata)
@@ -76,6 +73,7 @@
             return endpoints;
         }
         startIndex = (index + 1)%totalNodes;
+        EndPointSnitch endPointSnitch = (EndPointSnitch) StorageService.instance().getEndPointSnitch();
 
         for (int i = startIndex, count = 1; count < totalNodes && foundCount <
replicas_; ++count, i = (i + 1) % totalNodes)
         {



Mime
View raw message