Classes | Public Types | Public Member Functions

GridClientConfiguration Class Reference

#include <gridclientconfiguration.hpp>

List of all members.

Classes

class  Impl

Public Types

enum  { DFLT_TOP_REFRESH_FREQ = 5000, DFLT_THREAD_POOL_SIZE = 4, DFLT_MAX_CONN_IDLE_TIME = 30000 }

Public Member Functions

 GridClientConfiguration ()
 GridClientConfiguration (const GridClientConfiguration &other)
GridClientConfiguration & operator= (const GridClientConfiguration &rhs)
virtual ~GridClientConfiguration ()
bool isEnableTopologyCache () const
void enableTopologyCache (bool enable)
long topologyRefreshFrequency () const
void topologyRefreshFrequency (long frequency)
TGridClientLoadBalancerPtr loadBalancer () const
void loadBalancer (TGridClientLoadBalancerPtr balancer)
std::vector
< GridClientSocketAddress > 
servers () const
void servers (const std::vector< GridClientSocketAddress > &servers)
GridClientProtocolConfiguration protocolConfiguration () const
void protocolConfiguration (const GridClientProtocolConfiguration &config)
size_t threadPoolSize () const
void threadPoolSize (size_t size)
std::vector
< GridClientSocketAddress > 
routers () const
void routers (const std::vector< GridClientSocketAddress > &routers)
TGridClientRouterBalancerPtr routerBalancer () const
void routerBalancer (TGridClientRouterBalancerPtr routerBalancerPtr)
int64_t maxConnectionIdleTime () const
void maxConnectionIdleTime (int64_t time)
TGridClientTopologyListenerList topologyListeners () const
void topologyListeners (const TGridClientTopologyListenerList &topLsnrs)
std::vector
< GridClientDataConfiguration > 
dataConfiguration () const
void dataConfiguration (const std::vector< GridClientDataConfiguration > &cfgs)

Detailed Description

Client configuration class.


Member Enumeration Documentation

anonymous enum

Default topology refresh frequency in milliseconds.


Constructor & Destructor Documentation

GridClientConfiguration::GridClientConfiguration (  ) 

Default public constructor.

GridClientConfiguration::GridClientConfiguration ( const GridClientConfiguration &  other  ) 

Copy constructor.

Parameters:
other Another instance of GridClientConfiguration.
GridClientConfiguration::~GridClientConfiguration (  )  [virtual]

Destructor.


Member Function Documentation

std::vector<GridClientDataConfiguration> GridClientConfiguration::dataConfiguration (  )  const

Gets the client configuration for caches.

Returns:
Client configuration for caches.
void GridClientConfiguration::dataConfiguration ( const std::vector< GridClientDataConfiguration > &  cfgs  ) 

Sets the client configuration for caches.

Parameters:
cfgs Client configuration for caches.
void GridClientConfiguration::enableTopologyCache ( bool  enable  ) 

Sets a new value for topologyCacheEnabled flag.

bool GridClientConfiguration::isEnableTopologyCache (  )  const

Enables client to cache topology internally, so it does not have to be always refreshed. Topology cache will be automatically refreshed in the background every getTopologyRefreshFrequency() interval.

Returns:
true if topology cache is enabled, false otherwise.
TGridClientLoadBalancerPtr GridClientConfiguration::loadBalancer (  )  const

Default balancer to be used for the compute grid client. It can be overridden for different compute instances.

Returns:
Default balancer to be used for computational client.

Default balancer to be used for computational client. It can be overridden for different compute instances.

Returns:
Default balancer to be used for computational client.
void GridClientConfiguration::loadBalancer ( TGridClientLoadBalancerPtr  balancer  ) 

Sets a new balancer.

void GridClientConfiguration::maxConnectionIdleTime ( int64_t  time  ) 

Sets maximum amount of time that client connection can be idle before it is closed.

Parameters:
time Maximum idle time in milliseconds.
int64_t GridClientConfiguration::maxConnectionIdleTime (  )  const

Gets maximum amount of time that client connection can be idle before it is closed.

Returns:
Maximum idle time in milliseconds.
GridClientConfiguration & GridClientConfiguration::operator= ( const GridClientConfiguration &  rhs  ) 

Assignment operator override.

Parameters:
rhs Right-hand side of the assignment operator.
Returns:
This instance of the class.
void GridClientConfiguration::protocolConfiguration ( const GridClientProtocolConfiguration &  config  ) 

Sets a new value for a protocol configuration.

GridClientProtocolConfiguration GridClientConfiguration::protocolConfiguration (  )  const

Returns configuration parameters used to establish the connection to the remote node.

@ return GridClientProtocolConfiguration - The class defines the main parameters used to establish the connection with the remote node.

void GridClientConfiguration::routerBalancer ( TGridClientRouterBalancerPtr  routerBalancerPtr  ) 

Sets a router balancer implementation for this client configuration.

Parameters:
routerBalancerPtr A router balancer implementation.
TGridClientRouterBalancerPtr GridClientConfiguration::routerBalancer (  )  const

Returns a router balancer implementation for this client configuration.

Returns:
Router balancer instance.
void GridClientConfiguration::routers ( const std::vector< GridClientSocketAddress > &  routers  ) 

Sets a new collection of routers to communicate with.

Parameters:
routers New routers list.
std::vector<GridClientSocketAddress> GridClientConfiguration::routers (  )  const

Collection of GridClientSocketAddress 'host:port' pairs representing routers used to establish initial connection to the grid. This configuration parameter will not be used and direct grid connection will be established if getServers() returns empty value.

Returns:
Collection of GridClientSocketAddress representing remote routers.
std::vector<GridClientSocketAddress> GridClientConfiguration::servers (  )  const

Collection of GridClientSocketAddress 'host:port' pairs representing remote grid servers used to establish initial connection to the grid. Once connection is established, GridGain will get a full view on grid topology and will be able to connect to any available remote node.

Returns:
Collection of GridClientSocketAddress representing remote grid servers.
void GridClientConfiguration::servers ( const std::vector< GridClientSocketAddress > &  servers  ) 

Sets a new collection of servers to communicate with.

void GridClientConfiguration::threadPoolSize ( size_t  size  ) 

Sets the number of threads in the client thread pool, used to perform async operations.

size_t GridClientConfiguration::threadPoolSize (  )  const

Returns a number of threads in the client thread pool, used to perform async operations.

Returns:
Current size of a thread pool.
void GridClientConfiguration::topologyListeners ( const TGridClientTopologyListenerList &  topLsnrs  ) 

Sets initial list of topology listeners, that are added to the client before it starts.

After the client has started, the listener list can be managed with addTopologyListener() and removeToplogyListener() client methods.

Parameters:
topLsnr Toplogy listeners list to add to the client.
TGridClientTopologyListenerList GridClientConfiguration::topologyListeners (  )  const

Gets the initial toplogy listener list for the client.

Returns:
Topology listener list.
long GridClientConfiguration::topologyRefreshFrequency (  )  const

Returns topology refresh frequency.

Returns:
Topology refresh frequency in milliseconds.

Gets topology refresh frequency.

Returns:
Topology refresh frequency in milliseconds.
void GridClientConfiguration::topologyRefreshFrequency ( long  frequency  ) 

Sets a new value for topology refresh frequency in milliseconds.


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