Class MapLookupExtractor

    • Constructor Detail

      • MapLookupExtractor

        public MapLookupExtractor​(Map<String,​String> map,
                                  boolean isOneToOne)
    • Method Detail

      • estimateHeapFootprint

        public static <K,​V> long estimateHeapFootprint​(Iterable<Map.Entry<K,​V>> entries)
        Estimate the heap footprint of a Map. Important note: the implementation accepts any kind of map entries, but estimates zero footprint for keys and values of types other than String.
      • 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.
      • unapplyAll

        @Nullable
        public Iterator<String> unapplyAll​(Set<String> values)
        Description copied from class: LookupExtractor
        Reverse lookup from a given set of values.
        Overrides:
        unapplyAll in class LookupExtractor
        Parameters:
        values - set of values to reverse lookup.
        Returns:
        iterator of keys that map to to the provided set of values. May contain duplicate keys. Returns null if this lookup instance does not support reverse lookups. In SQL-compatible null handling mode, null keys are omitted.
      • 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
      • 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object