Defines compute grid functionality for executing tasks and closures over nodes in the ClusterGroup.
More...
#include <compute.h>
|
| Compute (common::concurrent::SharedPointer< impl::compute::ComputeImpl > impl) |
| Constructor. 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.).
ignite::compute::Compute::Compute |
( |
common::concurrent::SharedPointer< impl::compute::ComputeImpl > |
impl | ) |
|
|
inline |
Constructor.
Internal method. Should not be used by user.
- Parameters
-
template<typename R , typename F >
std::vector<R> ignite::compute::Compute::Broadcast |
( |
const F & |
func | ) |
|
|
inline |
Broadcasts provided ComputeFunc to all nodes in the cluster group.
- Template Parameters
-
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. |
- Parameters
-
- Returns
- Vector containing computation results.
- Exceptions
-
template<typename F >
void ignite::compute::Compute::Broadcast |
( |
const F & |
func | ) |
|
|
inline |
Broadcasts provided ComputeFunc to all nodes in the cluster group.
- Template Parameters
-
F | Compute function type. Should implement ComputeFunc<R> class. |
- Parameters
-
- Exceptions
-
template<typename R , typename F >
Future< std::vector<R> > ignite::compute::Compute::BroadcastAsync |
( |
const F & |
func | ) |
|
|
inline |
Asyncronuously broadcasts provided ComputeFunc to all nodes in the cluster group.
- Template Parameters
-
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. |
- Parameters
-
- Returns
- Future that can be used to access computation results once they are ready.
- Exceptions
-
template<typename F >
Future<void> ignite::compute::Compute::BroadcastAsync |
( |
const F & |
func | ) |
|
|
inline |
Asyncronuously broadcasts provided ComputeFunc to all nodes in the cluster group.
- Template Parameters
-
F | Compute function type. Should implement ComputeFunc<R> class. |
- Parameters
-
- Returns
- Future that can be used to wait for action to complete.
- Exceptions
-
template<typename R , typename F >
R ignite::compute::Compute::Call |
( |
const F & |
func | ) |
|
|
inline |
Calls provided ComputeFunc on a node within the underlying cluster group.
- Template Parameters
-
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. |
- Parameters
-
- Returns
- Computation result.
- Exceptions
-
template<typename R , typename F >
Future<R> ignite::compute::Compute::CallAsync |
( |
const F & |
func | ) |
|
|
inline |
Asyncronuously calls provided ComputeFunc on a node within the underlying cluster group.
- Template Parameters
-
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. |
- Parameters
-
- Returns
- Future that can be used to access computation result once it's ready.
- Exceptions
-
template<typename F >
void ignite::compute::Compute::Run |
( |
const F & |
action | ) |
|
|
inline |
Runs provided ComputeFunc on a node within the underlying cluster group.
- Template Parameters
-
F | Compute function type. Should implement ComputeFunc<void> class. |
- Parameters
-
- Exceptions
-
template<typename F >
Future<void> ignite::compute::Compute::RunAsync |
( |
const F & |
action | ) |
|
|
inline |
Asyncronuously runs provided ComputeFunc on a node within the underlying cluster group.
- Template Parameters
-
F | Compute function type. Should implement ComputeFunc<void> class. |
- Parameters
-
- Returns
- Future that can be used to wait for action to complete.
- Exceptions
-
The documentation for this class was generated from the following file: