Class DictionaryBuildingUtils
java.lang.Object
org.apache.druid.query.groupby.epinephelinae.DictionaryBuildingUtils
Utilities for parts of the groupBy engine that need to build dictionaries.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>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.
-
Constructor Details
-
DictionaryBuildingUtils
public DictionaryBuildingUtils()
-
-
Method Details
-
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.
-