Package org.apache.cassandra.utils
Class ConcurrentBiMap<K,V>
java.lang.Object
org.apache.cassandra.utils.ConcurrentBiMap<K,V>
- Type Parameters:
K-V-
- All Implemented Interfaces:
Map<K,V>
A variant of BiMap that permits concurrent access, and expects uniqueness of values in both domain and range.
We synchronize on _modifications only_, and use ConcurrentHashMap so that readers can lookup safely. This does mean there
could be races to lookup the inverse, but we aren't too worried about that.
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
forwardMap
-
reverseMap
-
-
Constructor Details
-
ConcurrentBiMap
public ConcurrentBiMap() -
ConcurrentBiMap
-
-
Method Details
-
inverse
-
clear
public void clear() -
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
entrySet
-
get
-
isEmpty
public boolean isEmpty() -
keySet
-
put
-
putAll
-
remove
-
size
public int size() -
values
-