cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stefa...@apache.org
Subject [3/6] cassandra git commit: Fixed ConcurrentModificationException when reading metrics in GraphiteReporter
Date Thu, 04 Aug 2016 00:53:56 GMT
Fixed ConcurrentModificationException when reading metrics in GraphiteReporter

patch by Edward Ribeiro; reviewed by Stefania Alborghetti for CASSANDRA-11823


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

Branch: refs/heads/trunk
Commit: 52be7bac4160c392605f2ec6c2f98d4e49ccf2fe
Parents: 3431934
Author: Edward Ribeiro <edward.ribeiro@gmail.com>
Authored: Wed Aug 3 10:07:13 2016 +0800
Committer: Stefania Alborghetti <stefania.alborghetti@datastax.com>
Committed: Thu Aug 4 08:47:49 2016 +0800

----------------------------------------------------------------------
 CHANGES.txt                                             | 1 +
 src/java/org/apache/cassandra/metrics/TableMetrics.java | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/52be7bac/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index e8b8abb..f0ceb70 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,4 +1,5 @@
 3.0.9
+ * Fixed ConcurrentModificationException when reading metrics in GraphiteReporter (CASSANDRA-11823)
  * Fix upgrade of super columns on thrift (CASSANDRA-12335)
  * Fixed flacky BlacklistingCompactionsTest, switched to fixed size types and increased corruption
size (CASSANDRA-12359)
  * Rerun ReplicationAwareTokenAllocatorTest on failure to avoid flakiness (CASSANDRA-12277)

http://git-wip-us.apache.org/repos/asf/cassandra/blob/52be7bac/src/java/org/apache/cassandra/metrics/TableMetrics.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/metrics/TableMetrics.java b/src/java/org/apache/cassandra/metrics/TableMetrics.java
index 85bf7f6..a21e8ca 100644
--- a/src/java/org/apache/cassandra/metrics/TableMetrics.java
+++ b/src/java/org/apache/cassandra/metrics/TableMetrics.java
@@ -20,6 +20,7 @@ package org.apache.cassandra.metrics;
 import java.nio.ByteBuffer;
 import java.util.*;
 import java.util.concurrent.ConcurrentMap;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.TimeUnit;
 
 import com.codahale.metrics.*;
@@ -788,7 +789,7 @@ public class TableMetrics
      */
     private boolean register(String name, String alias, Metric metric)
     {
-        boolean ret = allTableMetrics.putIfAbsent(name,  new HashSet<>()) == null;
+        boolean ret = allTableMetrics.putIfAbsent(name, ConcurrentHashMap.newKeySet()) ==
null;
         allTableMetrics.get(name).add(metric);
         all.put(name, alias);
         return ret;


Mime
View raw message