VMware Tanzu GemFire Native C++ Reference 10.2.7
apache::geode::client::Execution Class Reference

gathers results from function execution More...

#include <Execution.hpp>

Public Member Functions

std::shared_ptr< ResultCollectorexecute (const std::shared_ptr< CacheableVector > &routingObj, const std::shared_ptr< Cacheable > &args, const std::shared_ptr< ResultCollector > &rs, const std::string &func, std::chrono::milliseconds timeout)
 Executes the function using its name. More...
 
std::shared_ptr< ResultCollectorexecute (const std::string &func, std::chrono::milliseconds timeout=DEFAULT_QUERY_RESPONSE_TIMEOUT)
 Executes the function using its name. More...
 
Execution withArgs (std::shared_ptr< Cacheable > args)
 Specifies the user data passed to the function when it is executed. More...
 
Execution withCollector (std::shared_ptr< ResultCollector > rs)
 Specifies the ResultCollector that will receive the results after the function has been executed. More...
 
Execution withFilter (std::shared_ptr< CacheableVector > routingObj)
 Specifies a data filter of routing objects for selecting the Geode members to execute the function. More...
 

Detailed Description

gathers results from function execution

See also
FunctionService

Member Function Documentation

◆ execute() [1/2]

std::shared_ptr< ResultCollector > apache::geode::client::Execution::execute ( const std::shared_ptr< CacheableVector > &  routingObj,
const std::shared_ptr< Cacheable > &  args,
const std::shared_ptr< ResultCollector > &  rs,
const std::string &  func,
std::chrono::milliseconds  timeout 
)

Executes the function using its name.

Parameters
routingObjSet defining the data filter to be used for executing the function
argsuser data passed to the function execution
rs* Specifies the ResultCollector that will receive the results after the function has been executed.
functhe name of the function to be executed
timeoutvalue to wait for the operation to finish before timing out.
Exceptions
Exceptionif there is an error during function execution
Returns
either a default result collector or one specified by withCollector(ResultCollector)

◆ execute() [2/2]

std::shared_ptr< ResultCollector > apache::geode::client::Execution::execute ( const std::string &  func,
std::chrono::milliseconds  timeout = DEFAULT_QUERY_RESPONSE_TIMEOUT 
)

Executes the function using its name.

Parameters
functhe name of the function to be executed
timeoutvalue to wait for the operation to finish before timing out.
Exceptions
Exceptionif there is an error during function execution
Returns
either a default result collector or one specified by withCollector(ResultCollector)

◆ withArgs()

Execution apache::geode::client::Execution::withArgs ( std::shared_ptr< Cacheable args)

Specifies the user data passed to the function when it is executed.

Parameters
argsuser data passed to the function execution
Returns
an Execution with args
Exceptions
IllegalArgumentExceptionif the input parameter is nullptr

◆ withCollector()

Execution apache::geode::client::Execution::withCollector ( std::shared_ptr< ResultCollector rs)

Specifies the ResultCollector that will receive the results after the function has been executed.

Returns
an Execution with a collector
Exceptions
IllegalArgumentExceptionif ResultCollector is nullptr
See also
ResultCollector

◆ withFilter()

Execution apache::geode::client::Execution::withFilter ( std::shared_ptr< CacheableVector routingObj)

Specifies a data filter of routing objects for selecting the Geode members to execute the function.

If the filter set is empty the function is executed on all members that have the FunctionService::onRegion(Region).

Parameters
routingObjSet defining the data filter to be used for executing the function
Returns
an Execution with the filter
Exceptions
IllegalArgumentExceptionif filter passed is nullptr.
UnsupportedOperationExceptionif not called after FunctionService::onRegion(Region).

Apache Geode C++ Cache API Documentation