You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by br...@apache.org on 2012/05/04 20:06:58 UTC
git commit: Use double math in DES calculations. Patch by Dave
Brosius, reviewed by brandonwilliams for CASSANDRA-4213
Updated Branches:
refs/heads/trunk c5f2b57ad -> e24681e70
Use double math in DES calculations.
Patch by Dave Brosius, reviewed by brandonwilliams for CASSANDRA-4213
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/e24681e7
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/e24681e7
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/e24681e7
Branch: refs/heads/trunk
Commit: e24681e70ca130643908508eac9550ed26f78a4e
Parents: c5f2b57
Author: Brandon Williams <br...@apache.org>
Authored: Fri May 4 13:05:34 2012 -0500
Committer: Brandon Williams <br...@apache.org>
Committed: Fri May 4 13:05:34 2012 -0500
----------------------------------------------------------------------
.../cassandra/locator/DynamicEndpointSnitch.java | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cassandra/blob/e24681e7/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 b024916..9d4f08d 100644
--- a/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
+++ b/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
@@ -249,7 +249,7 @@ public class DynamicEndpointSnitch extends AbstractEndpointSnitch implements ILa
{
double score = entry.getValue().mean() / maxLatency;
if (penalties.containsKey(entry.getKey()))
- score += penalties.get(entry.getKey()) / maxPenalty;
+ score += penalties.get(entry.getKey()) / ((double) maxPenalty);
else
score += 1; // maxPenalty / maxPenalty
score += StorageService.instance.getSeverity(entry.getKey());