Package org.apache.cassandra.locator
Class AbstractReplicaCollection.ReplicaMap<K>
- java.lang.Object
-
- java.util.AbstractMap<K,Replica>
-
- org.apache.cassandra.locator.AbstractReplicaCollection.ReplicaMap<K>
-
- All Implemented Interfaces:
java.util.Map<K,Replica>
- Enclosing class:
- AbstractReplicaCollection<C extends AbstractReplicaCollection<C>>
protected static class AbstractReplicaCollection.ReplicaMap<K> extends java.util.AbstractMap<K,Replica>
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.
-
-
Constructor Summary
Constructors Constructor Description ReplicaMap(AbstractReplicaCollection.ReplicaList list, java.util.function.Function<Replica,K> toKey)
ReplicaMap(AbstractReplicaCollection.ReplicaList list, java.util.function.Function<Replica,K> toKey, com.carrotsearch.hppc.ObjectIntHashMap<K> map)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(java.lang.Object key)
java.util.Set<java.util.Map.Entry<K,Replica>>
entrySet()
Replica
get(java.lang.Object key)
java.util.Set<K>
keySet()
Replica
remove(java.lang.Object key)
int
size()
-
Methods inherited from class java.util.AbstractMap
clear, clone, containsValue, equals, hashCode, isEmpty, put, putAll, toString, values
-
-
-
-
Constructor Detail
-
ReplicaMap
public ReplicaMap(AbstractReplicaCollection.ReplicaList list, java.util.function.Function<Replica,K> toKey)
-
ReplicaMap
public ReplicaMap(AbstractReplicaCollection.ReplicaList list, java.util.function.Function<Replica,K> toKey, com.carrotsearch.hppc.ObjectIntHashMap<K> map)
-
-