Protected Member Functions | Protected Attributes

GridGain.Client.Impl.GridClientAbstractProjection< T > Class Template Reference

Class contains common connection-error handling logic. More...

Inherited by GridGain.Client.Impl.GridClientComputeImpl, and GridGain.Client.Impl.GridClientDataImpl.

List of all members.

Protected Member Functions

internal GridClientAbstractProjection (IGridClientProjectionConfig cfg, IEnumerable< N > nodes, Predicate< N > filter, IGridClientLoadBalancer balancer)
 Creates projection with specified client.
IGridClientFuture< TRes > WithReconnectHandling< TRes > (Func< IGridClientConnection, Guid, IGridClientFuture< TRes >> c)
 This method executes request to a communication layer and handles connection error, if it occurs. In case of communication exception client instance is notified and new instance of client is created. If none of the grid servers can be reached, an exception is thrown.
IGridClientFuture< TRes > WithReconnectHandling< TRes > (Func< IGridClientConnection, Guid, IGridClientFuture< TRes >> c, String cacheName, Object affKey)
 This method executes request to a communication layer and handles connection error, if it occurs. Server is picked up according to the projection affinity and key given. Connection will be made with the node on which key is cached. In case of communication exception client instance is notified and new instance of client is created. If none of servers can be reached, an exception is thrown.
bool CheckNodeAlive (Guid nodeId)
 Tries to refresh node on every possible connection in topology.
IList< N > ProjectionNodes ()
 Gets most recently refreshed topology. If this compute instance is a projection, then only nodes that satisfy projection criteria will be returned.
T CreateProjection (ICollection< N > nodes, Predicate< N > filter, IGridClientLoadBalancer balancer)
 Creates a sub-projection for current projection.
abstract T CreateProjectionImpl (IEnumerable< N > nodes, Predicate< N > filter, IGridClientLoadBalancer balancer)
 Subclasses must implement this method and return concrete implementation of projection needed.

Protected Attributes

readonly IList< N > _nodes
 List of nodes included in this projection. If null, all nodes in topology are included.
readonly Predicate< N > _filter
 Node filter to be applied for this projection.
readonly IGridClientLoadBalancer _balancer
 Node filter to be applied for this projection.
readonly
IGridClientProjectionConfig 
cfg
 Projection configuration.

Detailed Description

template<T>
class GridGain::Client::Impl::GridClientAbstractProjection-g< T >

Type Constraints
T :GridClientAbstractProjection<T> 

Member Function Documentation

template<T >
bool GridGain.Client.Impl.GridClientAbstractProjection< T >.CheckNodeAlive ( Guid  nodeId  )  [protected]
Parameters:
nodeId Node id to check.
Returns:
True if response was received, null if either null response received or no nodes can be contacted at all.
Exceptions:
GridClientClosedException If client was closed manually.
template<T >
T GridGain.Client.Impl.GridClientAbstractProjection< T >.CreateProjection ( ICollection< N >  nodes,
Predicate< N >  filter,
IGridClientLoadBalancer  balancer 
) [protected]
Parameters:
nodes Collection of nodes that sub-projection will be restricted to. If null,

created projection is dynamic and will take nodes from topology.

Parameters:
filter Filter to be applied to nodes in projection.
balancer Balancer to use in projection.
Returns:
Created projection.
Exceptions:
GridClientException If resulting projection is empty. Note that this exception may only be thrown on case of static projections, i.e. where collection of nodes is not null.
template<T >
abstract T GridGain.Client.Impl.GridClientAbstractProjection< T >.CreateProjectionImpl ( IEnumerable< N >  nodes,
Predicate< N >  filter,
IGridClientLoadBalancer  balancer 
) [protected, pure virtual]
Parameters:
nodes Nodes that are included in projection.
filter Filter to be applied.
balancer Balancer to be used.
Returns:
Created projection.
template<T >
internal GridGain.Client.Impl.GridClientAbstractProjection< T >.GridClientAbstractProjection ( IGridClientProjectionConfig  cfg,
IEnumerable< N >  nodes,
Predicate< N >  filter,
IGridClientLoadBalancer  balancer 
) [protected]
Parameters:
cfg Progjection configuration.
nodes Collections of nodes included in this projection.
filter Node filter to be applied.
balancer Balancer to use.
template<T >
IList<N> GridGain.Client.Impl.GridClientAbstractProjection< T >.ProjectionNodes (  )  [protected]
Returns:
Most recently refreshed topology.
template<T >
IGridClientFuture<TRes> GridGain.Client.Impl.GridClientAbstractProjection< T >.WithReconnectHandling< TRes > ( Func< IGridClientConnection, Guid, IGridClientFuture< TRes >>  c,
String  cacheName,
Object  affKey 
) [protected]
Parameters:
c Closure to be executed.
cacheName Cache name for which mapped node will be calculated.
affKey Affinity key.
Returns:
Closure result.
template<T >
IGridClientFuture<TRes> GridGain.Client.Impl.GridClientAbstractProjection< T >.WithReconnectHandling< TRes > ( Func< IGridClientConnection, Guid, IGridClientFuture< TRes >>  c  )  [protected]
Parameters:
c Closure to be executed.
Returns:
Closure result.

Member Data Documentation

template<T >
readonly Predicate<N> GridGain.Client.Impl.GridClientAbstractProjection< T >._filter [protected]
template<T >
readonly IList<N> GridGain.Client.Impl.GridClientAbstractProjection< T >._nodes [protected]