Interface WindowPartitionCache<K,V>
- Type Parameters:
K
- the key typeV
- the value type
- All Known Implementing Classes:
SimpleWindowPartitionCache
public interface WindowPartitionCache<K,V>
A loading cache abstraction for caching
WindowState.WindowPartition
.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Builder interface forWindowPartitionCache
.static interface
The interface for loading entires into the cache.static enum
The reason why an enrty got evicted from the cache.static interface
A callback interface for handling removal of events from the cache. -
Method Summary
Modifier and TypeMethodDescriptionasMap()
Return aConcurrentMap
view of the current entries in the cache.Get value from the cache or load the value.void
invalidate
(K key) Invalidate an entry from the cache.Get value from the cache or load the value pinning it so that the entry will never get evicted.boolean
Unpin an entry from the cache so that it can be a candidate for eviction.
-
Method Details
-
get
Get value from the cache or load the value.- Parameters:
key
- the key- Returns:
- the value
-
pinAndGet
Get value from the cache or load the value pinning it so that the entry will never get evicted.- Parameters:
key
- the key- Returns:
- the value
-
unpin
Unpin an entry from the cache so that it can be a candidate for eviction.- Parameters:
key
- the key- Returns:
- true if the entry was unpinned, false otherwise
-
asMap
ConcurrentMap<K,V> asMap()Return aConcurrentMap
view of the current entries in the cache.- Returns:
- the map of key-values currently cached.
-
invalidate
Invalidate an entry from the cache.- Parameters:
key
- the key
-