![]() |
GridGain C++
|
Defines compute grid functionality for executing tasks and closures over nodes in the ClusterGroup. More...
#include <compute.h>
Public Member Functions | |
Compute (common::concurrent::SharedPointer< impl::compute::ComputeImpl > impl) | |
Constructor. More... | |
template<typename R , typename K , typename F > | |
R | AffinityCall (const std::string &cacheName, const K &key, const F &func) |
Executes given job on the node where data for provided affinity key is located (a.k.a. More... | |
template<typename R , typename K , typename F > | |
Future< R > | AffinityCallAsync (const std::string &cacheName, const K &key, const F &func) |
Executes given job asynchronously on the node where data for provided affinity key is located (a.k.a. More... | |
template<typename K , typename F > | |
void | AffinityRun (const std::string &cacheName, const K &key, const F &action) |
Executes given job on the node where data for provided affinity key is located (a.k.a. More... | |
template<typename K , typename F > | |
Future< void > | AffinityRunAsync (const std::string &cacheName, const K &key, const F &action) |
Executes given job asynchronously on the node where data for provided affinity key is located (a.k.a. More... | |
template<typename R , typename F > | |
R | Call (const F &func) |
Calls provided ComputeFunc on a node within the underlying cluster group. More... | |
template<typename R , typename F > | |
Future< R > | CallAsync (const F &func) |
Asyncronuously calls provided ComputeFunc on a node within the underlying cluster group. More... | |
template<typename F > | |
void | Run (const F &action) |
Runs provided ComputeFunc on a node within the underlying cluster group. More... | |
template<typename F > | |
Future< void > | RunAsync (const F &action) |
Asyncronuously runs provided ComputeFunc on a node within the underlying cluster group. More... | |
template<typename R , typename F > | |
std::vector< R > | Broadcast (const F &func) |
Broadcasts provided ComputeFunc to all nodes in the cluster group. More... | |
template<typename F > | |
void | Broadcast (const F &func) |
Broadcasts provided ComputeFunc to all nodes in the cluster group. More... | |
template<typename R , typename F > | |
Future< std::vector< R > > | BroadcastAsync (const F &func) |
Asyncronuously broadcasts provided ComputeFunc to all nodes in the cluster group. More... | |
template<typename F > | |
Future< void > | BroadcastAsync (const F &func) |
Asyncronuously broadcasts provided ComputeFunc to all nodes in the cluster group. More... | |
template<typename R , typename A > | |
R | ExecuteJavaTask (const std::string &taskName, const A &taskArg) |
Executes given Java task on the grid projection. More... | |
template<typename R > | |
R | ExecuteJavaTask (const std::string &taskName) |
Executes given Java task on the grid projection. More... | |
template<typename R , typename A > | |
Future< R > | ExecuteJavaTaskAsync (const std::string &taskName, const A &taskArg) |
Asynchronously executes given Java task on the grid projection. More... | |
template<typename R > | |
Future< R > | ExecuteJavaTaskAsync (const std::string &taskName) |
Asynchronously executes given Java task on the grid projection. More... | |
Defines compute grid functionality for executing tasks and closures over nodes in the ClusterGroup.
Instance of Compute is obtained from Ignite as follows:
Broadcast(...)
, Ignite must select a node for a computation to be executed. The node will be selected based on the underlying LoadBalancingSpi
, which by default sequentially picks next available node from the underlying cluster group. Other load balancing policies, such as random
or adaptive
, can be configured as well by selecting a different load balancing SPI in Ignite configuration.
|
inline |
Constructor.
Internal method. Should not be used by user.
impl | Implementation. |
|
inline |
Executes given job on the node where data for provided affinity key is located (a.k.a.
affinity co-location).
R | Call return type. BinaryType should be specialized for the type if it is not primitive. Should not be void. For non-returning methods see Compute::AffinityRun(). |
K | Affinity key type. |
F | Compute function type. Should implement ComputeFunc<R> class. |
cacheName | Cache name to use for affinity co-location. |
key | Affinity key. |
func | Compute function to call. |
IgniteError | in case of error. |
|
inline |
Executes given job asynchronously on the node where data for provided affinity key is located (a.k.a.
affinity co-location).
R | Call return type. BinaryType should be specialized for the type if it is not primitive. Should not be void. For non-returning methods see Compute::AffinityRun(). |
K | Affinity key type. |
F | Compute function type. Should implement ComputeFunc<R> class. |
cacheName | Cache name to use for affinity co-location. |
key | Affinity key. |
func | Compute function to call. |
IgniteError | in case of error. |
|
inline |
Executes given job on the node where data for provided affinity key is located (a.k.a.
affinity co-location).
K | Affinity key type. |
F | Compute function type. Should implement ComputeFunc<R> class. |
cacheName | Cache names to use for affinity co-location. |
key | Affinity key. |
action | Compute action to call. |
IgniteError | in case of error. |
|
inline |
Executes given job asynchronously on the node where data for provided affinity key is located (a.k.a.
affinity co-location).
K | Affinity key type. |
F | Compute function type. Should implement ComputeFunc<R> class. |
cacheName | Cache names to use for affinity co-location. |
key | Affinity key. |
action | Compute action to call. |
IgniteError | in case of error. |
|
inline |
Broadcasts provided ComputeFunc to all nodes in the cluster group.
R | Function return type. BinaryType should be specialized for the type if it is not primitive. |
F | Compute function type. Should implement ComputeFunc<R> class. |
func | Compute function to call. |
IgniteError | in case of error. |
|
inline |
Broadcasts provided ComputeFunc to all nodes in the cluster group.
F | Compute function type. Should implement ComputeFunc<R> class. |
func | Compute function to call. |
IgniteError | in case of error. |
|
inline |
Asyncronuously broadcasts provided ComputeFunc to all nodes in the cluster group.
R | Function return type. BinaryType should be specialized for the type if it is not primitive. |
F | Compute function type. Should implement ComputeFunc<R> class. |
func | Compute function to call. |
IgniteError | in case of error. |
|
inline |
Asyncronuously broadcasts provided ComputeFunc to all nodes in the cluster group.
F | Compute function type. Should implement ComputeFunc<R> class. |
func | Compute function to call. |
IgniteError | in case of error. |
|
inline |
Calls provided ComputeFunc on a node within the underlying cluster group.
R | Call return type. BinaryType should be specialized for the type if it is not primitive. Should not be void. For non-returning methods see Compute::Run(). |
F | Compute function type. Should implement ComputeFunc<R> class. |
func | Compute function to call. |
IgniteError | in case of error. |
|
inline |
Asyncronuously calls provided ComputeFunc on a node within the underlying cluster group.
R | Call return type. BinaryType should be specialized for the type if it is not primitive. Should not be void. For non-returning methods see Compute::Run(). |
F | Compute function type. Should implement ComputeFunc<R> class. |
func | Compute function to call. |
IgniteError | in case of error. |
|
inline |
Executes given Java task on the grid projection.
If task for given name has not been deployed yet, then 'taskName' will be used as task class name to auto-deploy the task.
taskName | Java task name. |
R
.R | Type of task result. |
|
inline |
Executes given Java task on the grid projection.
If task for given name has not been deployed yet, then 'taskName' will be used as task class name to auto-deploy the task.
taskName | Java task name. |
taskArg | Argument of task execution of type A. |
R
.R | Type of task result. |
A | Type of task argument. |
|
inline |
Asynchronously executes given Java task on the grid projection.
If task for given name has not been deployed yet, then 'taskName' will be used as task class name to auto-deploy the task.
taskName | Java task name. |
R
.R | Type of task result. |
|
inline |
Asynchronously executes given Java task on the grid projection.
If task for given name has not been deployed yet, then 'taskName' will be used as task class name to auto-deploy the task.
taskName | Java task name. |
taskArg | Argument of task execution of type A. |
R
.R | Type of task result. |
A | Type of task argument. |
|
inline |
Runs provided ComputeFunc on a node within the underlying cluster group.
F | Compute function type. Should implement ComputeFunc<void> class. |
action | Compute function to call. |
IgniteError | in case of error. |
|
inline |
Asyncronuously runs provided ComputeFunc on a node within the underlying cluster group.
F | Compute function type. Should implement ComputeFunc<void> class. |
action | Compute function to call. |
IgniteError | in case of error. |