IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.datagrid
Interface MapGridAgent

All Superinterfaces:
Serializable

public interface MapGridAgent
extends Serializable

A MapGridAgent is used to process operations against map entries in a remote (server-side) ObjectGrid. An agent is submitted using an ObjectMap's AgentManager and is run on the server ObjectGrid instances that host the data in the map. The agent is routed to one or more server instances based on the partitions that the optional keys resolve to.

If the map is associated with an entity, then the provided key should be an entity instance and the keys returned from processAllEntries map should be an entity with at least all the key attributes populated. Agent implementations should implement the EntityAgentMixin interface to allow automatic key to entity conversion.

MapGridAgents are invoked in a separate, independent transaction from the client's transaction. A single client request may result in multiple transactions. This can happen if the ObjectGrid processes a thousand keys using 10 transactions on 10 threads for example, 100 keys per thread.

Keys are processed in arbitrary order sequentially or in parallel and may be grouped into one or more transactions. Agents may run more than once for a key if a subsequent agent call fails in the same transaction, however an agent will only commit a successful process call one time.

Since:
WAS XD 6.1
See Also:
EntityAgentMixin

Method Summary
 Object process(Session s, ObjectMap map, Object key)
          This method is called once per key per partition.
 Map processAllEntries(Session s, ObjectMap map)
          This method is called once per partition.
 

Method Detail

process

Object process(Session s,
               ObjectMap map,
               Object key)
This method is called once per key per partition.

Parameters:
s - The Session to use for any work. Transactions are controlled by the caller.
map - The ObjectMap this agent was invoked for
key - The key of the entry to process.
Returns:
The result of the processing.

processAllEntries

Map processAllEntries(Session s,
                      ObjectMap map)
This method is called once per partition.

The MapGridAgent instance may have additional state to filter the set of entries usually using a query against the partition.

Parameters:
s - The Session to use for any work. Transactions are controlled by the caller.
map - The ObjectMap this agent was invoked for.
Returns:
A map of processed values for keys

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

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