cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [2/9] cassandra git commit: use zero as default score in DynamicEndpointSnitch
Date Fri, 23 Mar 2018 14:50:15 GMT
use zero as default score in DynamicEndpointSnitch


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/15bd10af
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/15bd10af
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/15bd10af

Branch: refs/heads/trunk
Commit: 15bd10afbfc5eda024e7048438b00bfc81a9e3ea
Parents: cccaf7c
Author: Dikang Gu <dikang85@gmail.com>
Authored: Wed Feb 21 15:48:11 2018 -0800
Committer: Dikang Gu <dikang85@gmail.com>
Committed: Tue Mar 20 15:09:32 2018 -0700

----------------------------------------------------------------------
 CHANGES.txt                                                        | 1 +
 src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java   | 2 +-
 .../org/apache/cassandra/locator/DynamicEndpointSnitchTest.java    | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/15bd10af/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 6099b01..b967580 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.17
+ * Use zero as default score in DynamicEndpointSnitch (CASSANDRA-14252)
  * Respect max hint window when hinting for LWT (CASSANDRA-14215)
  * Adding missing WriteType enum values to v3, v4, and v5 spec (CASSANDRA-13697)
  * Don't regenerate bloomfilter and summaries on startup (CASSANDRA-11163)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/15bd10af/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java b/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
index 8c255f5..5356e8c 100644
--- a/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
+++ b/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
@@ -186,7 +186,7 @@ public class DynamicEndpointSnitch extends AbstractEndpointSnitch implements
ILa
         {
             Double score = scores.get(inet);
             if (score == null)
-                continue;
+                score = 0.0;
             subsnitchOrderedScores.add(score);
         }
 

http://git-wip-us.apache.org/repos/asf/cassandra/blob/15bd10af/test/unit/org/apache/cassandra/locator/DynamicEndpointSnitchTest.java
----------------------------------------------------------------------
diff --git a/test/unit/org/apache/cassandra/locator/DynamicEndpointSnitchTest.java b/test/unit/org/apache/cassandra/locator/DynamicEndpointSnitchTest.java
index af7dc17..866cd82 100644
--- a/test/unit/org/apache/cassandra/locator/DynamicEndpointSnitchTest.java
+++ b/test/unit/org/apache/cassandra/locator/DynamicEndpointSnitchTest.java
@@ -92,7 +92,7 @@ public class DynamicEndpointSnitchTest
         assertEquals(order, dsnitch.getSortedListByProximity(self, Arrays.asList(host1, host2,
host3, host4)));
 
         setScores(dsnitch, 20, hosts, 10, 10, 10);
-        order = Arrays.asList(host1, host2, host3, host4);
+        order = Arrays.asList(host4, host1, host2, host3);
         assertEquals(order, dsnitch.getSortedListByProximity(self, Arrays.asList(host1, host2,
host3, host4)));
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message