Class TimeBasedSpaceEvictionStrategy
java.lang.Object
com.gigaspaces.server.eviction.SpaceEvictionStrategy
com.gigaspaces.internal.server.space.eviction.TimeBasedSpaceEvictionStrategy
- Direct Known Subclasses:
DefaultTimeBasedSpaceEvictionStrategy
abstract class- infra' for time-based eviction strategy
- Since:
- 9.1
- Author:
- Yechiel Feffer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Constructor Summary
ConstructorsConstructorDescriptionTimeBasedSpaceEvictionStrategy(long inCacheTimeInterval, long inCacheReinsertedTimeInterval, long harvestMainInterval, long harvestShortLivedInterval) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Called when the space is closed.intevict(int numOfEntries) Called when the space requires entries to be evicted.voidinitialize(SpaceEvictionManager evictionManager, SpaceEvictionStrategyConfig config) Called during the space initialization.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.voidonRemove(EvictableServerEntry entry) Called when an entry is removed from the space.Methods inherited from class com.gigaspaces.server.eviction.SpaceEvictionStrategy
getEvictionConfig, getEvictionManager, isClosed, onRead, onUpdate, requiresConcurrencyProtection
-
Constructor Details
-
TimeBasedSpaceEvictionStrategy
public TimeBasedSpaceEvictionStrategy(long inCacheTimeInterval, long inCacheReinsertedTimeInterval, long harvestMainInterval, long harvestShortLivedInterval)
-
-
Method Details
-
initialize
Description copied from class:SpaceEvictionStrategyCalled during the space initialization.- Overrides:
initializein classSpaceEvictionStrategy
-
close
public void close()Description copied from class:SpaceEvictionStrategyCalled when the space is closed.- Overrides:
closein 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
-
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
-