Hazelcast C++ Client
Public Member Functions | List of all members
hazelcast::client::config::ClientNetworkConfig Class Reference

Contains configuration parameters for client network related behaviour. More...

#include <ClientNetworkConfig.h>

Public Member Functions

 ClientNetworkConfig ()
 Constructor with default values. More...
 
SSLConfiggetSSLConfig ()
 Returns the current SSLConfig. More...
 
ClientNetworkConfigsetSSLConfig (const config::SSLConfig &sslConfig)
 Sets the SSLConfig. More...
 
ClientNetworkConfigsetConnectionTimeout (int64_t connectionTimeoutInMillis)
 
int64_t getConnectionTimeout () const
 Timeout value for nodes to accept client connection requests. More...
 
ClientNetworkConfigsetAwsConfig (const ClientAwsConfig &clientAwsConfig)
 Sets configuration to connect nodes in aws environment. More...
 
ClientAwsConfiggetAwsConfig ()
 Returns the current ClientAwsConfig. More...
 
bool isSmartRouting () const
 See com.hazelcast.client.config.ClientNetworkConfig#setSmartRouting(boolean) for details. More...
 
ClientNetworkConfigsetSmartRouting (bool smartRouting)
 If. More...
 
int32_t getConnectionAttemptLimit () const
 See ClientNetworkConfig#setConnectionAttemptLimit(int32_t) for details. More...
 
ClientNetworkConfigsetConnectionAttemptLimit (int32_t connectionAttemptLimit)
 While client is trying to connect initially to one of the members in the ClientNetworkConfig#addressList, all might be not available. More...
 
int32_t getConnectionAttemptPeriod () const
 Period for the next attempt to find a member to connect. More...
 
ClientNetworkConfigsetConnectionAttemptPeriod (int32_t connectionAttemptPeriod)
 Period for the next attempt to find a member to connect. More...
 
std::vector< AddressgetAddresses () const
 Returns the list of candidate addresses that client will use to establish initial connection. More...
 
ClientNetworkConfigaddAddresses (const std::vector< Address > &addresses)
 Adds given addresses to candidate address list that client will use to establish initial connection. More...
 
ClientNetworkConfigsetAddresses (const std::vector< Address > &addresses)
 Adds given addresses to candidate address list that client will use to establish initial connection. More...
 
ClientNetworkConfigaddAddress (const Address &address)
 Adds given address to candidate address list that client will use to establish initial connection. More...
 

Detailed Description

Contains configuration parameters for client network related behaviour.

Constructor & Destructor Documentation

◆ ClientNetworkConfig()

hazelcast::client::config::ClientNetworkConfig::ClientNetworkConfig ( )

Constructor with default values.

connectionTimeout(5000)

Member Function Documentation

◆ addAddress()

ClientNetworkConfig & hazelcast::client::config::ClientNetworkConfig::addAddress ( const Address address)

Adds given address to candidate address list that client will use to establish initial connection.

Parameters
addressto be added to initial address list
Returns
configured ClientNetworkConfig for chaining

◆ addAddresses()

ClientNetworkConfig & hazelcast::client::config::ClientNetworkConfig::addAddresses ( const std::vector< Address > &  addresses)

Adds given addresses to candidate address list that client will use to establish initial connection.

Parameters
addressesto be added to initial address list
Returns
configured com.hazelcast.client.config.ClientNetworkConfig for chaining

◆ getAddresses()

std::vector< Address > hazelcast::client::config::ClientNetworkConfig::getAddresses ( ) const

Returns the list of candidate addresses that client will use to establish initial connection.

Returns
list of addresses

◆ getAwsConfig()

ClientAwsConfig & hazelcast::client::config::ClientNetworkConfig::getAwsConfig ( )

Returns the current ClientAwsConfig.

Returns
ClientAwsConfig

◆ getConnectionAttemptLimit()

int32_t hazelcast::client::config::ClientNetworkConfig::getConnectionAttemptLimit ( ) const

See ClientNetworkConfig#setConnectionAttemptLimit(int32_t) for details.

Returns
connection attempt Limit

◆ getConnectionAttemptPeriod()

