Class DefaultLookupCache

java.lang.Object
org.apache.flink.table.connector.source.lookup.cache.DefaultLookupCache
All Implemented Interfaces:
Serializable, AutoCloseable, LookupCache

@PublicEvolving public class DefaultLookupCache extends Object implements LookupCache
Default implementation of LookupCache.
See Also:
  • Method Details

    • newBuilder

      public static DefaultLookupCache.Builder newBuilder()
      Creates a builder for the cache.
    • fromConfig

      public static DefaultLookupCache fromConfig(org.apache.flink.configuration.ReadableConfig config)
    • open

      public void open(org.apache.flink.metrics.groups.CacheMetricGroup metricGroup)
      Description copied from interface: LookupCache
      Initialize the cache.
      Specified by:
      open in interface LookupCache
      Parameters:
      metricGroup - the metric group to register cache related metrics.
    • getIfPresent

      @Nullable public Collection<RowData> getIfPresent(RowData key)
      Description copied from interface: LookupCache
      Returns the value associated with key in this cache, or null if there is no cached value for key.
      Specified by:
      getIfPresent in interface LookupCache
    • put

      public Collection<RowData> put(RowData key, Collection<RowData> value)
      Description copied from interface: LookupCache
      Associates the specified value rows with the specified key row in the cache. If the cache previously contained value associated with the key, the old value is replaced by the specified value.
      Specified by:
      put in interface LookupCache
      Parameters:
      key - - key row with which the specified value is to be associated
      value - – value rows to be associated with the specified key
      Returns:
      the previous value rows associated with key, or null if there was no mapping for key.
    • invalidate

      public void invalidate(RowData key)
      Description copied from interface: LookupCache
      Discards any cached value for the specified key.
      Specified by:
      invalidate in interface LookupCache
    • size

      public long size()
      Description copied from interface: LookupCache
      Returns the number of key-value mappings in the cache.
      Specified by:
      size in interface LookupCache
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object