@PublicEvolving public interface LookupCache extends AutoCloseable, Serializable
The type of the caching key is a RowData
with lookup key fields packed inside. The
type of value is a Collection
of RowData
, which are rows matching lookup key
fields.
Cache entries are manually added using put(org.apache.flink.table.data.RowData, java.util.Collection<org.apache.flink.table.data.RowData>)
, and are stored in the cache until either
evicted or manually invalidated.
Implementations of this interface are expected to be thread-safe, and can be safely accessed by multiple concurrent threads.
Modifier and Type | Method and Description |
---|---|
Collection<RowData> |
getIfPresent(RowData key)
Returns the value associated with key in this cache, or null if there is no cached value for
key.
|
void |
invalidate(RowData key)
Discards any cached value for the specified key.
|
void |
open(CacheMetricGroup metricGroup)
Initialize the cache.
|
Collection<RowData> |
put(RowData key,
Collection<RowData> value)
Associates the specified value rows with the specified key row in the cache.
|
long |
size()
Returns the number of key-value mappings in the cache.
|
close
void open(CacheMetricGroup metricGroup)
metricGroup
- the metric group to register cache related metrics.@Nullable Collection<RowData> getIfPresent(RowData key)
Collection<RowData> put(RowData key, Collection<RowData> value)
key
- - key row with which the specified value is to be associatedvalue
- – value rows to be associated with the specified keyvoid invalidate(RowData key)
long size()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.