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
public class ImmutableLookupMap.ImmutableLookupExtractor extends LookupExtractor
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringapply(String key)Apply a particular lookup methodology to the input stringMap<String,String>asMap()Returns a Map view of this lookup extractor.longestimateHeapFootprint()Estimated heap footprint of this object.byte[]getCacheKey()Create a cache key for use in results cachingbooleanisOneToOne()booleansupportsAsMap()Returns whether this lookup extractor'sLookupExtractor.asMap()will return a valid map.protected List<String>unapply(String value)Reverse lookup from a given value.-
Methods inherited from class org.apache.druid.query.lookup.LookupExtractor
applyAll, unapplyAll
-
-
-
-
Method Detail
-
apply
@Nullable public String apply(@Nullable String key)
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
protected List<String> unapply(@Nullable String value)
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
public Map<String,String> 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
-
-