Package org.apache.druid.query.lookup
Class ImmutableLookupMap.ImmutableLookupExtractor
java.lang.Object
org.apache.druid.query.lookup.LookupExtractor
org.apache.druid.query.lookup.ImmutableLookupMap.ImmutableLookupExtractor
- Enclosing class:
ImmutableLookupMap
-
Method Summary
Modifier and TypeMethodDescriptionApply a particular lookup methodology to the input stringasMap()Returns a Map view of this lookup extractor.longEstimated heap footprint of this object.byte[]Create a cache key for use in results cachingbooleanbooleanReturns whether this lookup extractor'sLookupExtractor.asMap()will return a valid map.Reverse lookup from a given value.Methods inherited from class org.apache.druid.query.lookup.LookupExtractor
applyAll, unapplyAll
-
Method Details
-
apply
Description copied from class:LookupExtractorApply a particular lookup methodology to the input string- Specified by:
applyin classLookupExtractor- 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
Description copied from class:LookupExtractorReverse lookup from a given value. Used by the default implementation ofLookupExtractor.unapplyAll(Set). Otherwise unused. Implementations that overrideLookupExtractor.unapplyAll(Set)may throwUnsupportedOperationExceptionfrom this method.- Specified by:
unapplyin classLookupExtractor- 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:LookupExtractorReturns whether this lookup extractor'sLookupExtractor.asMap()will return a valid map.- Specified by:
supportsAsMapin classLookupExtractor
-
asMap
Description copied from class:LookupExtractorReturns a Map view of this lookup extractor. The map may change along with the underlying lookup data.- Specified by:
asMapin classLookupExtractor
-
isOneToOne
public boolean isOneToOne()- Overrides:
isOneToOnein classLookupExtractor
-
estimateHeapFootprint
public long estimateHeapFootprint()Description copied from class:LookupExtractorEstimated 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,MapLookupExtractorandImmutableLookupMap, do have reasonable implementations. This API is provided for best-effort memory management and monitoring.- Overrides:
estimateHeapFootprintin classLookupExtractor
-
getCacheKey
public byte[] getCacheKey()Description copied from class:LookupExtractorCreate a cache key for use in results caching- Specified by:
getCacheKeyin classLookupExtractor- Returns:
- A byte array that can be used to uniquely identify if results of a prior lookup can use the cached values
-