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 Details

    • DictionaryBuildingUtils

      public DictionaryBuildingUtils()
  • Method Details

    • 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 given Hash.Strategy for 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 return DimensionDictionary.ABSENT_VALUE_ID. The object's NullableTypeStrategy is often enough to create a reverse dictionary for those objects
    • estimateEntryFootprint

      public static int estimateEntryFootprint(int valueFootprint)
      Estimated footprint of a new entry.