public class CacheWrapper<K extends Serializable,V extends Serializable> extends Object implements Cache<K,V>
Constructor and Description |
---|
CacheWrapper(Cache<K,V> cache) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(Object key) |
long |
getCacheHits()
Returns the number of cache hits.
|
long |
getCacheMisses()
Returns the number of cache misses.
|
int |
getCacheSize()
Returns the size of the cache contents in bytes.
|
long |
getMaxCacheSize()
Returns the maximum size of the cache in bytes.
|
long |
getMaxLifetime()
Returns the maximum number of milliseconds that any object can live
in cache.
|
String |
getName()
Returns the name of the cache.
|
Cache<K,V> |
getWrappedCache() |
boolean |
isEmpty() |
Set<K> |
keySet() |
V |
put(K key,
V value) |
void |
putAll(Map<? extends K,? extends V> t) |
V |
remove(Object key) |
void |
setMaxCacheSize(int maxSize)
Sets the maximum size of the cache in bytes.
|
void |
setMaxLifetime(long maxLifetime)
Sets the maximum number of milliseconds that any object can live
in cache.
|
void |
setName(String name)
Sets the name of the cache
|
void |
setWrappedCache(Cache<K,V> cache) |
int |
size() |
Collection<V> |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public String getName()
Cache
getName
in interface Cache<K extends Serializable,V extends Serializable>
public void setName(String name)
Cache
setName
in interface Cache<K extends Serializable,V extends Serializable>
name
- the name of the cachepublic long getMaxCacheSize()
Cache
getMaxCacheSize
in interface Cache<K extends Serializable,V extends Serializable>
public void setMaxCacheSize(int maxSize)
Cache
Note: If using the Hazelcast clustering plugin, this will not take effect until the next time the cache is created
setMaxCacheSize
in interface Cache<K extends Serializable,V extends Serializable>
maxSize
- the maximum size of the cache in bytes.public long getMaxLifetime()
Cache
getMaxLifetime
in interface Cache<K extends Serializable,V extends Serializable>
public void setMaxLifetime(long maxLifetime)
Cache
Note: If using the Hazelcast clustering plugin, this will not take effect until the next time the cache is created
setMaxLifetime
in interface Cache<K extends Serializable,V extends Serializable>
maxLifetime
- the maximum number of milliseconds before objects are expired.public int getCacheSize()
Cache
getCacheSize
in interface Cache<K extends Serializable,V extends Serializable>
public long getCacheHits()
Cache
Keeping track of cache hits and misses lets one measure how efficient the cache is; the higher the percentage of hits, the more efficient.
getCacheHits
in interface Cache<K extends Serializable,V extends Serializable>
public long getCacheMisses()
Cache
Keeping track of cache hits and misses lets one measure how efficient the cache is; the higher the percentage of hits, the more efficient.
getCacheMisses
in interface Cache<K extends Serializable,V extends Serializable>
public int size()
size
in interface Map<K extends Serializable,V extends Serializable>
public void clear()
clear
in interface Map<K extends Serializable,V extends Serializable>
public boolean isEmpty()
isEmpty
in interface Map<K extends Serializable,V extends Serializable>
public boolean containsKey(Object key)
containsKey
in interface Map<K extends Serializable,V extends Serializable>
public boolean containsValue(Object value)
containsValue
in interface Map<K extends Serializable,V extends Serializable>
public Collection<V> values()
values
in interface Map<K extends Serializable,V extends Serializable>
public void putAll(Map<? extends K,? extends V> t)
putAll
in interface Map<K extends Serializable,V extends Serializable>
public Set<Map.Entry<K,V>> entrySet()
entrySet
in interface Map<K extends Serializable,V extends Serializable>
public Set<K> keySet()
keySet
in interface Map<K extends Serializable,V extends Serializable>
public V get(Object key)
get
in interface Map<K extends Serializable,V extends Serializable>
public V remove(Object key)
remove
in interface Map<K extends Serializable,V extends Serializable>
public V put(K key, V value)
put
in interface Map<K extends Serializable,V extends Serializable>
Copyright © 2003–2019 Ignite Realtime. All rights reserved.