public class LruEvictionPolicyFactory<K,V> extends AbstractEvictionPolicyFactory<LruEvictionPolicy<K,V>>
LruEvictionPolicy
.
Creates cache Eviction policy based on Least Recently Used (LRU)
algorithm and supports batch eviction.
The eviction starts in the following cases:
batchSize
elements greater than the maximum size.maxMemSize == 0
).
batchSize
elements will be evicted in this case. The default batchSize
value is 1
.
LruEvictionPolicy
implementation is very efficient since it is lock-free and does not create any additional table-like
data structures. The LRU
ordering information is maintained by attaching ordering metadata to cache entries.Constructor and Description |
---|
LruEvictionPolicyFactory() |
LruEvictionPolicyFactory(int maxSize) |
LruEvictionPolicyFactory(int maxSize,
int batchSize,
long maxMemSize) |
Modifier and Type | Method and Description |
---|---|
LruEvictionPolicy<K,V> |
create() |
getBatchSize, getMaxMemorySize, getMaxSize, setBatchSize, setMaxMemorySize, setMaxSize
public LruEvictionPolicyFactory()
public LruEvictionPolicyFactory(int maxSize)
maxSize
- Maximum allowed size of cache before entry will start getting evicted.public LruEvictionPolicyFactory(int maxSize, int batchSize, long maxMemSize)
maxSize
- Maximum allowed size of cache before entry will start getting evicted.batchSize
- Batch size.maxMemSize
- Maximum allowed cache size in bytes.public LruEvictionPolicy<K,V> create()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023