K
- the key typeV
- the value typepublic interface LowerCachingTier<K,V> extends ConfigurationChangeSupport
CachingTier
.Modifier and Type | Interface and Description |
---|---|
static interface |
LowerCachingTier.Provider
Service interface for providing LowerCachingTier instances. |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Empty out this tier
|
Store.ValueHolder<V> |
get(K key)
Return the value holder currently in this tier.
|
Store.ValueHolder<V> |
getAndRemove(K key)
Return the value holder currently in this tier and removes it atomically.
|
Store.ValueHolder<V> |
installMapping(K key,
java.util.function.Function<K,Store.ValueHolder<V>> source)
Either return the
Store.ValueHolder currently in the caching tier
or installs and returns the result of the passed in function. |
void |
invalidate(K key)
Removes a mapping, triggering the
CachingTier.InvalidationListener if
registered. |
void |
invalidateAll()
Invalidates all mapping, invoking the
CachingTier.InvalidationListener if
registered. |
void |
invalidateAllWithHash(long hash)
Invalidates all mappings whose key's hash code matches the provided one, invoking the
CachingTier.InvalidationListener if registered. |
void |
setInvalidationListener(CachingTier.InvalidationListener<K,V> invalidationListener)
Set the caching tier's invalidation listener.
|
getConfigurationChangeListeners
Store.ValueHolder<V> installMapping(K key, java.util.function.Function<K,Store.ValueHolder<V>> source) throws StoreAccessException
Store.ValueHolder
currently in the caching tier
or installs and returns the result of the passed in function.
Note that in case of expired Store.ValueHolder
null
will be returned
and the mapping will be invalidated.
key
- the keysource
- the function that computes the valuenull
StoreAccessException
- if the mapping cannot be accessed, installed or removedStore.ValueHolder<V> get(K key) throws StoreAccessException
key
- the keynull
StoreAccessException
- if the mapping cannot be accessStore.ValueHolder<V> getAndRemove(K key) throws StoreAccessException
key
- the keynull
StoreAccessException
- if the mapping cannot be access or removedvoid invalidate(K key) throws StoreAccessException
CachingTier.InvalidationListener
if
registered.key
- the key to removeStoreAccessException
- if the mapping cannot be removedvoid invalidateAll() throws StoreAccessException
CachingTier.InvalidationListener
if
registered.StoreAccessException
- if mappings cannot be removedvoid invalidateAllWithHash(long hash) throws StoreAccessException
CachingTier.InvalidationListener
if registered.StoreAccessException
- if mappings cannot be removedvoid clear() throws StoreAccessException
StoreAccessException
- if mappings cannot be removedvoid setInvalidationListener(CachingTier.InvalidationListener<K,V> invalidationListener)
invalidationListener
- the listener