cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alek...@apache.org
Subject [05/15] cassandra git commit: Add option to disable use of severity in DynamicEndpointSnitch
Date Tue, 10 May 2016 15:02:11 GMT
Add option to disable use of severity in DynamicEndpointSnitch

patch by Jeremiah Jordan; reviewed by Aleksey Yeschenko for
CASSANDRA-11737


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

Branch: refs/heads/cassandra-3.7
Commit: 11d4e73e215cfe8baa16d9d6e0a589d6a94de56b
Parents: aacd452
Author: Jeremiah D Jordan <jeremiah@datastax.com>
Authored: Fri May 6 09:45:10 2016 -0500
Committer: Aleksey Yeschenko <aleksey@apache.org>
Committed: Tue May 10 15:59:02 2016 +0100

----------------------------------------------------------------------
 CHANGES.txt                                                     | 1 +
 .../org/apache/cassandra/locator/DynamicEndpointSnitch.java     | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/11d4e73e/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 5885a9a..edf5aa3 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 2.1.15
+ * Add option to disable use of severity in DynamicEndpointSnitch (CASSANDRA-11737)
  * cqlsh COPY FROM fails for null values with non-prepared statements (CASSANDRA-11631)
  * Make cython optional in pylib/setup.py (CASSANDRA-11630)
  * Change order of directory searching for cassandra.in.sh to favor local one (CASSANDRA-11628)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/11d4e73e/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 6b6286f..c84ca27 100644
--- a/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
+++ b/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
@@ -40,6 +40,8 @@ import com.yammer.metrics.stats.ExponentiallyDecayingSample;
  */
 public class DynamicEndpointSnitch extends AbstractEndpointSnitch implements ILatencySubscriber,
DynamicEndpointSnitchMBean
 {
+    private static final boolean USE_SEVERITY = !Boolean.getBoolean("cassandra.ignore_dynamic_snitch_severity");
+
     private static final double ALPHA = 0.75; // set to 0.75 to make EDS more biased to towards
the newer values
     private static final int WINDOW_SIZE = 100;
 
@@ -279,7 +281,8 @@ public class DynamicEndpointSnitch extends AbstractEndpointSnitch implements
ILa
             double score = entry.getValue().getSnapshot().getMedian() / maxLatency;
             // finally, add the severity without any weighting, since hosts scale this relative
to their own load and the size of the task causing the severity.
             // "Severity" is basically a measure of compaction activity (CASSANDRA-3722).
-            score += StorageService.instance.getSeverity(entry.getKey());
+            if (USE_SEVERITY)
+                score += StorageService.instance.getSeverity(entry.getKey());
             // lowest score (least amount of badness) wins.
             newScores.put(entry.getKey(), score);
         }


Mime
View raw message