Class ConcurrentLruSpaceEvictionStrategy
java.lang.Object
com.gigaspaces.server.eviction.SpaceEvictionStrategy
com.gigaspaces.internal.server.space.eviction.ConcurrentLruSpaceEvictionStrategy
note- concurrent LRU is not an "accurate" eviction policy in the sense that the number of
objects stored can be lower than the limit defined but new objects will be rejected. it is mostly
suitable for large LRU sizes & large # of threads
- Since:
- 7.0
- Author:
- Yechiel Feffer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintevict(int numOfEntries) Called when the space requires entries to be evicted.voidonInsert(EvictableServerEntry entry) Called when a new entry is written to the space.voidonLoad(EvictableServerEntry entry) Called when an entry is loaded into the space from an external data source.voidonRead(EvictableServerEntry entry) Called when an entry is read from the space.voidonRemove(EvictableServerEntry entry) Called when an entry is removed from the space.voidonUpdate(EvictableServerEntry entry) Called when an entry is updated in the space.booleanDetermines whether this eviction strategy implementation requires concurrency protection from the space.Methods inherited from class com.gigaspaces.server.eviction.SpaceEvictionStrategy
close, getEvictionConfig, getEvictionManager, initialize, isClosed
-
Constructor Details
-
ConcurrentLruSpaceEvictionStrategy
public ConcurrentLruSpaceEvictionStrategy(int touchThreshold, int maxCacheSize)
-
-
Method Details
-
requiresConcurrencyProtection
public boolean requiresConcurrencyProtection()Determines whether this eviction strategy implementation requires concurrency protection from the space.- Overrides:
requiresConcurrencyProtectionin classSpaceEvictionStrategy
-
onInsert
Description copied from class:SpaceEvictionStrategyCalled when a new entry is written to the space.- Overrides:
onInsertin classSpaceEvictionStrategy- Parameters:
entry- The new entry
-
onLoad
Description copied from class:SpaceEvictionStrategyCalled when an entry is loaded into the space from an external data source.- Overrides:
onLoadin classSpaceEvictionStrategy- Parameters:
entry- The loaded entry
-
onRead
Description copied from class:SpaceEvictionStrategyCalled when an entry is read from the space.- Overrides:
onReadin classSpaceEvictionStrategy- Parameters:
entry- The read entry
-
onUpdate
Description copied from class:SpaceEvictionStrategyCalled when an entry is updated in the space.- Overrides:
onUpdatein classSpaceEvictionStrategy- Parameters:
entry- The updated entry
-
onRemove
Description copied from class:SpaceEvictionStrategyCalled when an entry is removed from the space.- Overrides:
onRemovein classSpaceEvictionStrategy- Parameters:
entry- The removed entry
-
evict
public int evict(int numOfEntries) Description copied from class:SpaceEvictionStrategyCalled when the space requires entries to be evicted.- Specified by:
evictin classSpaceEvictionStrategy- Parameters:
numOfEntries- Number of entries to be evicted- Returns:
- The number of entries actually evicted
-