|
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 ReduceGridAgent
A ReduceGridAgent is used to process a set of entries and reduce them to a single result.
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.
ReduceGridAgents 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.
EntityAgentMixin
Method Summary | |
---|---|
Object |
reduce(Session s,
ObjectMap map)
This method is called on each partition. |
Object |
reduce(Session s,
ObjectMap map,
Collection keys)
The method should reduce the entries referenced by the key collection to a single value. |
Object |
reduceResults(Collection results)
This is called when further reduction is needed. |
Method Detail |
---|
Object reduce(Session s, ObjectMap map, Collection keys)
s
- The Session to use for any work. Transactions are controlled by the caller.map
- The ObjectMap this agent was invoked for.keys
- The collection of keys or entities whose values should be reduced.
Object reduce(Session s, ObjectMap map)
s
- The Session to use for any work. Transactions are controlled by the caller.map
- The ObjectMap this agent was invoked for
Object reduceResults(Collection results)
results
- the intermediate results to reduce.
|
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 |