public class LRUClientCache<K,V> extends ClientCache<K,V>
ClientCache implementation that evicts entries when the specified size has been reached.
The maximum size of the ClientCache is specified in bytes and the maximum size of the client cache is reached when
the sum of the storage of ClientCacheEntry.size()'s exceeds the maximum size. When the size limit is reached,
objects are LRU evicted.| Constructor and Description |
|---|
LRUClientCache(long weightedNearCacheSizeBytes,
ClientCacheEntryWeigher<K,V> policy) |
| Modifier and Type | Method and Description |
|---|---|
ClientCacheEntry<K,V> |
get(K key)
Retrieve an entry from the client cache.
|
ClientCacheStats |
getStats() |
void |
put(ClientCacheEntry<K,V> entry)
Add an element to the client cache.
|
void |
remove(K key)
Remove an entry from the client cache.
|
public LRUClientCache(long weightedNearCacheSizeBytes,
ClientCacheEntryWeigher<K,V> policy)
public void put(ClientCacheEntry<K,V> entry)
ClientCacheput in class ClientCache<K,V>entry - the entry to add.public ClientCacheEntry<K,V> get(K key)
ClientCacheget in class ClientCache<K,V>key - the key to the entry to retrieve.public void remove(K key)
ClientCacheremove in class ClientCache<K,V>key - the key to remove.public ClientCacheStats getStats()
getStats in class ClientCache<K,V>