Switch from NBHM to CHM in MessagingService's callback map patch by Daniel Norberg; reviewed by jbellis for CASSANDRA-4708
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/103d9fba Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/103d9fba Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/103d9fba Branch: refs/heads/trunk Commit: 103d9fba48cf2c486b6bcde11877c1ffb1158aba Parents: 08c6546 Author: Jonathan Ellis <jbel...@apache.org> Authored: Mon Sep 24 10:08:48 2012 -0500 Committer: Jonathan Ellis <jbel...@apache.org> Committed: Mon Sep 24 10:42:14 2012 -0500 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../org/apache/cassandra/utils/ExpiringMap.java | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/103d9fba/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 8a0ce59..b7430d9 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 1.0.12 + * Switch from NBHM to CHM in MessagingService's callback map, which * increase Xss to 160k to accomodate latest 1.6 JVMs (CASSANDRA-4602) * fix toString of hint destination tokens (CASSANDRA-4568) * (Hadoop) fix setting key length for old-style mapred api (CASSANDRA-4534) http://git-wip-us.apache.org/repos/asf/cassandra/blob/103d9fba/src/java/org/apache/cassandra/utils/ExpiringMap.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/utils/ExpiringMap.java b/src/java/org/apache/cassandra/utils/ExpiringMap.java index 000af72..a09093f 100644 --- a/src/java/org/apache/cassandra/utils/ExpiringMap.java +++ b/src/java/org/apache/cassandra/utils/ExpiringMap.java @@ -18,15 +18,17 @@ package org.apache.cassandra.utils; -import java.util.*; +import java.util.Map; +import java.util.Set; +import java.util.Timer; +import java.util.TimerTask; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; import com.google.common.base.Function; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.cliffc.high_scale_lib.NonBlockingHashMap; - public class ExpiringMap<K, V> { private static final Logger logger = LoggerFactory.getLogger(ExpiringMap.class); @@ -57,7 +59,7 @@ public class ExpiringMap<K, V> } } - private final NonBlockingHashMap<K, CacheableObject<V>> cache = new NonBlockingHashMap<K, CacheableObject<V>>(); + private final ConcurrentMap<K, CacheableObject<V>> cache = new ConcurrentHashMap<K, CacheableObject<V>>(); private final Timer timer; private static int counter = 0; private final long defaultExpiration;