#include <gridclientcompute.hpp>
Public Member Functions | |
| virtual | ~GridClientCompute () |
| virtual TGridClientComputePtr | projection (const GridClientNode &node)=0 |
| virtual TGridClientComputePtr | projection (const TGridClientNodeList &nodes)=0 |
| virtual TGridClientComputePtr | projection (TGridClientNodePredicatePtr filter)=0 |
| virtual TGridClientComputePtr | projection (std::function< bool(const GridClientNode &)> &filter)=0 |
| virtual TGridClientComputePtr | projection (TGridClientNodePredicatePtr filter, TGridClientLoadBalancerPtr balancer)=0 |
| virtual TGridClientComputePtr | projection (std::function< bool(const GridClientNode &)> &filter, TGridClientLoadBalancerPtr balancer)=0 |
| virtual TGridClientComputePtr | projection (const TGridClientNodeList &nodes, TGridClientLoadBalancerPtr balancer)=0 |
| virtual TGridClientLoadBalancerPtr | balancer () const =0 |
| virtual GridClientVariant | execute (const std::string &taskName, const GridClientVariant &taskArg=GridClientVariant())=0 |
| virtual TGridClientFutureVariant | executeAsync (const std::string &taskName, const GridClientVariant &taskArg=GridClientVariant())=0 |
| virtual GridClientVariant | affinityExecute (const std::string &taskName, const std::string &cacheName, const GridClientVariant &affKey, const GridClientVariant &taskArg=GridClientVariant())=0 |
| virtual TGridClientFutureVariant | affinityExecuteAsync (const std::string &taskName, const std::string &cacheName, const GridClientVariant &affKey, const GridClientVariant &taskArg=GridClientVariant())=0 |
| virtual TGridClientNodePtr | node (const GridClientUuid &id) const =0 |
| virtual TGridClientNodeList | nodes (TGridClientNodePredicatePtr filter) const =0 |
| virtual TGridClientNodeList | nodes (std::function< bool(const GridClientNode &)> &filter) const =0 |
| virtual TGridClientNodeList | nodes () const =0 |
| virtual TGridClientNodeList | nodes (const std::vector< GridClientUuid > &ids) const =0 |
| virtual TGridClientNodePtr | refreshNode (const GridClientUuid &id, bool includeAttrs, bool includeMetrics)=0 |
| virtual TGridClientNodeFuturePtr | refreshNodeAsync (const GridClientUuid &id, bool includeAttrs, bool includeMetrics)=0 |
| virtual TGridClientNodePtr | refreshNode (const std::string &ip, bool includeAttrs, bool includeMetrics)=0 |
| virtual TGridClientNodeFuturePtr | refreshNodeAsync (const std::string &ip, bool includeAttrs, bool includeMetrics)=0 |
| virtual TGridClientNodeList | refreshTopology (bool includeAttrs, bool includeMetrics)=0 |
| virtual TGridClientNodeFutureList | refreshTopologyAsync (bool includeAttrs, bool includeMetrics)=0 |
| virtual std::vector< std::string > | log (int lineFrom, int lineTo)=0 |
| virtual TGridFutureStringList | logAsync (int lineFrom, int lineTo)=0 |
| virtual std::vector< std::string > | log (const std::string &path, int lineFrom, int lineTo)=0 |
| virtual TGridFutureStringList | logAsync (const std::string &path, int lineFrom, int lineTo)=0 |
A compute projection of grid client. Contains various methods for a task execution, full and partial (per node) topology refresh and log downloading.
| virtual GridClientCompute::~GridClientCompute | ( | ) | [inline, virtual] |
Destructor.
| virtual GridClientVariant GridClientCompute::affinityExecute | ( | const std::string & | taskName, | |
| const std::string & | cacheName, | |||
| const GridClientVariant & | affKey, | |||
| const GridClientVariant & | taskArg = GridClientVariant() | |||
| ) | [pure virtual] |
Executes task using cache affinity key for routing. This way the task will start executing exactly on the node where this affinity key is cached.
| taskName | Task name or task class name. | |
| cacheName | Name of the cache on which affinity should be calculated. | |
| affKey | Affinity key. | |
| taskArg | Optional task argument. |
| GridClientException | In case of error. | |
| GridServerUnreachableException | If none of the servers can be reached. | |
| GridClientClosedException | If client was closed manually. |
| virtual TGridClientFutureVariant GridClientCompute::affinityExecuteAsync | ( | const std::string & | taskName, | |
| const std::string & | cacheName, | |||
| const GridClientVariant & | affKey, | |||
| const GridClientVariant & | taskArg = GridClientVariant() | |||
| ) | [pure virtual] |
Asynchronously executes task using cache affinity key for routing. This way the task will start executing exactly on the node where this affinity key is cached.
| taskName | Task name or task class name. | |
| cacheName | Name of the cache on which affinity should be calculated. | |
| affKey | Affinity key. | |
| taskArg | Optional task argument. |
| virtual TGridClientLoadBalancerPtr GridClientCompute::balancer | ( | ) | const [pure virtual] |
Gets balancer used by this projection.
| virtual GridClientVariant GridClientCompute::execute | ( | const std::string & | taskName, | |
| const GridClientVariant & | taskArg = GridClientVariant() | |||
| ) | [pure virtual] |
Executes task.
| taskName | Task name or task class name. | |
| taskArg | Optional task argument. |
| GridClientException | In case of error. | |
| GridServerUnreachableException | If none of the servers can be reached. | |
| GridClientClosedException | If client was closed manually. |
| virtual TGridClientFutureVariant GridClientCompute::executeAsync | ( | const std::string & | taskName, | |
| const GridClientVariant & | taskArg = GridClientVariant() | |||
| ) | [pure virtual] |
Asynchronously executes task.
| taskName | Task name or task class name. | |
| taskArg | Optional task argument. |
| virtual std::vector<std::string> GridClientCompute::log | ( | int | lineFrom, | |
| int | lineTo | |||
| ) | [pure virtual] |
Gets contents of default log file (GRIDGAIN_HOME/work/log/gridgain.log).
| lineFrom | Index of line from which log is get, inclusive (starting from 0). | |
| lineTo | Index of line to which log is get, inclusive (starting from 0). |
| GridClientException | In case of error. | |
| GridServerUnreachableException | If none of the servers can be reached. | |
| GridClientClosedException | If client was closed manually. |
| virtual std::vector<std::string> GridClientCompute::log | ( | const std::string & | path, | |
| int | lineFrom, | |||
| int | lineTo | |||
| ) | [pure virtual] |
Gets contents of custom log file.
| path | Log file path. Can be absolute or relative to GRIDGAIN_HOME. | |
| lineFrom | Index of line from which log is get, inclusive (starting from 0). | |
| lineTo | Index of line to which log is get, inclusive (starting from 0). |
| GridClientException | In case of error. | |
| GridServerUnreachableException | If none of the servers can be reached. | |
| GridClientClosedException | If client was closed manually. |
| virtual TGridFutureStringList GridClientCompute::logAsync | ( | int | lineFrom, | |
| int | lineTo | |||
| ) | [pure virtual] |
Asynchronously gets contents of default log file (GRIDGAIN_HOME/work/log/gridgain.log).
| lineFrom | Index of line from which log is get, inclusive (starting from 0). | |
| lineTo | Index of line to which log is get, inclusive (starting from 0). |
| virtual TGridFutureStringList GridClientCompute::logAsync | ( | const std::string & | path, | |
| int | lineFrom, | |||
| int | lineTo | |||
| ) | [pure virtual] |
Asynchronously gets contents of custom log file.
| path | Log file path. Can be absolute or relative to GRIDGAIN_HOME. | |
| lineFrom | Index of line from which log is get, inclusive (starting from 0). | |
| lineTo | Index of line to which log is get, inclusive (starting from 0). |
| virtual TGridClientNodePtr GridClientCompute::node | ( | const GridClientUuid & | id | ) | const [pure virtual] |
Gets node with given id from most recently refreshed topology.
| id | Node ID. |
null if node with given id was not found. | virtual TGridClientNodeList GridClientCompute::nodes | ( | ) | const [pure virtual] |
Gets all nodes in the projection.
| virtual TGridClientNodeList GridClientCompute::nodes | ( | const std::vector< GridClientUuid > & | ids | ) | const [pure virtual] |
Gets nodes for the given IDs based on most recently refreshed topology.
| ids | Node IDs. |
| virtual TGridClientNodeList GridClientCompute::nodes | ( | TGridClientNodePredicatePtr | filter | ) | const [pure virtual] |
Gets nodes that pass the filter. If this compute instance is a projection, then only nodes that pass projection criteria will be passed to the filter.
| filter | Node filter. |
| virtual TGridClientNodeList GridClientCompute::nodes | ( | std::function< bool(const GridClientNode &)> & | filter | ) | const [pure virtual] |
Gets nodes that pass the filter. If this compute instance is a projection, then only nodes that pass projection criteria will be passed to the filter.
| filter | Node filter. |
| virtual TGridClientComputePtr GridClientCompute::projection | ( | std::function< bool(const GridClientNode &)> & | filter | ) | [pure virtual] |
Creates a projection that will communicate only with nodes that are accepted by the given filter.
If this projection is dynamic projection, then filter will be applied to the most relevant topology snapshot every time a node is selected. If this projection is a static projection, then resulting projection will only be restricted to nodes that were in this projection and were accepted by the filter. If any of the checks fails an exception will be thrown.
| filter | Filter that will select nodes for projection. |
| GridClientException | If resulting projection is empty. |
| virtual TGridClientComputePtr GridClientCompute::projection | ( | const GridClientNode & | node | ) | [pure virtual] |
Creates a projection that will communicate only with specified remote node.
If current projection is dynamic projection, then this method will check is passed node is in topology. If any filters were specified in current topology, this method will check if passed node is accepted by the filter. If current projection was restricted to any subset of nodes, this method will check if passed node is in that subset. If any of the checks fails an exception will be thrown.
| node | Single node to which this projection will be restricted. |
| GridClientException | If resulting projection is empty. |
| virtual TGridClientComputePtr GridClientCompute::projection | ( | const TGridClientNodeList & | nodes | ) | [pure virtual] |
Creates a projection that will communicate only with specified remote nodes. For any particular call a node to communicate will be selected using the balancer of this projection.
If current projection is dynamic projection, then this method will check is passed nodes are in topology. If any filters were specified in current topology, this method will check if passed nodes are accepted by the filter. If current projection was restricted to any subset of nodes, this method will check if passed nodes are in that subset (i.e. calculate the intersection of two collections). If any of the checks fails an exception will be thrown.
| nodes | Collection of nodes to which this projection will be restricted. |
| GridClientException | If resulting projection is empty. |
| virtual TGridClientComputePtr GridClientCompute::projection | ( | TGridClientNodePredicatePtr | filter | ) | [pure virtual] |
Creates a projection that will communicate only with nodes that are accepted by the given filter.
If this projection is dynamic projection, then filter will be applied to the most relevant topology snapshot every time a node is selected. If this projection is a static projection, then resulting projection will only be restricted to nodes that were in this projection and were accepted by the filter. If any of the checks fails an exception will be thrown.
| filter | Filter that will select nodes for projection. |
| GridClientException | If resulting projection is empty. |
| virtual TGridClientComputePtr GridClientCompute::projection | ( | std::function< bool(const GridClientNode &)> & | filter, | |
| TGridClientLoadBalancerPtr | balancer | |||
| ) | [pure virtual] |
Creates a projection that will communicate only with nodes that are accepted by the given filter. The balancer will override the default balancer specified in the configuration.
If this projection is dynamic projection, then filter will be applied to the most relevant topology snapshot every time a node to communicate is selected. If this projection is a static projection, then resulting projection will only be restricted to nodes that were in this projection and were accepted by the filter. If any of the checks fails an exception will be thrown.
| filter | Filter that will select nodes for projection. | |
| balancer | Balancer that will select balanced node in resulting projection. |
| GridClientException | If resulting projection is empty. |
| virtual TGridClientComputePtr GridClientCompute::projection | ( | TGridClientNodePredicatePtr | filter, | |
| TGridClientLoadBalancerPtr | balancer | |||
| ) | [pure virtual] |
Creates a projection that will communicate only with nodes that are accepted by the given filter. The balancer will override the default balancer specified in the configuration.
If this projection is dynamic projection, then filter will be applied to the most relevant topology snapshot every time a node to communicate is selected. If this projection is a static projection, then resulting projection will only be restricted to nodes that were in this projection and were accepted by the filter. If any of the checks fails an exception will be thrown.
| filter | Filter that will select nodes for projection. | |
| balancer | Balancer that will select balanced node in resulting projection. |
| GridClientException | If resulting projection is empty. |
| virtual TGridClientComputePtr GridClientCompute::projection | ( | const TGridClientNodeList & | nodes, | |
| TGridClientLoadBalancerPtr | balancer | |||
| ) | [pure virtual] |
Creates a projection that will communicate only with specified remote nodes. For any particular call a node to communicate will be selected by the load balancer.
If this projection is a dynamic projection, then this method will check if the given nodes are in the topology. If a filter is specified by this projection, this method will check if the given nodes are accepted by the filter. If current projection was restricted to any subset of nodes, this method will check if passed nodes are in that subset (i.e. calculate the intersection of two collections). If any of the checks fails an exception will be thrown.
| nodes | Collection of nodes to which this projection will be restricted. | |
| balancer | Balancer that will select nodes in resulting projection. |
| GridClientException | If resulting projection is empty. |
| virtual TGridClientNodePtr GridClientCompute::refreshNode | ( | const GridClientUuid & | id, | |
| bool | includeAttrs, | |||
| bool | includeMetrics | |||
| ) | [pure virtual] |
Gets node by its ID.
| id | Node ID. | |
| includeAttrs | Whether to include node attributes. | |
| includeMetrics | Whether to include node metrics. |
null if node doesn't exist. | GridClientException | In case of error. | |
| GridServerUnreachableException | If none of the servers can be reached. | |
| GridClientClosedException | If client was closed manually. |
| virtual TGridClientNodePtr GridClientCompute::refreshNode | ( | const std::string & | ip, | |
| bool | includeAttrs, | |||
| bool | includeMetrics | |||
| ) | [pure virtual] |
Gets node by IP address.
| ip | IP address. | |
| includeAttrs | Whether to include node attributes. | |
| includeMetrics | Whether to include node metrics. |
null if node doesn't exist. | GridClientException | In case of error. | |
| GridServerUnreachableException | If none of the servers can be reached. | |
| GridClientClosedException | If client was closed manually. |
| virtual TGridClientNodeFuturePtr GridClientCompute::refreshNodeAsync | ( | const GridClientUuid & | id, | |
| bool | includeAttrs, | |||
| bool | includeMetrics | |||
| ) | [pure virtual] |
Asynchronously gets node by its ID.
| id | Node ID. | |
| includeAttrs | Whether to include node attributes. | |
| includeMetrics | Whether to include node metrics. |
| virtual TGridClientNodeFuturePtr GridClientCompute::refreshNodeAsync | ( | const std::string & | ip, | |
| bool | includeAttrs, | |||
| bool | includeMetrics | |||
| ) | [pure virtual] |
Asynchronously gets node by IP address.
| ip | IP address. | |
| includeAttrs | Whether to include node attributes. | |
| includeMetrics | Whether to include node metrics. |
| virtual TGridClientNodeList GridClientCompute::refreshTopology | ( | bool | includeAttrs, | |
| bool | includeMetrics | |||
| ) | [pure virtual] |
Gets current topology.
| includeAttrs | Whether to include node attributes. | |
| includeMetrics | Whether to include node metrics. |
| GridClientException | In case of error. | |
| GridServerUnreachableException | If none of the servers can be reached. | |
| GridClientClosedException | If client was closed manually. |
| virtual TGridClientNodeFutureList GridClientCompute::refreshTopologyAsync | ( | bool | includeAttrs, | |
| bool | includeMetrics | |||
| ) | [pure virtual] |
Asynchronously gets current topology.
| includeAttrs | Whether to include node attributes. | |
| includeMetrics | Whether to include node metrics. |
1.7.1