Package org.h2.dev.cluster
Class ShardedMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
org.h2.dev.cluster.ShardedMap<K,V>
- Type Parameters:
K- the key typeV- the value type
- All Implemented Interfaces:
Map<K,V>
A sharded map. It is typically split into multiple sub-maps that don't have
overlapping keys.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA map that can efficiently return the index of a key, and the key at a given index.static interfaceA large map.Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, remove, 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
-
ShardedMap
public ShardedMap() -
ShardedMap
-
-
Method Details
-
addMap
Add the given shard.- Parameters:
map- the mapmin- the lowest key, or null if no limitmax- the highest key, or null if no limit
-
size
public int size() -
sizeAsLong
public long sizeAsLong()The size of the map.- Returns:
- the size
-
put
-
get
-
entrySet
-