public class CacheRandomEvictionPolicy<K,V> extends Object implements CacheEvictionPolicy<K,V>, CacheRandomEvictionPolicyMBean
getMaxSize()
parameter. This implementation is
extremely light weight, lock-free, and does not create any data structures to maintain
any order for eviction.
Random eviction will provide the best performance over any key set in which every key has the same probability of being accessed.
Constructor and Description |
---|
CacheRandomEvictionPolicy()
Constructs random eviction policy with all defaults.
|
CacheRandomEvictionPolicy(int max)
Constructs random eviction policy with maximum size.
|
Modifier and Type | Method and Description |
---|---|
int |
getMaxSize()
Gets maximum allowed size of cache before entry will start getting evicted.
|
void |
onEntryAccessed(boolean rmv,
EvictableEntry<K,V> entry)
Callback for whenever entry is accessed.
|
void |
setMaxSize(int max)
Sets maximum allowed size of cache before entry will start getting evicted.
|
String |
toString() |
public CacheRandomEvictionPolicy()
public CacheRandomEvictionPolicy(int max)
max
- Maximum allowed size of cache before entry will start getting evicted.public int getMaxSize()
getMaxSize
in interface CacheRandomEvictionPolicyMBean
public void setMaxSize(int max)
setMaxSize
in interface CacheRandomEvictionPolicyMBean
max
- Maximum allowed size of cache before entry will start getting evicted.public void onEntryAccessed(boolean rmv, EvictableEntry<K,V> entry)
onEntryAccessed
in interface CacheEvictionPolicy<K,V>
rmv
- True
if entry has been removed, false
otherwise.entry
- Accessed entry.
Follow @ApacheIgnite
Apache Ignite Fabric : ver. 1.0.0-RC3 Release Date : March 24 2015