Class AllInCacheSpaceEvictionStrategy
java.lang.Object
com.gigaspaces.server.eviction.SpaceEvictionStrategy
com.gigaspaces.internal.server.space.eviction.AllInCacheSpaceEvictionStrategy
- Since:
- 5.0
- Author:
- Yechiel Feffer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintevict(int numOfEntries) Called when the space requires entries to be evicted.booleanDue to the nature of the system, calls toSpaceEvictionStrategy.onRemove(EvictableServerEntry)can occur in concurrent with eitherSpaceEvictionStrategy.onRead(EvictableServerEntry)orSpaceEvictionStrategy.onUpdate(EvictableServerEntry)or even before them.Methods inherited from class com.gigaspaces.server.eviction.SpaceEvictionStrategy
close, getEvictionConfig, getEvictionManager, initialize, isClosed, onInsert, onLoad, onRead, onRemove, onUpdate
-
Constructor Details
-
AllInCacheSpaceEvictionStrategy
public AllInCacheSpaceEvictionStrategy()
-
-
Method Details
-
requiresConcurrencyProtection
public boolean requiresConcurrencyProtection()Description copied from class:SpaceEvictionStrategyDue to the nature of the system, calls toSpaceEvictionStrategy.onRemove(EvictableServerEntry)can occur in concurrent with eitherSpaceEvictionStrategy.onRead(EvictableServerEntry)orSpaceEvictionStrategy.onUpdate(EvictableServerEntry)or even before them. In order to prevent this behavior this property should return true (This is the default) and the system will guard this with locks. This should only be set to false by advanced usages which needs to be able to work under this behavior.- Overrides:
requiresConcurrencyProtectionin classSpaceEvictionStrategy
-
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
-