Class ImmutableLookupMap.ImmutableLookupExtractor

java.lang.Object
org.apache.druid.query.lookup.LookupExtractor
org.apache.druid.query.lookup.ImmutableLookupMap.ImmutableLookupExtractor
Enclosing class:
ImmutableLookupMap

public class ImmutableLookupMap.ImmutableLookupExtractor extends LookupExtractor
  • Method Details

    • apply

      @Nullable public String apply(@Nullable String key)
      Description copied from class: LookupExtractor
      Apply a particular lookup methodology to the input string
      Specified by:
      apply in class LookupExtractor
      Parameters:
      key - The value to apply the lookup to.
      Returns:
      The value for this key, or null when key is `null` or when key cannot have the lookup applied to it and should be treated as missing.
    • unapply

      protected List<String> unapply(@Nullable String value)
      Description copied from class: LookupExtractor
      Reverse lookup from a given value. Used by the default implementation of LookupExtractor.unapplyAll(Set). Otherwise unused. Implementations that override LookupExtractor.unapplyAll(Set) may throw UnsupportedOperationException from this method.
      Specified by:
      unapply in class LookupExtractor
      Parameters:
      value - the value to apply the reverse lookup.
      Returns:
      the list of keys that maps to the provided value. In SQL-compatible null handling mode, null keys are omitted.
    • supportsAsMap

      public boolean supportsAsMap()
      Description copied from class: LookupExtractor
      Returns whether this lookup extractor's LookupExtractor.asMap() will return a valid map.
      Specified by:
      supportsAsMap in class LookupExtractor
    • asMap

      public Map<String,String> asMap()
      Description copied from class: LookupExtractor
      Returns a Map view of this lookup extractor. The map may change along with the underlying lookup data.
      Specified by:
      asMap in class LookupExtractor
    • isOneToOne

      public boolean isOneToOne()
      Overrides:
      isOneToOne in class LookupExtractor
    • estimateHeapFootprint

      public long estimateHeapFootprint()
      Description copied from class: LookupExtractor
      Estimated heap footprint of this object. Not guaranteed to be accurate. For example, some implementations return zero even though they do use on-heap structures. However, the most common classes, MapLookupExtractor and ImmutableLookupMap, do have reasonable implementations. This API is provided for best-effort memory management and monitoring.
      Overrides:
      estimateHeapFootprint in class LookupExtractor
    • getCacheKey

      public byte[] getCacheKey()
      Description copied from class: LookupExtractor
      Create a cache key for use in results caching
      Specified by:
      getCacheKey in class LookupExtractor
      Returns:
      A byte array that can be used to uniquely identify if results of a prior lookup can use the cached values