V
- the type of valuespublic class PartitionMap<V> extends java.util.AbstractMap<Pair<java.lang.Integer,StructLike>,V>
This implementation internally stores provided partition tuples in StructLikeMap
for
consistent hashing and equals behavior. This ensures that objects of different types that
represent the same structs are treated as equal keys in the map.
Note: This map is not designed for concurrent modification by multiple threads. However, it supports safe concurrent reads, assuming there are no concurrent writes.
Note: This map does not support null pairs but supports null as partition tuples.
Modifier and Type | Method and Description |
---|---|
void |
clear() |
V |
computeIfAbsent(int specId,
StructLike struct,
java.util.function.Supplier<V> valueSupplier) |
boolean |
containsKey(int specId,
StructLike struct) |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
static <T> PartitionMap<T> |
create(java.util.Map<java.lang.Integer,PartitionSpec> specs) |
java.util.Set<java.util.Map.Entry<Pair<java.lang.Integer,StructLike>,V>> |
entrySet() |
V |
get(int specId,
StructLike struct) |
V |
get(java.lang.Object key) |
boolean |
isEmpty() |
java.util.Set<Pair<java.lang.Integer,StructLike>> |
keySet() |
V |
put(int specId,
StructLike struct,
V value) |
V |
put(Pair<java.lang.Integer,StructLike> key,
V value) |
void |
putAll(java.util.Map<? extends Pair<java.lang.Integer,StructLike>,? extends V> otherMap) |
V |
remove(java.lang.Object key) |
V |
removeKey(int specId,
StructLike struct) |
int |
size() |
java.lang.String |
toString() |
java.util.Collection<V> |
values() |
public static <T> PartitionMap<T> create(java.util.Map<java.lang.Integer,PartitionSpec> specs)
public int size()
size
in interface java.util.Map<Pair<java.lang.Integer,StructLike>,V>
size
in class java.util.AbstractMap<Pair<java.lang.Integer,StructLike>,V>
public boolean isEmpty()
isEmpty
in interface java.util.Map<Pair<java.lang.Integer,StructLike>,V>
isEmpty
in class java.util.AbstractMap<Pair<java.lang.Integer,StructLike>,V>
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map<Pair<java.lang.Integer,StructLike>,V>
containsKey
in class java.util.AbstractMap<Pair<java.lang.Integer,StructLike>,V>
public boolean containsKey(int specId, StructLike struct)
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map<Pair<java.lang.Integer,StructLike>,V>
containsValue
in class java.util.AbstractMap<Pair<java.lang.Integer,StructLike>,V>
public V get(java.lang.Object key)
get
in interface java.util.Map<Pair<java.lang.Integer,StructLike>,V>
get
in class java.util.AbstractMap<Pair<java.lang.Integer,StructLike>,V>
public V get(int specId, StructLike struct)
public V put(Pair<java.lang.Integer,StructLike> key, V value)
put
in interface java.util.Map<Pair<java.lang.Integer,StructLike>,V>
put
in class java.util.AbstractMap<Pair<java.lang.Integer,StructLike>,V>
public V put(int specId, StructLike struct, V value)
public void putAll(java.util.Map<? extends Pair<java.lang.Integer,StructLike>,? extends V> otherMap)
putAll
in interface java.util.Map<Pair<java.lang.Integer,StructLike>,V>
putAll
in class java.util.AbstractMap<Pair<java.lang.Integer,StructLike>,V>
public V remove(java.lang.Object key)
remove
in interface java.util.Map<Pair<java.lang.Integer,StructLike>,V>
remove
in class java.util.AbstractMap<Pair<java.lang.Integer,StructLike>,V>
public V removeKey(int specId, StructLike struct)
public void clear()
clear
in interface java.util.Map<Pair<java.lang.Integer,StructLike>,V>
clear
in class java.util.AbstractMap<Pair<java.lang.Integer,StructLike>,V>
public java.util.Set<Pair<java.lang.Integer,StructLike>> keySet()
keySet
in interface java.util.Map<Pair<java.lang.Integer,StructLike>,V>
keySet
in class java.util.AbstractMap<Pair<java.lang.Integer,StructLike>,V>
public java.util.Collection<V> values()
values
in interface java.util.Map<Pair<java.lang.Integer,StructLike>,V>
values
in class java.util.AbstractMap<Pair<java.lang.Integer,StructLike>,V>
public java.util.Set<java.util.Map.Entry<Pair<java.lang.Integer,StructLike>,V>> entrySet()
entrySet
in interface java.util.Map<Pair<java.lang.Integer,StructLike>,V>
entrySet
in class java.util.AbstractMap<Pair<java.lang.Integer,StructLike>,V>
public V computeIfAbsent(int specId, StructLike struct, java.util.function.Supplier<V> valueSupplier)
public java.lang.String toString()
toString
in class java.util.AbstractMap<Pair<java.lang.Integer,StructLike>,V>