aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/concurrent/FastHotKeyAtomicLongMap.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/concurrent/FastHotKeyAtomicLongMap.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/concurrent/FastHotKeyAtomicLongMap.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/concurrent/FastHotKeyAtomicLongMap.java b/src/main/java/com/google/devtools/build/lib/concurrent/FastHotKeyAtomicLongMap.java
index 4136331134..3b64d38216 100644
--- a/src/main/java/com/google/devtools/build/lib/concurrent/FastHotKeyAtomicLongMap.java
+++ b/src/main/java/com/google/devtools/build/lib/concurrent/FastHotKeyAtomicLongMap.java
@@ -14,9 +14,9 @@
package com.google.devtools.build.lib.concurrent;
import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.MapMaker;
import com.google.common.collect.Maps;
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicLong;
@@ -35,15 +35,16 @@ public class FastHotKeyAtomicLongMap<T> {
private final ConcurrentMap<T, AtomicLong> map;
public static <T> FastHotKeyAtomicLongMap<T> create() {
- return new FastHotKeyAtomicLongMap<>(new MapMaker());
+ return new FastHotKeyAtomicLongMap<>();
}
- public static <T> FastHotKeyAtomicLongMap<T> create(int concurrencyLevel) {
- return new FastHotKeyAtomicLongMap<>(new MapMaker().concurrencyLevel(concurrencyLevel));
+ // TODO(kak): Delete this in favor of create()
+ public static <T> FastHotKeyAtomicLongMap<T> create(int concurrencyLevel /* ignored */) {
+ return new FastHotKeyAtomicLongMap<>();
}
- private FastHotKeyAtomicLongMap(MapMaker mapMaker) {
- this.map = mapMaker.makeMap();
+ private FastHotKeyAtomicLongMap() {
+ this.map = new ConcurrentHashMap<>();
}
public long incrementAndGet(T key) {