Public Member Functions

GridClientCompute Class Reference

#include <gridclientcompute.hpp>

Inheritance diagram for GridClientCompute:
GridClientComputeProjectionImpl

List of all members.

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

Detailed Description

A compute projection of grid client. Contains various methods for a task execution, full and partial (per node) topology refresh and log downloading.


Constructor & Destructor Documentation

virtual GridClientCompute::~GridClientCompute (  )  [inline, virtual]

Destructor.


Member Function Documentation

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.

Parameters:
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.
Returns:
Task execution result.
Exceptions:
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.

Parameters:
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.
Returns:
Future.
virtual TGridClientLoadBalancerPtr GridClientCompute::balancer (  )  const [pure virtual]

Gets balancer used by this projection.

Returns:
Instance of GridClientLoadBalancer.
virtual GridClientVariant GridClientCompute::execute ( const std::string &  taskName,
const GridClientVariant &  taskArg = GridClientVariant() 
) [pure virtual]

Executes task.

Parameters:
taskName Task name or task class name.
taskArg Optional task argument.
Returns:
Task execution result.
Exceptions:
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.

Parameters:
taskName Task name or task class name.
taskArg Optional task argument.
Returns:
Future.
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).

Parameters:
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).
Returns:
Log contents.
Exceptions:
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.

Parameters:
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).
Returns:
Log contents.
Exceptions:
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).

Parameters:
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).
Returns:
Future.
virtual TGridFutureStringList GridClientCompute::logAsync ( const std::string &  path,
int  lineFrom,
int  lineTo 
) [pure virtual]

Asynchronously gets contents of custom log file.

Parameters:
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).
Returns:
Future.
virtual TGridClientNodePtr GridClientCompute::node ( const GridClientUuid &  id  )  const [pure virtual]

Gets node with given id from most recently refreshed topology.

Parameters:
id Node ID.
Returns:
Node for given ID or null if node with given id was not found.
virtual TGridClientNodeList GridClientCompute::nodes (  )  const [pure virtual]

Gets all nodes in the projection.

Returns:
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.

Parameters:
ids Node IDs.
Returns:
Collection of nodes for provided 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.

Parameters:
filter Node filter.
Returns:
Collection of nodes that satisfy provided 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.

Parameters:
filter Node filter.
Returns:
Collection of nodes that satisfy provided 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.

Parameters:
filter Filter that will select nodes for projection.
Returns:
Resulting projection (static or dynamic, depending in parent projection type).
Exceptions:
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.

Parameters:
node Single node to which this projection will be restricted.
Returns:
Resulting static projection that is bound to a given node.
Exceptions:
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.

Parameters:
nodes Collection of nodes to which this projection will be restricted.
Returns:
Resulting static projection that is bound to the given nodes.
Exceptions:
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.

Parameters:
filter Filter that will select nodes for projection.
Returns:
Resulting projection (static or dynamic, depending in parent projection type).
Exceptions:
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.

Parameters:
filter Filter that will select nodes for projection.
balancer Balancer that will select balanced node in resulting projection.
Returns:
Resulting projection (static or dynamic, depending in parent projection type).
Exceptions:
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.

Parameters:
filter Filter that will select nodes for projection.
balancer Balancer that will select balanced node in resulting projection.
Returns:
Resulting projection (static or dynamic, depending in parent projection type).
Exceptions:
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.

Parameters:
nodes Collection of nodes to which this projection will be restricted.
balancer Balancer that will select nodes in resulting projection.
Returns:
Resulting static projection that is bound to a given nodes.
Exceptions:
GridClientException If resulting projection is empty.
virtual TGridClientNodePtr GridClientCompute::refreshNode ( const GridClientUuid &  id,
bool  includeAttrs,
bool  includeMetrics 
) [pure virtual]

Gets node by its ID.

Parameters:
id Node ID.
includeAttrs Whether to include node attributes.
includeMetrics Whether to include node metrics.
Returns:
Node descriptor or null if node doesn't exist.
Exceptions:
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.

Parameters:
ip IP address.
includeAttrs Whether to include node attributes.
includeMetrics Whether to include node metrics.
Returns:
Node descriptor or null if node doesn't exist.
Exceptions:
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.

Parameters:
id Node ID.
includeAttrs Whether to include node attributes.
includeMetrics Whether to include node metrics.
Returns:
Future.
virtual TGridClientNodeFuturePtr GridClientCompute::refreshNodeAsync ( const std::string &  ip,
bool  includeAttrs,
bool  includeMetrics 
) [pure virtual]

Asynchronously gets node by IP address.

Parameters:
ip IP address.
includeAttrs Whether to include node attributes.
includeMetrics Whether to include node metrics.
Returns:
Future.
virtual TGridClientNodeList GridClientCompute::refreshTopology ( bool  includeAttrs,
bool  includeMetrics 
) [pure virtual]

Gets current topology.

Parameters:
includeAttrs Whether to include node attributes.
includeMetrics Whether to include node metrics.
Returns:
Node descriptors.
Exceptions:
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.

Parameters:
includeAttrs Whether to include node attributes.
includeMetrics Whether to include node metrics.
Returns:
Future.

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends