Package org.apache.cassandra.locator
Class AbstractReplicaCollection.ReplicaMap<K>
java.lang.Object
java.util.AbstractMap<K,Replica>
org.apache.cassandra.locator.AbstractReplicaCollection.ReplicaMap<K>
- Enclosing class:
- AbstractReplicaCollection<C extends AbstractReplicaCollection<C>>
A simple map that ensures the underlying list's iteration order is maintained, and can be shared with
subLists (either produced via subList, or via filter that naturally produced a subList).
This permits us to reduce the amount of garbage generated, by not unnecessarily copying,
reduces the amount of indirection necessary, as well as ensuring monomorphic callsites.
The underlying map is also more efficient, particularly for such small collections as we typically produce.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
ConstructorsConstructorDescriptionReplicaMap(AbstractReplicaCollection.ReplicaList list, Function<Replica, K> toKey) ReplicaMap(AbstractReplicaCollection.ReplicaList list, Function<Replica, K> toKey, com.carrotsearch.hppc.ObjectIntHashMap<K> map) -
Method Summary
Methods inherited from class java.util.AbstractMap
clear, clone, containsValue, equals, hashCode, isEmpty, put, putAll, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
ReplicaMap
-
ReplicaMap
public ReplicaMap(AbstractReplicaCollection.ReplicaList list, Function<Replica, K> toKey, com.carrotsearch.hppc.ObjectIntHashMap<K> map)
-
-
Method Details
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,Replica> - Overrides:
containsKeyin classAbstractMap<K,Replica>
-
get
-
remove
-
keySet
-
entrySet
-
size
public int size()
-