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 TypeMethodDescriptionvoid
clear()
computeIfAbsent
(int specId, StructLike struct, Supplier<V> valueSupplier) boolean
containsKey
(int specId, StructLike struct) boolean
containsKey
(Object key) boolean
containsValue
(Object value) static <T> PartitionMap<T>
create
(Map<Integer, PartitionSpec> specs) entrySet()
get
(int specId, StructLike struct) boolean
isEmpty()
keySet()
put
(int specId, StructLike struct, V value) put
(Pair<Integer, StructLike> key, V value) void
removeKey
(int specId, StructLike struct) int
size()
toString()
values()
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:
size
in interfaceMap<Pair<Integer,
StructLike>, V> - Overrides:
size
in classAbstractMap<Pair<Integer,
StructLike>, V>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceMap<Pair<Integer,
StructLike>, V> - Overrides:
isEmpty
in classAbstractMap<Pair<Integer,
StructLike>, V>
-
containsKey
- Specified by:
containsKey
in interfaceMap<Pair<Integer,
StructLike>, V> - Overrides:
containsKey
in classAbstractMap<Pair<Integer,
StructLike>, V>
-
containsKey
-
containsValue
- Specified by:
containsValue
in interfaceMap<Pair<Integer,
StructLike>, V> - Overrides:
containsValue
in classAbstractMap<Pair<Integer,
StructLike>, V>
-
get
- Specified by:
get
in interfaceMap<Pair<Integer,
StructLike>, V> - Overrides:
get
in classAbstractMap<Pair<Integer,
StructLike>, V>
-
get
-
put
- Specified by:
put
in interfaceMap<Pair<Integer,
StructLike>, V> - Overrides:
put
in classAbstractMap<Pair<Integer,
StructLike>, V>
-
put
-
putAll
- Specified by:
putAll
in interfaceMap<Pair<Integer,
StructLike>, V> - Overrides:
putAll
in classAbstractMap<Pair<Integer,
StructLike>, V>
-
remove
- Specified by:
remove
in interfaceMap<Pair<Integer,
StructLike>, V> - Overrides:
remove
in classAbstractMap<Pair<Integer,
StructLike>, V>
-
removeKey
-
clear
public void clear()- Specified by:
clear
in interfaceMap<Pair<Integer,
StructLike>, V> - Overrides:
clear
in classAbstractMap<Pair<Integer,
StructLike>, V>
-
keySet
- Specified by:
keySet
in interfaceMap<Pair<Integer,
StructLike>, V> - Overrides:
keySet
in classAbstractMap<Pair<Integer,
StructLike>, V>
-
values
- Specified by:
values
in interfaceMap<Pair<Integer,
StructLike>, V> - Overrides:
values
in classAbstractMap<Pair<Integer,
StructLike>, V>
-
entrySet
- Specified by:
entrySet
in interfaceMap<Pair<Integer,
StructLike>, V> - Specified by:
entrySet
in classAbstractMap<Pair<Integer,
StructLike>, V>
-
computeIfAbsent
-
toString
- Overrides:
toString
in classAbstractMap<Pair<Integer,
StructLike>, V>
-