|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Evictor
Data contained in a BackingMap
are evicted when the map is
full. This plugin is used by the BackingMap
to determine when
and what to evict from the map based on some algorithm (LRU, LFU, time
based, etc).
An Evictor
implementation that also implements the BackingMapLifecycleListener
interface will be automatically added as an EventListener
on the BackingMap
when the
evictor set on the backing map.
An Evictor
may also implement the BackingMapPlugin
interface in order
to receive enhanced BackingMap plug-in lifecycle method calls. The plug-in is then
also required to correctly implement each of the bean methods related to
introspection of its state (for example isInitialized()
,
isDestroyed()
, etc).
BackingMap.addMapEventListener(EventListener)
,
BackingMap.setEvictor(Evictor)
,
EvictorData
Method Summary | |
---|---|
void |
activate()
This method is called to activate the Evictor. |
void |
apply(LogSequence sequence)
Called after a transaction has committed to allow the evictor to track object usage in the BackingMap . |
void |
deactivate()
This method is called to deactivate the Evictor. |
void |
destroy()
Called when the BackingMap associated with this evictor is
destroyed. |
void |
initialize(BackingMap map,
EvictionEventCallback callback)
Called by a BackingMap instance during the evictor
initialization time. |
Method Detail |
---|
void initialize(BackingMap map, EvictionEventCallback callback)
Called by a BackingMap
instance during the evictor
initialization time.
The BackingMap
calls this method so the Evictor
instance can have references to the BackingMap
and
EvictionEventCallback
instances. The evictor can signal
events to have specific entries evicted using the
EvictionEventCallback
.
map
- the BackingMap instancecallback
- the EvictionEventCallback instanceBackingMap
,
EvictionEventCallback
void destroy()
Called when the BackingMap
associated with this evictor is
destroyed.
This method is the opposite of the initialize
method. When
it is called, the Evictor can free up any resources it uses.
ObjectGrid.destroy()
void apply(LogSequence sequence)
BackingMap
.
This method also reports any entries that have been successfully evicted.
Note, this method is not called for transactions that are rolled back. If
there is a need to track object usage for rolled back transactions, the
evictor must implement the RollbackEvictor
interface as
well.
This method is called after a transaction has completed. Consequently,
all transaction locks that were acquired by the completed transaction
are no longer held. Potentially, multiple threads could call this method
concurrently and each thread would be completing its own transaction.
Since transaction locks are already released by the completed transaction,
this method must provide its own synchronization to ensure it is thread safe.
For an Evictor in an ObjectMap
that is configured to use OutputFormat.RAW
for the keys or values, the keys and values objects in the LogSequence
will be SerializedKey
or SerializedValue
objects respectively. If required, you
can use the SerializedEntry.getObject()
method to retrieve (possibly inflating
the serialized object) the original key or value object.
To override the map's output format configuration, use the PluginOutputFormat
annotation in the implementation class.
sequence
- the LogSequence
of changes committed to the mapRollbackEvictor
void activate()
void deactivate()
|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |