Access Keys:
Skip to content (Access Key - 0)

GemFire Versions

About GemFire Enterprise 6.5

Getting Started




Developer Notes

Tools & Libraries

Toggle Sidebar

Function Execution Example

Function execution allows you to move function behavior to the application member hosting the the data. For large data sets, this can provide much better performance than moving the data to the application that needs to run the function. Read more about function execution.

Running the Example

In this example of peer-to-peer function execution, one member sends a request for function execution to a peer member. FunctionExecutionPeer2 creates a region, populates the region and sends a function execution request to FunctionExecutionPeer1 while simultaneously executing the function on its own region. It collects the result from its own execution as well as from FunctionExecutionPeer1. The function executed is programmed in MultiGetFunction, as an implementation of GemFire's FunctionAdapter. The results from the function are handled by MyArrayListResultCollector, which is an implementation of GemFire's ResultCollector.

To run this example, you must have terminal sessions configured for the QuickStart examples, as described in Setting Up the Environment.
  1. In one session, start the first member:
    $ java quickstart.FunctionExecutionPeer1
  2. When the first VM tells you to do so, start the second member in another session:
    $ java quickstart.FunctionExecutionPeer2

Example Listings

Program and cache configuration file listings for the function execution on VMs 1 and 2.  Both VMs use the same cache XML configuration file.

Related Javadocs

execute package

Child Pages

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
Adaptavist Theme Builder (3.4.0-M2-conf210) Powered by Atlassian Confluence 2.10.3, the Enterprise Wiki.