public class SimpleWindowPartitionCache<K,V> extends Object implements WindowPartitionCache<K,V>
Modifier and Type | Class and Description |
---|---|
static class |
SimpleWindowPartitionCache.SimpleWindowPartitionCacheBuilder<K,V> |
WindowPartitionCache.Builder<K,V>, WindowPartitionCache.CacheLoader<K,V>, WindowPartitionCache.RemovalCause, WindowPartitionCache.RemovalListener<K,V>
Modifier and Type | Method and Description |
---|---|
ConcurrentMap<K,V> |
asMap()
Return a
ConcurrentMap view of the current entries in the cache. |
V |
get(K key)
Get value from the cache or load the value.
|
void |
invalidate(K key)
Invalidate an entry from the cache.
|
static <K,V> SimpleWindowPartitionCache.SimpleWindowPartitionCacheBuilder<K,V> |
newBuilder() |
V |
pinAndGet(K key)
Get value from the cache or load the value pinning it so that the entry will never get evicted.
|
boolean |
unpin(K key)
Unpin an entry from the cache so that it can be a candidate for eviction.
|
public static <K,V> SimpleWindowPartitionCache.SimpleWindowPartitionCacheBuilder<K,V> newBuilder()
public V get(K key)
WindowPartitionCache
get
in interface WindowPartitionCache<K,V>
key
- the keypublic V pinAndGet(K key)
WindowPartitionCache
pinAndGet
in interface WindowPartitionCache<K,V>
key
- the keypublic boolean unpin(K key)
WindowPartitionCache
unpin
in interface WindowPartitionCache<K,V>
key
- the keypublic ConcurrentMap<K,V> asMap()
WindowPartitionCache
ConcurrentMap
view of the current entries in the cache.asMap
in interface WindowPartitionCache<K,V>
public void invalidate(K key)
WindowPartitionCache
invalidate
in interface WindowPartitionCache<K,V>
key
- the keyCopyright © 2023 The Apache Software Foundation. All rights reserved.