int32_t hazelcast::client::config::ClientNetworkConfig::getConnectionAttemptPeriod ( ) const

Period for the next attempt to find a member to connect.

See ClientNetworkConfig#connectionAttemptLimit.

Returns
connection attempt period in millis

◆ getConnectionTimeout()

int64_t hazelcast::client::config::ClientNetworkConfig::getConnectionTimeout ( ) const

Timeout value for nodes to accept client connection requests.

Returns
int connectionTimeout in millis

◆ getSSLConfig()

SSLConfig & hazelcast::client::config::ClientNetworkConfig::getSSLConfig ( )

Returns the current SSLConfig.

Returns
the SSLConfig.
See also
#setSSLConfig(SSLConfig)

◆ isSmartRouting()

bool hazelcast::client::config::ClientNetworkConfig::isSmartRouting ( ) const

See com.hazelcast.client.config.ClientNetworkConfig#setSmartRouting(boolean) for details.

Returns
true if client is smart

◆ setAddresses()

ClientNetworkConfig & hazelcast::client::config::ClientNetworkConfig::setAddresses ( const std::vector< Address > &  addresses)

Adds given addresses to candidate address list that client will use to establish initial connection.

Parameters
addressesto be added to initial address list
Returns
configured ClientNetworkConfig for chaining

◆ setAwsConfig()

ClientNetworkConfig & hazelcast::client::config::ClientNetworkConfig::setAwsConfig ( const ClientAwsConfig clientAwsConfig)

Sets configuration to connect nodes in aws environment.

Parameters
clientAwsConfigthe ClientAwsConfig
See also
getAwsConfig()

◆ setConnectionAttemptLimit()

ClientNetworkConfig & hazelcast::client::config::ClientNetworkConfig::setConnectionAttemptLimit ( int32_t  connectionAttemptLimit)

While client is trying to connect initially to one of the members in the ClientNetworkConfig#addressList, all might be not available.

Instead of giving up, throwing Exception and stopping client, it will attempt to retry as much as ClientNetworkConfig#connectionAttemptLimit times.

Parameters
connectionAttemptLimitnumber of times to attempt to connect A zero value means try forever. A negative value means default value
Returns
configured ClientNetworkConfig for chaining

◆ setConnectionAttemptPeriod()

ClientNetworkConfig & hazelcast::client::config::ClientNetworkConfig::setConnectionAttemptPeriod ( int32_t  connectionAttemptPeriod)

Period for the next attempt to find a member to connect.

Parameters
connectionAttemptPeriodtime to wait before another attempt in millis
Returns
configured ClientNetworkConfig for chaining

◆ setConnectionTimeout()

ClientNetworkConfig & hazelcast::client::config::ClientNetworkConfig::setConnectionTimeout ( int64_t  connectionTimeoutInMillis)
Parameters
connectionTimeoutTimeout value in millis for nodes to accept client connection requests. A zero value means wait until connection established or an error occurs.
Returns
itself ClientNetworkConfig

◆ setSmartRouting()

ClientNetworkConfig & hazelcast::client::config::ClientNetworkConfig::setSmartRouting ( bool  smartRouting)

If.

true

, client will route the key based operations to owner of the key on best-effort basis. Note that it uses a cached version of com.hazelcast.core.PartitionService#getPartitions() and doesn't guarantee that the operation will always be executed on the owner. The cached table is updated every 10 seconds.

If

smartRouting == false

, all operations will be routed to single member. Operations will need two hops if the chosen member is not owner of the key. Client will have only single open connection. Useful, if there are many clients and we want to avoid each of them connecting to each member.

Default value is

true

.

Parameters
smartRoutingtrue if smart routing should be enabled.
Returns
configured com.hazelcast.client.config.ClientNetworkConfig for chaining

◆ setSSLConfig()

ClientNetworkConfig & hazelcast::client::config::ClientNetworkConfig::setSSLConfig ( const config::SSLConfig sslConfig)

Sets the SSLConfig.

Parameters
sslConfigthe SSLConfig.
Returns
the updated ClientNetworkConfig.
See also
getSSLConfig()

The documentation for this class was generated from the following files: