Add option to disable use of severity in DynamicEndpointSnitch

patch by Jeremiah Jordan; reviewed by Aleksey Yeschenko for
CASSANDRA-11737
This commit is contained in:
Jeremiah D Jordan 2016-05-06 09:45:10 -05:00 committed by Aleksey Yeschenko
parent aacd452630
commit 11d4e73e21
2 changed files with 5 additions and 1 deletions

View File

@ -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)

View File

@ -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);
}