public interface ICache<K,V> extends ICacheType
ICacheType.CacheType| Modifier and Type | Field and Description |
|---|---|
static String |
NAME_COMPONENT_DELIMITER
Delimiter of a cache name component.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Prepares for shutdown.
|
ICacheElement<K,V> |
get(K key)
Gets an item from the cache.
|
String |
getCacheName()
Returns the cache name.
|
Map<K,ICacheElement<K,V>> |
getMatching(String pattern)
Gets items from the cache matching the given pattern.
|
Map<K,ICacheElement<K,V>> |
getMultiple(Set<K> keys)
Gets multiple items from the cache based on the given set of keys.
|
int |
getSize()
Returns the current cache size in number of elements.
|
String |
getStats()
Returns the cache stats.
|
CacheStatus |
getStatus()
Returns the cache status.
|
boolean |
remove(K key)
Removes an item from the cache.
|
void |
removeAll()
Removes all cached items from the cache.
|
void |
setKeyMatcher(IKeyMatcher<K> keyMatcher)
Sets the key matcher used by get matching.
|
void |
update(ICacheElement<K,V> element)
Puts an item to the cache.
|
getCacheTypestatic final String NAME_COMPONENT_DELIMITER
void update(ICacheElement<K,V> element) throws IOException
element - IOExceptionICacheElement<K,V> get(K key) throws IOException
key - IOExceptionMap<K,ICacheElement<K,V>> getMultiple(Set<K> keys) throws IOException
keys - IOExceptionMap<K,ICacheElement<K,V>> getMatching(String pattern) throws IOException
pattern - IOExceptionboolean remove(K key) throws IOException
key - IOExceptionvoid removeAll()
throws IOException
IOExceptionvoid dispose()
throws IOException
IOExceptionint getSize()
CacheStatus getStatus()
String getStats()
String getCacheName()
void setKeyMatcher(IKeyMatcher<K> keyMatcher)
keyMatcher - Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.