IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.plugins
Interface LogSequence

All Superinterfaces:
Serializable

public interface LogSequence
extends Serializable

LogSequence is the ordered list of changes performed against a given map for a given transaction. These changes are recorded as LogElement objects.

Since:
WAS XD 6.0, XC10

Method Summary
 Iterator getAllChanges()
          Returns an iterator for processing all of the changes for a LogSequence.
 Iterator getChangesByKeys(Collection keys)
          Returns an iterator for processing the LogElements that have the requested keys.
 Iterator getChangesByTypes(Collection types)
          Returns an iterator for processing the LogElements that are of the requested type.
 String getMapName()
          Returns the name of the map that these changes apply to.
 String getObjectGridName()
          Returns the name of the ObjectGrid that houses the map that these changes apply to.
 Iterator getPendingChanges()
          Returns an iterator for processing all of the "pending" changes for a LogSequence (for example, pending inserts, updates, and deletes).
 boolean isDirty()
          Returns whether this LogSequence has any LogElements that would "dirty" a Map.
 boolean isRollback()
          Returns whether or not this LogSequence was generated to rollback a transaction.
 int size()
          Returns the total number of LogElements within this LogSequence.
 

Method Detail

size

int size()
Returns the total number of LogElements within this LogSequence.

Returns:
total number of LogElements

getPendingChanges

Iterator getPendingChanges()
Returns an iterator for processing all of the "pending" changes for a LogSequence (for example, pending inserts, updates, and deletes).

This method is normally used by a Loader. A pending change is one that has not been written out to a loader yet using a flush() operation. Note, the returned iterator's remove() is not allowed to be called and will throw an exception.

Returns:
an Iterator for processing the pending LogElement changes
See Also:
ObjectMap.flush(), Session.flush()

getAllChanges

Iterator getAllChanges()
Returns an iterator for processing all of the changes for a LogSequence.

This method would normally be used by an Evictor and other plugins that want to know all of the changes introduced by this LogSequence. Note, the returned iterator's remove() is not allowed to be called and will throw an exception.

Returns:
an Iterator for processing all of the LogElement changes

getChangesByTypes

Iterator getChangesByTypes(Collection types)
Returns an iterator for processing the LogElements that are of the requested type.

Each member of the input Collection should be one of the defined LogElement Types (INSERT, UPDATE, DELETE, FETCH, TOUCH, or EVICT). Note, the returned iterator's remove() is not allowed to be called and will throw an exception.

Parameters:
types - A Collection of LogElement Types (INSERT, UPDATE, etc)
Returns:
Iterator for processing all LogElements that support the input Type(s)
Throws:
IllegalArgumentException - if types is null
See Also:
LogElement.DELETE, LogElement.EVICT, LogElement.FETCH, LogElement.INSERT, LogElement.TOUCH, LogElement.UPDATE, LogElement.CLEAR

getChangesByKeys

Iterator getChangesByKeys(Collection keys)
Returns an iterator for processing the LogElements that have the requested keys.

Note, the returned iterator's remove() is not allowed to be called and will throw an exception.

Parameters:
keys - a collection of key objects
Returns:
an Iterator for processing all LogElements that match the input key(s)

getMapName

String getMapName()
Returns the name of the map that these changes apply to.

The caller can use the return value of this method as input to the Session.getMap(String) method.

Returns:
The name of the map that these changes apply to
See Also:
Session.getMap(String)

getObjectGridName

String getObjectGridName()
Returns the name of the ObjectGrid that houses the map that these changes apply to.

Returns:
The name of the ObjectGrid that this LogSequence is associated with
Since:
WAS XD 6.0.1

isDirty

boolean isDirty()
Returns whether this LogSequence has any LogElements that would "dirty" a Map.

That is, if it contains any LogElements of any type other than Fetch/Get, it is considered "dirty".

Returns:
true if the LogSequence would modify a Map, if applied; false if the LogSequence would not modify a Map, if applied

isRollback

boolean isRollback()
Returns whether or not this LogSequence was generated to rollback a transaction.

Note, depending on when this LogSequence is used, the transaction itself might already be rolled back.

Returns:
true iff this LogSequence was generated to rollback a transaction.
Since:
WAS XD 6.0.1

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.