Author: slebresne
Date: Wed Sep 28 17:07:07 2011
New Revision: 1176966

URL: http://svn.apache.org/viewvc?rev=1176966&view=rev
Log:
merge from 1.0

Modified:
    cassandra/trunk/   (props changed)
    cassandra/trunk/CHANGES.txt
    cassandra/trunk/contrib/   (props changed)
    
cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
   (props changed)
    
cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
   (props changed)
    
cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
   (props changed)
    
cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
   (props changed)
    
cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
   (props changed)
    
cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java
    
cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractNetworkTopologySnitch.java
    
cassandra/trunk/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
    cassandra/trunk/src/java/org/apache/cassandra/locator/SimpleSnitch.java

Propchange: cassandra/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 28 17:07:07 2011
@@ -1,11 +1,11 @@
 
/cassandra/branches/cassandra-0.6:922689-1052356,1052358-1053452,1053454,1053456-1131291
 /cassandra/branches/cassandra-0.7:1026516-1170333,1172024
 /cassandra/branches/cassandra-0.7.0:1053690-1055654
-/cassandra/branches/cassandra-0.8:1090934-1125013,1125019-1176205
+/cassandra/branches/cassandra-0.8:1090934-1125013,1125019-1176205,1176712
 /cassandra/branches/cassandra-0.8.0:1125021-1130369
 /cassandra/branches/cassandra-0.8.1:1101014-1125018
-/cassandra/branches/cassandra-1.0:1167085-1176433
-/cassandra/branches/cassandra-1.0.0:1167104-1167229,1167232-1176432
+/cassandra/branches/cassandra-1.0:1167085-1176433,1176963
+/cassandra/branches/cassandra-1.0.0:1167104-1167229,1167232-1176432,1176961
 /cassandra/tags/cassandra-0.7.0-rc3:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1:1102511-1125020
 /incubator/cassandra/branches/cassandra-0.3:774578-796573

Modified: cassandra/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/cassandra/trunk/CHANGES.txt?rev=1176966&r1=1176965&r2=1176966&view=diff
==============================================================================
--- cassandra/trunk/CHANGES.txt (original)
+++ cassandra/trunk/CHANGES.txt Wed Sep 28 17:07:07 2011
@@ -8,6 +8,8 @@
  * test for NUMA policy support as well as numactl presence (CASSANDRA-3245)
  * Fix FD leak when internode encryption is enabled (CASSANDRA-3257)
  * Remove incorrect assertion in mergeIterator (CASSANDRA-3260)
+ * Keep SimpleSnitch proximity ordering unchanged from what the Strategy
+   generates, as intended (CASSANDRA-3262)
 
 
 1.0.0-rc1
@@ -114,6 +116,9 @@
  * make memtable throughput and column count thresholds no-ops (CASSANDRA-2449)
 
 
+=======
+
+>>>>>>> .merge-right.r1176712
 0.8.6
  * revert CASSANDRA-2388
  * change TokenRange.endpoints back to listen/broadcast address to match

Propchange: cassandra/trunk/contrib/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 28 17:07:07 2011
@@ -1,11 +1,11 @@
 
/cassandra/branches/cassandra-0.6/contrib:922689-1052356,1052358-1053452,1053454,1053456-1068009
 /cassandra/branches/cassandra-0.7/contrib:1026516-1170333,1172024
 /cassandra/branches/cassandra-0.7.0/contrib:1053690-1055654
-/cassandra/branches/cassandra-0.8/contrib:1090934-1125013,1125019-1175057,1175880
+/cassandra/branches/cassandra-0.8/contrib:1090934-1125013,1125019-1175057,1175880,1176712
 /cassandra/branches/cassandra-0.8.0/contrib:1125021-1130369
 /cassandra/branches/cassandra-0.8.1/contrib:1101014-1125018
-/cassandra/branches/cassandra-1.0/contrib:1167085-1176433
-/cassandra/branches/cassandra-1.0.0/contrib:1167104-1167229,1167232-1175725,1175770-1175771,1175882,1176371
+/cassandra/branches/cassandra-1.0/contrib:1167085-1176433,1176963
+/cassandra/branches/cassandra-1.0.0/contrib:1167104-1167229,1167232-1175725,1175770-1175771,1175882,1176371,1176961
 /cassandra/tags/cassandra-0.7.0-rc3/contrib:1051699-1053689
 /cassandra/tags/cassandra-0.8.0-rc1/contrib:1102511-1125020
 /incubator/cassandra/branches/cassandra-0.3/contrib:774578-796573

Propchange: 
cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 28 17:07:07 2011
@@ -1,11 +1,11 @@
 
/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 
/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1026516-1170333,1172024
 
/cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090934-1125013,1125019-1175057,1175880
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1090934-1125013,1125019-1175057,1175880,1176712
 
/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1125021-1130369
 
/cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1101014-1125018
-/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167085-1176433
-/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167104-1167229,1167232-1175725,1175770-1175771,1175882,1176371
+/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167085-1176433,1176963
+/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1167104-1167229,1167232-1175725,1175770-1175771,1175882,1176371,1176961
 
/cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1051699-1053689
 
/cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/Cassandra.java:1102511-1125020
 
/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/Cassandra.java:774578-796573

Propchange: 
cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 28 17:07:07 2011
@@ -1,11 +1,11 @@
 
/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 
/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1026516-1170333,1172024
 
/cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090934-1125013,1125019-1175057,1175880
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1090934-1125013,1125019-1175057,1175880,1176712
 
/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1125021-1130369
 
/cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1101014-1125018
-/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167085-1176433
-/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167104-1167229,1167232-1175725,1175770-1175771,1175882,1176371
+/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167085-1176433,1176963
+/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1167104-1167229,1167232-1175725,1175770-1175771,1175882,1176371,1176961
 
/cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1051699-1053689
 
/cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/Column.java:1102511-1125020
 
/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/column_t.java:774578-792198

Propchange: 
cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 28 17:07:07 2011
@@ -1,11 +1,11 @@
 
/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 
/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1026516-1170333,1172024
 
/cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090934-1125013,1125019-1175057,1175880
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1090934-1125013,1125019-1175057,1175880,1176712
 
/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1125021-1130369
 
/cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1101014-1125018
-/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167085-1176433
-/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167104-1167229,1167232-1175725,1175770-1175771,1175882,1176371
+/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167085-1176433,1176963
+/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1167104-1167229,1167232-1175725,1175770-1175771,1175882,1176371,1176961
 
/cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1051699-1053689
 
/cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/InvalidRequestException.java:1102511-1125020
 
/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/InvalidRequestException.java:774578-796573

Propchange: 
cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 28 17:07:07 2011
@@ -1,11 +1,11 @@
 
/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 
/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1026516-1170333,1172024
 
/cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090934-1125013,1125019-1175057,1175880
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1090934-1125013,1125019-1175057,1175880,1176712
 
/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1125021-1130369
 
/cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1101014-1125018
-/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167085-1176433
-/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167104-1167229,1167232-1175725,1175770-1175771,1175882,1176371
+/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167085-1176433,1176963
+/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1167104-1167229,1167232-1175725,1175770-1175771,1175882,1176371,1176961
 
/cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1051699-1053689
 
/cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/NotFoundException.java:1102511-1125020
 
/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/NotFoundException.java:774578-796573

Propchange: 
cassandra/trunk/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Sep 28 17:07:07 2011
@@ -1,11 +1,11 @@
 
/cassandra/branches/cassandra-0.6/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:922689-1052356,1052358-1053452,1053454,1053456-1131291
 
/cassandra/branches/cassandra-0.7/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1026516-1170333,1172024
 
/cassandra/branches/cassandra-0.7.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1053690-1055654
-/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090934-1125013,1125019-1175057,1175880
+/cassandra/branches/cassandra-0.8/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1090934-1125013,1125019-1175057,1175880,1176712
 
/cassandra/branches/cassandra-0.8.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1125021-1130369
 
/cassandra/branches/cassandra-0.8.1/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1101014-1125018
-/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167085-1176433
-/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167104-1167229,1167232-1175725,1175770-1175771,1175882,1176371
+/cassandra/branches/cassandra-1.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167085-1176433,1176963
+/cassandra/branches/cassandra-1.0.0/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1167104-1167229,1167232-1175725,1175770-1175771,1175882,1176371,1176961
 
/cassandra/tags/cassandra-0.7.0-rc3/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1051699-1053689
 
/cassandra/tags/cassandra-0.8.0-rc1/interface/thrift/gen-java/org/apache/cassandra/thrift/SuperColumn.java:1102511-1125020
 
/incubator/cassandra/branches/cassandra-0.3/interface/gen-java/org/apache/cassandra/service/superColumn_t.java:774578-792198

Modified: 
cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java
URL: 
http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java?rev=1176966&r1=1176965&r2=1176966&view=diff
==============================================================================
--- 
cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java
 (original)
+++ 
cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractEndpointSnitch.java
 Wed Sep 28 17:07:07 2011
@@ -20,17 +20,39 @@
 package org.apache.cassandra.locator;
 
 import java.net.InetAddress;
-import java.util.Collection;
-import java.util.List;
+import java.util.*;
 
 public abstract class AbstractEndpointSnitch implements IEndpointSnitch
 {
-    public abstract List<InetAddress> getSortedListByProximity(InetAddress 
address, Collection<InetAddress> unsortedAddress);
-    public abstract void sortByProximity(InetAddress address, 
List<InetAddress> addresses);
+    public abstract int compareEndpoints(InetAddress target, InetAddress a1, 
InetAddress a2);
 
-    public int compareEndpoints(InetAddress target, InetAddress a1, 
InetAddress a2)
+    /**
+     * Sorts the <tt>Collection</tt> of node addresses by proximity to the 
given address
+     * @param address the address to sort by proximity to
+     * @param unsortedAddress the nodes to sort
+     * @return a new sorted <tt>List</tt>
+     */
+    public List<InetAddress> getSortedListByProximity(InetAddress address, 
Collection<InetAddress> unsortedAddress)
     {
-        return a1.getHostAddress().compareTo(a2.getHostAddress());
+        List<InetAddress> preferred = new 
ArrayList<InetAddress>(unsortedAddress);
+        sortByProximity(address, preferred);
+        return preferred;
+    }
+
+    /**
+     * Sorts the <tt>List</tt> of node addresses, in-place, by proximity to 
the given address
+     * @param address the address to sort the proximity by
+     * @param addresses the nodes to sort
+     */
+    public void sortByProximity(final InetAddress address, List<InetAddress> 
addresses)
+    {
+        Collections.sort(addresses, new Comparator<InetAddress>()
+        {
+            public int compare(InetAddress a1, InetAddress a2)
+            {
+                return compareEndpoints(address, a1, a2);
+            }
+        });
     }
 
     public void gossiperStarting()

Modified: 
cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractNetworkTopologySnitch.java
URL: 
http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractNetworkTopologySnitch.java?rev=1176966&r1=1176965&r2=1176966&view=diff
==============================================================================
--- 
cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractNetworkTopologySnitch.java
 (original)
+++ 
cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractNetworkTopologySnitch.java
 Wed Sep 28 17:07:07 2011
@@ -47,35 +47,6 @@ public abstract class AbstractNetworkTop
      */
     abstract public String getDatacenter(InetAddress endpoint);
 
-    /**
-     * Sorts the <tt>Collection</tt> of node addresses by proximity to the 
given address
-     * @param address the address to sort by proximity to
-     * @param addresses the nodes to sort
-     * @return a new sorted <tt>List</tt>
-     */
-    public List<InetAddress> getSortedListByProximity(final InetAddress 
address, Collection<InetAddress> addresses)
-    {
-        List<InetAddress> preferred = new ArrayList<InetAddress>(addresses);
-        sortByProximity(address, preferred);
-        return preferred;
-    }
-
-    /**
-     * Sorts the <tt>List</tt> of node addresses by proximity to the given 
address
-     * @param address the address to sort the proximity by
-     * @param addresses the nodes to sort
-     */
-    public void sortByProximity(final InetAddress address, List<InetAddress> 
addresses)
-    {
-        Collections.sort(addresses, new Comparator<InetAddress>()
-        {
-            public int compare(InetAddress a1, InetAddress a2)
-            {
-                   return compareEndpoints(address, a1, a2);
-            }
-        });
-    }
-
     public int compareEndpoints(InetAddress address, InetAddress a1, 
InetAddress a2)
     {
         if (address.equals(a1) && !address.equals(a2))

Modified: 
cassandra/trunk/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
URL: 
http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java?rev=1176966&r1=1176965&r2=1176966&view=diff
==============================================================================
--- 
cassandra/trunk/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
 (original)
+++ 
cassandra/trunk/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
 Wed Sep 28 17:07:07 2011
@@ -129,6 +129,7 @@ public class DynamicEndpointSnitch exten
         return list;
     }
 
+    @Override
     public void sortByProximity(final InetAddress address, List<InetAddress> 
addresses)
     {
         assert address.equals(FBUtilities.getBroadcastAddress()); // we only 
know about ourself
@@ -144,13 +145,7 @@ public class DynamicEndpointSnitch exten
 
     private void sortByProximityWithScore(final InetAddress address, 
List<InetAddress> addresses)
     {
-        Collections.sort(addresses, new Comparator<InetAddress>()
-        {
-            public int compare(InetAddress a1, InetAddress a2)
-            {
-                return compareEndpoints(address, a1, a2);
-            }
-        });
+        super.sortByProximity(address, addresses);
     }
 
     private void sortByProximityWithBadness(final InetAddress address, 
List<InetAddress> addresses)

Modified: 
cassandra/trunk/src/java/org/apache/cassandra/locator/SimpleSnitch.java
URL: 
http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/locator/SimpleSnitch.java?rev=1176966&r1=1176965&r2=1176966&view=diff
==============================================================================
--- cassandra/trunk/src/java/org/apache/cassandra/locator/SimpleSnitch.java 
(original)
+++ cassandra/trunk/src/java/org/apache/cassandra/locator/SimpleSnitch.java Wed 
Sep 28 17:07:07 2011
@@ -39,13 +39,17 @@ public class SimpleSnitch extends Abstra
     {
         return "datacenter1";
     }
-    
-    public List<InetAddress> getSortedListByProximity(final InetAddress 
address, Collection<InetAddress> addresses)
+
+    @Override
+    public void sortByProximity(final InetAddress address, List<InetAddress> 
addresses)
     {
-        return new ArrayList<InetAddress>(addresses);
+        // Optimization to avoid walking the list
     }
 
-    public void sortByProximity(final InetAddress address, List<InetAddress> 
addresses)
+    public int compareEndpoints(InetAddress target, InetAddress a1, 
InetAddress a2)
     {
+        // Making all endpoints equal ensures we won't change the original 
ordering (since
+        // Collections.sort is guaranteed to be stable)
+        return 0;
     }
 }


Reply via email to