|
GigaSpaces XAP 9.7.2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.gigaspaces.server.eviction.SpaceEvictionStrategy
public abstract class SpaceEvictionStrategy
Base class for space eviction strategy implementations. When the space memory manager detects that memory is becoming scarce, it will try to evict entries from the space. The eviction strategy can be altered by using different SpaceEvictionStrategy implementations.
AllInCacheSpaceEvictionStrategy
,
ConcurrentLruSpaceEvictionStrategy
Constructor Summary | |
---|---|
SpaceEvictionStrategy()
|
Method Summary | |
---|---|
void |
close()
Called when the space is closed. |
abstract int |
evict(int numOfEntries)
Called when the space requires entries to be evicted. |
protected SpaceEvictionStrategyConfig |
getEvictionConfig()
Returns the eviction configuration provided during initialization. |
protected SpaceEvictionManager |
getEvictionManager()
Returns the eviction manager provided during initialization. |
void |
initialize(SpaceEvictionManager evictionManager,
SpaceEvictionStrategyConfig config)
Called during the space initialization. |
protected boolean |
isClosed()
Returns true if the space is closed, false otherwise. |
void |
onInsert(EvictableServerEntry entry)
Called when a new entry is written to the space. |
void |
onLoad(EvictableServerEntry entry)
Called when an entry is loaded into the space from an external data source. |
void |
onRead(EvictableServerEntry entry)
Called when an entry is read from the space. |
void |
onRemove(EvictableServerEntry entry)
Called when an entry is removed from the space. |
void |
onUpdate(EvictableServerEntry entry)
Called when an entry is updated in the space. |
boolean |
requiresConcurrencyProtection()
Due to the nature of the system, calls to onRemove(EvictableServerEntry) can occur in concurrent with either
onRead(EvictableServerEntry) or onUpdate(EvictableServerEntry) or even before them. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SpaceEvictionStrategy()
Method Detail |
---|
public void initialize(SpaceEvictionManager evictionManager, SpaceEvictionStrategyConfig config)
evictionManager
- config
- public void close()
public boolean requiresConcurrencyProtection()
onRemove(EvictableServerEntry)
can occur in concurrent with either
onRead(EvictableServerEntry)
or 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.
public void onInsert(EvictableServerEntry entry)
entry
- The new entrypublic void onLoad(EvictableServerEntry entry)
entry
- The loaded entrypublic void onRead(EvictableServerEntry entry)
entry
- The read entrypublic void onUpdate(EvictableServerEntry entry)
entry
- The updated entrypublic void onRemove(EvictableServerEntry entry)
entry
- The removed entrypublic abstract int evict(int numOfEntries)
numOfEntries
- Number of entries to be evicted
protected SpaceEvictionManager getEvictionManager()
protected SpaceEvictionStrategyConfig getEvictionConfig()
protected boolean isClosed()
|
GigaSpaces XAP 9.7.2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |