Class DictionaryBuildingUtils
- java.lang.Object
-
- org.apache.druid.query.groupby.epinephelinae.DictionaryBuildingUtils
-
public class DictionaryBuildingUtils extends Object
Utilities for parts of the groupBy engine that need to build dictionaries.
-
-
Constructor Summary
Constructors Constructor Description DictionaryBuildingUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> List<T>createDictionary()Creates a forward dictionary (dictionary ID -> value).static <T> it.unimi.dsi.fastutil.objects.Object2IntMap<T>createReverseDictionary(it.unimi.dsi.fastutil.Hash.Strategy<T> hashStrategy)Create reverse dictionary (value -> dictionary ID) that relies on the givenHash.Strategyfor hashing and comparing equality.static intestimateEntryFootprint(int valueFootprint)Estimated footprint of a new entry.
-
-
-
Method Detail
-
createDictionary
public static <T> List<T> createDictionary()
Creates a forward dictionary (dictionary ID -> value).
-
createReverseDictionary
public static <T> it.unimi.dsi.fastutil.objects.Object2IntMap<T> createReverseDictionary(it.unimi.dsi.fastutil.Hash.Strategy<T> hashStrategy)
Create reverse dictionary (value -> dictionary ID) that relies on the givenHash.Strategyfor hashing and comparing equality. It explicitly requires a hashing strategy, so that callers are aware of the correct implementation of the .hashCode and the .equals method used to store and address the objects If a value is not present in the reverse dictionary,Object2IntFunction.getInt(java.lang.Object)will returnDimensionDictionary.ABSENT_VALUE_ID. The object'sNullableTypeStrategyis often enough to create a reverse dictionary for those objects
-
estimateEntryFootprint
public static int estimateEntryFootprint(int valueFootprint)
Estimated footprint of a new entry.
-
-