public class SortedEvictionPolicyFactory<K,V> extends AbstractEvictionPolicyFactory<SortedEvictionPolicy<K,V>>
SortedEvictionPolicy
.
Creates cache Eviction policy which will select the minimum cache entry for 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
.
Entries comparison based on Comparator
instance if provided.
Default Comparator
behaviour is use cache entries keys for comparison that imposes a requirement for keys
to implement Comparable
interface.
User defined comparator should implement Serializable
interface.
Constructor and Description |
---|
SortedEvictionPolicyFactory() |
SortedEvictionPolicyFactory(int maxSize) |
SortedEvictionPolicyFactory(int maxSize,
int batchSize,
long maxMemSize) |
Modifier and Type | Method and Description |
---|---|
SortedEvictionPolicy<K,V> |
create() |
Comparator<EvictableEntry<K,V>> |
getComp()
Gets entries comparator.
|
void |
setComp(Comparator<EvictableEntry<K,V>> comp)
Sets entries comparator.
|
getBatchSize, getMaxMemorySize, getMaxSize, setBatchSize, setMaxMemorySize, setMaxSize
public SortedEvictionPolicyFactory()
public SortedEvictionPolicyFactory(int maxSize)
maxSize
- Maximum allowed size of cache before entry will start getting evicted.public SortedEvictionPolicyFactory(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 Comparator<EvictableEntry<K,V>> getComp()
public void setComp(Comparator<EvictableEntry<K,V>> comp)
comp
- entry comparator.public SortedEvictionPolicy<K,V> create()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.16.0 Release Date : December 15 2023