cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject [3/6] git commit: fix ConcurrentModificationException in getBootstrapSource
Date Fri, 18 Jan 2013 20:58:29 GMT
fix ConcurrentModificationException in getBootstrapSource


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

Branch: refs/heads/trunk
Commit: a7da0295d575124032c2f2a0a96ce45ebe2d5df6
Parents: be01197
Author: Jonathan Ellis <jbellis@apache.org>
Authored: Fri Jan 18 12:56:24 2013 -0800
Committer: Jonathan Ellis <jbellis@apache.org>
Committed: Fri Jan 18 12:56:49 2013 -0800

----------------------------------------------------------------------
 CHANGES.txt                                        |    2 ++
 .../apache/cassandra/service/LoadBroadcaster.java  |    6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/a7da0295/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 2a19ed5..9cdb02a 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,7 @@
 1.1.10
  * fix saved key cache not loading at startup (CASSANDRA-5166)
+ * fix ConcurrentModificationException in getBootstrapSource (CASSANDRA-5170)
+
 
 1.1.9
  * Simplify CompressedRandomAccessReader to work around JDK FD bug (CASSANDRA-5088)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/a7da0295/src/java/org/apache/cassandra/service/LoadBroadcaster.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/service/LoadBroadcaster.java b/src/java/org/apache/cassandra/service/LoadBroadcaster.java
index b3232fe..40e25ce 100644
--- a/src/java/org/apache/cassandra/service/LoadBroadcaster.java
+++ b/src/java/org/apache/cassandra/service/LoadBroadcaster.java
@@ -20,6 +20,8 @@ package org.apache.cassandra.service;
 
 import java.net.InetAddress;
 import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
 import java.util.concurrent.TimeUnit;
 
 import org.slf4j.Logger;
@@ -35,7 +37,7 @@ public class LoadBroadcaster implements IEndpointStateChangeSubscriber
 
     private static final Logger logger_ = LoggerFactory.getLogger(LoadBroadcaster.class);
 
-    private Map<InetAddress, Double> loadInfo_ = new HashMap<InetAddress, Double>();
+    private ConcurrentMap<InetAddress, Double> loadInfo_ = new ConcurrentHashMap<InetAddress,
java.lang.Double>();
 
     private LoadBroadcaster()
     {
@@ -71,7 +73,7 @@ public class LoadBroadcaster implements IEndpointStateChangeSubscriber
 
     public Map<InetAddress, Double> getLoadInfo()
     {
-        return loadInfo_;
+        return Collections.unmodifiableMap(loadInfo_);
     }
 
     public void startBroadcasting()


Mime
View raw message