Class DefaultLookupCache
java.lang.Object
org.apache.flink.table.connector.source.lookup.cache.DefaultLookupCache
- All Implemented Interfaces:
Serializable,AutoCloseable,LookupCache
Default implementation of
LookupCache.- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanstatic DefaultLookupCachefromConfig(org.apache.flink.configuration.ReadableConfig config) getIfPresent(RowData key) Returns the value associated with key in this cache, or null if there is no cached value for key.inthashCode()voidinvalidate(RowData key) Discards any cached value for the specified key.static DefaultLookupCache.BuilderCreates a builder for the cache.voidopen(org.apache.flink.metrics.groups.CacheMetricGroup metricGroup) Initialize the cache.put(RowData key, Collection<RowData> value) Associates the specified value rows with the specified key row in the cache.longsize()Returns the number of key-value mappings in the cache.
-
Method Details
-
newBuilder
Creates a builder for the cache. -
fromConfig
-
open
public void open(org.apache.flink.metrics.groups.CacheMetricGroup metricGroup) Description copied from interface:LookupCacheInitialize the cache.- Specified by:
openin interfaceLookupCache- Parameters:
metricGroup- the metric group to register cache related metrics.
-
getIfPresent
Description copied from interface:LookupCacheReturns the value associated with key in this cache, or null if there is no cached value for key.- Specified by:
getIfPresentin interfaceLookupCache
-
put
Description copied from interface:LookupCacheAssociates 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:
putin interfaceLookupCache- Parameters:
key- - key row with which the specified value is to be associatedvalue- – 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
Description copied from interface:LookupCacheDiscards any cached value for the specified key.- Specified by:
invalidatein interfaceLookupCache
-
size
public long size()Description copied from interface:LookupCacheReturns the number of key-value mappings in the cache.- Specified by:
sizein interfaceLookupCache
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
equals
-
hashCode
public int hashCode()
-