|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface EvictionAlgorithm
Interface for all eviction algorithms.
Note: None of the Eviction classes are thread safe. It is assumed that an individual instance of an EvictionPolicy/ EvictionAlgorithm/EvictionQueue/EvictionConfiguration are only operated on by one thread at any given time.
| Method Summary | |
|---|---|
void |
assignToRegion(Fqn fqn,
CacheSPI<?,?> cache,
EvictionAlgorithmConfig evictionAlgorithmConfig,
Configuration configuration)
Assigns the algorithm instance to a specific region. |
boolean |
canIgnoreEvent(EvictionEvent.Type eventType)
Tests whether the algorithm would ignore certain event types on certain Fqns. |
Class<? extends EvictionAlgorithmConfig> |
getConfigurationClass()
This is a helper so that the XML parser will be able to select and use the correct EvictionAlgorithmConfig implementation
class corresponding to this EvictionAlgorithm. |
EvictionQueue |
getEvictionQueue()
Get the EvictionQueue implementation used by this algorithm. |
void |
initialize()
Invoked by the region manager when the enclosing region is initialized. |
void |
process(BlockingQueue<EvictionEvent> queue)
Entry point for eviction algorithm. |
void |
resetEvictionQueue()
Reset the whole eviction queue. |
void |
setEvictionActionPolicy(EvictionActionPolicy evictionActionPolicy)
Sets the eviction action policy, so the algorithm knows what to do when a node is to be evicted. |
| Method Detail |
|---|
void process(BlockingQueue<EvictionEvent> queue)
throws EvictionException
EvictionEvent
passed in.
queue - to process
EvictionExceptionvoid resetEvictionQueue()
EvictionQueue getEvictionQueue()
void setEvictionActionPolicy(EvictionActionPolicy evictionActionPolicy)
evictionActionPolicy - to set
void assignToRegion(Fqn fqn,
CacheSPI<?,?> cache,
EvictionAlgorithmConfig evictionAlgorithmConfig,
Configuration configuration)
fqn - of the region to be assigned tocache - cache referenceevictionAlgorithmConfig - configuration for the current algorithm instance.configuration - for the entire cache.boolean canIgnoreEvent(EvictionEvent.Type eventType)
eventType - event type to test for
void initialize()
Class<? extends EvictionAlgorithmConfig> getConfigurationClass()
EvictionAlgorithmConfig implementation
class corresponding to this EvictionAlgorithm. E.g., the FIFOAlgorithm would return FIFOAlgorithmConfig.class.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||