cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r930938 - in /cassandra/branches/cassandra-0.6: CHANGES.txt src/java/org/apache/cassandra/service/AntiEntropyService.java src/java/org/apache/cassandra/service/StorageService.java
Date Mon, 05 Apr 2010 19:50:46 GMT
Author: jbellis
Date: Mon Apr  5 19:50:45 2010
New Revision: 930938

URL: http://svn.apache.org/viewvc?rev=930938&view=rev
Log:
update CHANGES

Modified:
    cassandra/branches/cassandra-0.6/CHANGES.txt
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/AntiEntropyService.java
    cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageService.java

Modified: cassandra/branches/cassandra-0.6/CHANGES.txt
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/CHANGES.txt?rev=930938&r1=930937&r2=930938&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/CHANGES.txt (original)
+++ cassandra/branches/cassandra-0.6/CHANGES.txt Mon Apr  5 19:50:45 2010
@@ -3,6 +3,7 @@
  * keep the replica set constant throughout the read repair process
    (CASSANDRA-937)
  * allow querying getAllRanges with empty token list (CASSANDRA-933)
+ * fix command line arguments inversion in clustertool (CASSANDRA-942)
 
 
 0.6.0-RC1

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/AntiEntropyService.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/AntiEntropyService.java?rev=930938&r1=930937&r2=930938&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/AntiEntropyService.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/AntiEntropyService.java
Mon Apr  5 19:50:45 2010
@@ -43,9 +43,6 @@ import org.apache.cassandra.utils.*;
 
 import org.apache.log4j.Logger;
 
-import com.google.common.collect.Collections2;
-import com.google.common.base.Predicates;
-
 /**
  * AntiEntropyService encapsulates "validating" (hashing) individual column families,
  * exchanging MerkleTrees with remote nodes via a TreeRequest/Response conversation,
@@ -141,12 +138,18 @@ public class AntiEntropyService
     /**
      * Return all of the neighbors with whom we share data.
      */
-    private static Collection<InetAddress> getNeighbors(String table)
+    public static Set<InetAddress> getNeighbors(String table)
     {
-        InetAddress local = FBUtilities.getLocalAddress();
         StorageService ss = StorageService.instance;
-        return Collections2.filter(ss.getNaturalEndpoints(table, ss.getLocalToken()),
-                                   Predicates.not(Predicates.equalTo(local)));
+        Set<InetAddress> neighbors = new HashSet<InetAddress>();
+        Map<Range, List<InetAddress>> replicaSets = ss.getRangeToAddressMap(table);
+        for (Range range : ss.getLocalRanges(table))
+        {
+            // for every range stored locally (replica or original) collect neighbors storing
copies
+            neighbors.addAll(replicaSets.get(range));
+        }
+        neighbors.remove(FBUtilities.getLocalAddress());
+        return neighbors;
     }
 
     /**

Modified: cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageService.java
URL: http://svn.apache.org/viewvc/cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageService.java?rev=930938&r1=930937&r2=930938&view=diff
==============================================================================
--- cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageService.java
(original)
+++ cassandra/branches/cassandra-0.6/src/java/org/apache/cassandra/service/StorageService.java
Mon Apr  5 19:50:45 2010
@@ -1063,7 +1063,8 @@ public class StorageService implements I
     {
         // request that all relevant endpoints generate trees
         final MessagingService ms = MessagingService.instance;
-        final List<InetAddress> endpoints = getNaturalEndpoints(tableName, getLocalToken());
+        final Set<InetAddress> endpoints = AntiEntropyService.getNeighbors(tableName);
+        endpoints.add(FBUtilities.getLocalAddress());
         for (ColumnFamilyStore cfStore : getValidColumnFamilies(tableName, columnFamilies))
         {
             Message request = TreeRequestVerbHandler.makeVerb(tableName, cfStore.getColumnFamilyName());



Mime
View raw message