Package org.apache.ignite.cache.eviction
Interface EvictionPolicy<K,V>
-
- All Known Implementing Classes:
AbstractEvictionPolicy
,FifoEvictionPolicy
,LruEvictionPolicy
,SortedEvictionPolicy
public interface EvictionPolicy<K,V>
Pluggable cache eviction policy. Usually, implementations will internally order cache entries based ononEntryAccessed(boolean, EvictableEntry)
notifications and whenever an element needs to be evicted,EvictableEntry.evict()
method should be called.Ignite comes with following eviction policies out-of-the-box:
The eviction policy thread-safety is ensured by Ignition. Implementations of this interface should not worry about concurrency and should be implemented as they were only accessed from one thread.
Note that implementations of all eviction policies provided by Ignite are very light weight in a way that they are all lock-free (or very close to it), and do not create any internal tables, arrays, or other expensive structures. The eviction order is preserved by attaching light-weight meta-data to existing cache entries.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onEntryAccessed(boolean rmv, EvictableEntry<K,V> entry)
Callback for whenever entry is accessed.
-
-
-
Method Detail
-
onEntryAccessed
void onEntryAccessed(boolean rmv, EvictableEntry<K,V> entry)
Callback for whenever entry is accessed.- Parameters:
rmv
-True
if entry has been removed,false
otherwise.entry
- Accessed entry.
-
-