Package org.apache.iceberg.util
Class PartitionMap<V>
- Type Parameters:
V- the type of values
- All Implemented Interfaces:
Map<Pair<Integer,StructLike>, V>
A map that uses a pair of spec ID and partition tuple as keys.
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.
-
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> -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()computeIfAbsent(int specId, StructLike struct, Supplier<V> valueSupplier) booleancontainsKey(int specId, StructLike struct) booleancontainsKey(Object key) booleancontainsValue(Object value) static <T> PartitionMap<T>create(Map<Integer, PartitionSpec> specs) entrySet()get(int specId, StructLike struct) booleanisEmpty()keySet()put(int specId, StructLike struct, V value) put(Pair<Integer, StructLike> key, V value) voidremoveKey(int specId, StructLike struct) intsize()toString()values()Methods inherited from class java.util.AbstractMap
clone, equals, hashCodeMethods 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
-
Method Details
-
create
-
size
public int size()- Specified by:
sizein interfaceMap<Pair<Integer,StructLike>, V> - Overrides:
sizein classAbstractMap<Pair<Integer,StructLike>, V>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceMap<Pair<Integer,StructLike>, V> - Overrides:
isEmptyin classAbstractMap<Pair<Integer,StructLike>, V>
-
containsKey
- Specified by:
containsKeyin interfaceMap<Pair<Integer,StructLike>, V> - Overrides:
containsKeyin classAbstractMap<Pair<Integer,StructLike>, V>
-
containsKey
-
containsValue
- Specified by:
containsValuein interfaceMap<Pair<Integer,StructLike>, V> - Overrides:
containsValuein classAbstractMap<Pair<Integer,StructLike>, V>
-
get
- Specified by:
getin interfaceMap<Pair<Integer,StructLike>, V> - Overrides:
getin classAbstractMap<Pair<Integer,StructLike>, V>
-
get
-
put
- Specified by:
putin interfaceMap<Pair<Integer,StructLike>, V> - Overrides:
putin classAbstractMap<Pair<Integer,StructLike>, V>
-
put
-
putAll
- Specified by:
putAllin interfaceMap<Pair<Integer,StructLike>, V> - Overrides:
putAllin classAbstractMap<Pair<Integer,StructLike>, V>
-
remove
- Specified by:
removein interfaceMap<Pair<Integer,StructLike>, V> - Overrides:
removein classAbstractMap<Pair<Integer,StructLike>, V>
-
removeKey
-
clear
public void clear()- Specified by:
clearin interfaceMap<Pair<Integer,StructLike>, V> - Overrides:
clearin classAbstractMap<Pair<Integer,StructLike>, V>
-
keySet
- Specified by:
keySetin interfaceMap<Pair<Integer,StructLike>, V> - Overrides:
keySetin classAbstractMap<Pair<Integer,StructLike>, V>
-
values
- Specified by:
valuesin interfaceMap<Pair<Integer,StructLike>, V> - Overrides:
valuesin classAbstractMap<Pair<Integer,StructLike>, V>
-
entrySet
- Specified by:
entrySetin interfaceMap<Pair<Integer,StructLike>, V> - Specified by:
entrySetin classAbstractMap<Pair<Integer,StructLike>, V>
-
computeIfAbsent
-
toString
- Overrides:
toStringin classAbstractMap<Pair<Integer,StructLike>, V>
-