Merge branch 'cassandra-2.1' into trunk

Conflicts:
        build.xml
        src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java


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

Branch: refs/heads/trunk
Commit: 223d0e755ee0480316f90621ac6389e942c23d97
Parents: ca41972 1512264
Author: Tyler Hobbs <[email protected]>
Authored: Fri Feb 6 16:47:00 2015 -0600
Committer: Tyler Hobbs <[email protected]>
Committed: Fri Feb 6 16:47:00 2015 -0600

----------------------------------------------------------------------
 CHANGES.txt                                                    | 1 +
 NEWS.txt                                                       | 2 ++
 doc/cql3/CQL.textile                                           | 2 +-
 src/java/org/apache/cassandra/config/DatabaseDescriptor.java   | 3 ++-
 .../org/apache/cassandra/locator/DynamicEndpointSnitch.java    | 6 ++++--
 5 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/223d0e75/CHANGES.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/223d0e75/NEWS.txt
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/223d0e75/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cassandra/blob/223d0e75/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
----------------------------------------------------------------------
diff --cc src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
index 9d71a67,aefce0d..b670b6a
--- a/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
+++ b/src/java/org/apache/cassandra/locator/DynamicEndpointSnitch.java
@@@ -55,8 -54,8 +55,8 @@@ public class DynamicEndpointSnitch exte
      private String mbeanName;
      private boolean registered = false;
  
-     private final ConcurrentHashMap<InetAddress, Double> scores = new 
ConcurrentHashMap<InetAddress, Double>();
 -    private volatile HashMap<InetAddress, Double> scores = new 
HashMap<InetAddress, Double>();
 -    private final ConcurrentHashMap<InetAddress, ExponentiallyDecayingSample> 
samples = new ConcurrentHashMap<InetAddress, ExponentiallyDecayingSample>();
++    private volatile HashMap<InetAddress, Double> scores = new HashMap<>();
 +    private final ConcurrentHashMap<InetAddress, 
ExponentiallyDecayingReservoir> samples = new ConcurrentHashMap<>();
  
      public final IEndpointSnitch subsnitch;
  
@@@ -245,7 -244,8 +245,8 @@@
          double maxLatency = 1;
          // We're going to weight the latency for each host against the worst 
one we see, to
          // arrive at sort of a 'badness percentage' for them. First, find the 
worst for each:
+         HashMap<InetAddress, Double> newScores = new HashMap<>();
 -        for (Map.Entry<InetAddress, ExponentiallyDecayingSample> entry : 
samples.entrySet())
 +        for (Map.Entry<InetAddress, ExponentiallyDecayingReservoir> entry : 
samples.entrySet())
          {
              double mean = entry.getValue().getSnapshot().getMedian();
              if (mean > maxLatency)

Reply via email to