public interface ICache<K,V> extends ICacheType
ICacheType.CacheType
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.
|
getCacheType
void update(ICacheElement<K,V> element) throws IOException
element
- IOException
ICacheElement<K,V> get(K key) throws IOException
key
- IOException
Map<K,ICacheElement<K,V>> getMultiple(Set<K> keys) throws IOException
keys
- IOException
Map<K,ICacheElement<K,V>> getMatching(String pattern) throws IOException
pattern
- IOException
boolean remove(K key) throws IOException
key
- IOException
void removeAll() throws IOException
IOException
void dispose() throws IOException
IOException
int getSize()
CacheStatus getStatus()
String getStats()
String getCacheName()
void setKeyMatcher(IKeyMatcher<K> keyMatcher)
keyMatcher
- Copyright © 2002–2018 The Apache Software Foundation. All rights reserved.