public class CacheFifoEvictionPolicy<K,V> extends Object implements CacheEvictionPolicy<K,V>, CacheFifoEvictionPolicyMBean
First In First Out (FIFO)
algorithm. This
implementation is very efficient since it does not create any additional
table-like data structures. The FIFO
ordering information is
maintained by attaching ordering metadata to cache entries.Constructor and Description |
---|
CacheFifoEvictionPolicy()
Constructs FIFO eviction policy with all defaults.
|
CacheFifoEvictionPolicy(int max)
Constructs FIFO eviction policy with maximum size.
|
Modifier and Type | Method and Description |
---|---|
int |
getCurrentSize()
Gets current queue size.
|
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.
|
Collection<EvictableEntry<K,V>> |
queue()
Gets read-only view on internal
FIFO queue in proper order. |
void |
setMaxSize(int max)
Sets maximum allowed size of cache before entry will start getting evicted.
|
String |
toString() |
public CacheFifoEvictionPolicy()
public CacheFifoEvictionPolicy(int max)
max
- Maximum allowed size of cache before entry will start getting evicted.public int getMaxSize()
getMaxSize
in interface CacheFifoEvictionPolicyMBean
public void setMaxSize(int max)
setMaxSize
in interface CacheFifoEvictionPolicyMBean
max
- Maximum allowed size of cache before entry will start getting evicted.public int getCurrentSize()
getCurrentSize
in interface CacheFifoEvictionPolicyMBean
public Collection<EvictableEntry<K,V>> queue()
FIFO
queue in proper order.'FIFO'
queue.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-RC1 Release Date : February 16 2015