IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.revision
Interface CollisionArbiter


public interface CollisionArbiter

Decides what value to store when there is a collision on multiple primaries. The output of the arbitrateCollision method must be consistent across all primaries. Inconsistencies in this implementation will result in inconsistencies in data.

A CollisionArbiter implementation that also implements the ObjectGridLifecycleListener interface will be automatically added as an EventListener on the ObjectGrid when the arbiter is set on the object grid.

A CollisionArbiter may implement the ObjectGridPlugin interface in order to receive enhanced ObjectGrid plug-in lifecycle method calls. The plug-in is also required to correctly implement each of the bean methods related to introspection of its state (for example isInitialized(), isDestroyed(), etc).

Since:
7.1
See Also:
ObjectGrid.addEventListener(EventListener), ObjectGrid.setCollisionArbiter(CollisionArbiter)

Nested Class Summary
static class CollisionArbiter.Resolution
          Marks how the collision should be resolved.
 
Method Summary
 CollisionArbiter.Resolution arbitrateCollision(CollisionData collisionData)
          Indicates that a revision event has discovered a write operation has occurred on two primaries simultaneously.
 void initialize(ObjectGrid grid)
          Called when the ObjectGrid which this arbiter is attached to is initialized.
 

Method Detail

initialize

void initialize(ObjectGrid grid)
Called when the ObjectGrid which this arbiter is attached to is initialized. The arbiter can get any information about the grid necessary for making decisions.

Parameters:
grid - The ObjectGrid that this arbiter is responsible for arbitrating collisions for.

arbitrateCollision

CollisionArbiter.Resolution arbitrateCollision(CollisionData collisionData)
Indicates that a revision event has discovered a write operation has occurred on two primaries simultaneously. The revisioning logic can not resolve this event without data loss.
This method has four valid outcomes and an error condition:
Return value Outcome
null Abstain, allow the default arbiter to make the decision.
CollisionArbiter.Resolution.KEEP Keep the existing entry, throw away the collision entry.
CollisionArbiter.Resolution.OVERRIDE Override the existing entry with the collision entry.
CollisionArbiter.Resolution.REVISE Modify the entry either by merging the entries or removing the entry.
Exception The revision transaction will be rolled back. No revision will be applied and a message will be logged.

The session that is being used to apply the revision changes is supplied for making modifications to collision elements. Care should be taken in using this session as it is an active internal session. This session must not be used outside the scope of this method call.

Parameters:
collisionData - The data object that provides information about the collision.
Returns:
The resolution marker that determines how to deal with the collision.

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

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