Defines compute grid functionality for executing tasks and closures over nodes in the ClusterGroup.
More...
|
| 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...
|
|
Defines compute grid functionality for executing tasks and closures over nodes in the ClusterGroup.
Instance of Compute is obtained from Ignite as follows:
- Load Balancing
- In all cases other than
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.
- Fault Tolerance
- Ignite guarantees that as long as there is at least one grid node standing, every job will be executed. Jobs will automatically failover to another node if a remote node crashed or has rejected execution due to lack of resources. By default, in case of failover, next load balanced node will be picked for job execution. Also jobs will never be re-routed to the nodes they have failed on. This behavior can be changed by configuring any of the existing or a custom FailoverSpi in grid configuration.
- Computation SPIs
- Note that regardless of which method is used for executing computations, all relevant SPI implementations configured for this compute instance will be used (i.e. failover, load balancing, collision resolution, checkpoints, etc.).