This package contains the interfaces for interacting with the data grid API.
Overview
DataGrid is a major new set of application patterns supported by the ObjectGrid. ObjectGrid can store
data in a very large grid of computers. The data is partitioned and replicated amongst those servers. DataGrid
applications are characterized by including application logic agents in the same process as the data is stored. Clients
can send requests to those agents and receive the answers.
Map style
Clients can ask for a particular agent to be invoked for a collection of keys. The agent is invoked once for each key
and the results returned to the client. The invocations are in parallel across the grid. Clients can also run a query
against each partition and invoke the agent for each key returned by the query. This style is characterized by a single
result for each key processed.
Reduce or Aggregation style.
This style is different in that a single result is returned. The application provided set of keys is split in
to a list for each partition. An agent is then invoked for each partition with the keys for that partition. The agent returns
a single value as a result. Therefore, the intermediate results are a single value for each partition with keys. Finally, these
results are aggregated to a single value on the client.
Key directed agents or partition style
Agents can be invoked for specific keys or a client can request the agent be invoked on every partition. The every
partition use case usually means the agent will run a client specified query on each partition and process the
results of that query.
Basic operation
The application implements MapGridAgent or ReduceGridAgent depending on the pattern required. This agent must be serializable and
must be deployed to the ObjectGrid servers. The client then constructs an instance of the agent and may specify additional
agent specific state that is passed to the servers. The client obtains an AgentManager instance from the ObjectMap. The
client then invokes either callMapAgent or callReduceAgent on the AgentManager. The client must provide the agent instance
and a key or collection of keys. These methods must be invoked within a client side transaction. The transaction is used purely
for aggregating the results. Each agent on the servers runs using an independent transaction.
The ObjectGrid runtime then invokes the agents on the ObjectGrid servers with relevant data in parallel while
the client blocks waiting for the response.