Apache Ignite C++ Client
Loading...
Searching...
No Matches
ignite::ignite_client_configuration Class Reference

#include <ignite_client_configuration.h>

Public Member Functions

 ignite_client_configuration (std::initializer_list< std::string_view > endpoints)
 ignite_client_configuration (std::vector< std::string > endpoints)
const std::vector< std::string > & get_endpoints () const
void set_endpoints (std::initializer_list< std::string_view > endpoints)
void set_endpoints (std::vector< std::string > endpoints)
const std::shared_ptr< ignite_logger > & get_logger () const
void set_logger (std::shared_ptr< ignite_logger > logger)
std::uint32_t get_connection_limit () const
void set_connection_limit (std::uint32_t limit)
std::chrono::microseconds get_heartbeat_interval () const
void set_heartbeat_interval (std::chrono::microseconds heartbeat_interval)
std::shared_ptr< ignite_client_authenticatorget_authenticator () const
void set_authenticator (std::shared_ptr< ignite_client_authenticator > authenticator)
ssl_mode get_ssl_mode () const
void set_ssl_mode (ssl_mode ssl_mode)
const std::string & get_ssl_cert_file () const
void set_ssl_cert_file (const std::string &ssl_cert_file)
const std::string & get_ssl_key_file () const
void set_ssl_key_file (const std::string &ssl_key_file)
const std::string & get_ssl_ca_file () const
void set_ssl_ca_file (const std::string &ssl_ca_file)

Static Public Attributes

static constexpr std::uint16_t DEFAULT_PORT = 10800
static constexpr std::chrono::microseconds DEFAULT_HEARTBEAT_INTERVAL = std::chrono::seconds(30)

Detailed Description

Ignite client configuration.

Constructor & Destructor Documentation

◆ ignite_client_configuration() [1/2]

ignite::ignite_client_configuration::ignite_client_configuration ( std::initializer_list< std::string_view > endpoints)
inline

Constructor.

Parameters
endpointsEndpoints list.

◆ ignite_client_configuration() [2/2]

ignite::ignite_client_configuration::ignite_client_configuration ( std::vector< std::string > endpoints)
inline

Constructor.

Parameters
endpointsEndpoints list.

Member Function Documentation

◆ get_authenticator()

std::shared_ptr< ignite_client_authenticator > ignite::ignite_client_configuration::get_authenticator ( ) const
inlinenodiscard

Gets the authenticator.

See also
Also see basic_authenticator.
Returns
Authenticator

◆ get_connection_limit()

std::uint32_t ignite::ignite_client_configuration::get_connection_limit ( ) const
inlinenodiscard

Get connection limit.

By default, C++ client establishes a connection to every server node listed in end_points. Use this setting to limit the number of active connections. This reduces initial connection time and the resource usage, but can have a negative effect on cache operation performance.

Zero value means that the number of active connections is not limited.

The default value is zero.

Returns
Active connection limit.

◆ get_endpoints()

const std::vector< std::string > & ignite::ignite_client_configuration::get_endpoints ( ) const
inlinenodiscard

Get endpoints.

See also
set_endpoints() for more detailed description.
Returns
Endpoints.

◆ get_heartbeat_interval()

std::chrono::microseconds ignite::ignite_client_configuration::get_heartbeat_interval ( ) const
inlinenodiscard

Get a heartbeat interval. When server-side idle timeout is not zero, the effective heartbeat interval is set to min(heartbeat_interval, idle_timeout / 3)

When thin client connection is idle (no operations are performed), heartbeat messages are sent periodically to keep the connection alive and detect potential half-open state.

Zero value means heartbeats are disabled.

The default value is DEFAULT_HEARTBEAT_INTERVAL.

Returns
Heartbeat interval.

◆ get_logger()

const std::shared_ptr< ignite_logger > & ignite::ignite_client_configuration::get_logger ( ) const
inlinenodiscard

Get logger.

Returns
Current logger.

◆ get_ssl_ca_file()

const std::string & ignite::ignite_client_configuration::get_ssl_ca_file ( ) const
inlinenodiscard

Get a file path to SSL certificate authority to authenticate server certificate during a connection establishment.

Returns
File path to SSL certificate authority.

◆ get_ssl_cert_file()

const std::string & ignite::ignite_client_configuration::get_ssl_cert_file ( ) const
inlinenodiscard

Get a file path to SSL certificate to use during a connection establishment.

Returns
File path to SSL certificate.

◆ get_ssl_key_file()

const std::string & ignite::ignite_client_configuration::get_ssl_key_file ( ) const
inlinenodiscard

Get a file path to the SSL private key to use during a connection establishment.

Returns
File path to the SSL private key.

◆ get_ssl_mode()

ssl_mode ignite::ignite_client_configuration::get_ssl_mode ( ) const
inlinenodiscard

Get SSL mode.

See also
ssl_mode for details.
Returns
SSL mode.

◆ set_authenticator()

void ignite::ignite_client_configuration::set_authenticator ( std::shared_ptr< ignite_client_authenticator > authenticator)
inline

Sets the authenticator.

Parameters
authenticatorAuthenticator. Do not use authentication if authenticator is nullptr.

◆ set_connection_limit()

void ignite::ignite_client_configuration::set_connection_limit ( std::uint32_t limit)
inline

Set the connection limit.

See also
get_connections_limit for details.
Parameters
limitConnections limit to set.

◆ set_endpoints() [1/2]

void ignite::ignite_client_configuration::set_endpoints ( std::initializer_list< std::string_view > endpoints)
inline

Set endpoints.

Examples of supported formats:

  • 192.168.1.25 - Default port is used, see DEFAULT_PORT;
  • 192.168.1.25:780 - Custom port;
  • my-host.com - Default port is used, see DEFAULT_PORT;
  • my-host.com:780 - Custom port;

Default is "localhost"

Parameters
endpointsEndpoints.

◆ set_endpoints() [2/2]

void ignite::ignite_client_configuration::set_endpoints ( std::vector< std::string > endpoints)
inline

Set endpoints.

Examples of supported formats:

  • 192.168.1.25 - Default port is used, see DEFAULT_PORT;
  • 192.168.1.25:780 - Custom port;
  • my-host.com - Default port is used, see DEFAULT_PORT;
  • my-host.com:780 - Custom port;

Default is "localhost"

Parameters
endpointsEndpoints.

◆ set_heartbeat_interval()

void ignite::ignite_client_configuration::set_heartbeat_interval ( std::chrono::microseconds heartbeat_interval)
inline

Set a heartbeat interval.

See also
get_heartbeat_interval for details.
Parameters
heartbeat_intervalHeartbeat interval.

◆ set_logger()

void ignite::ignite_client_configuration::set_logger ( std::shared_ptr< ignite_logger > logger)
inline

Set logger to be used by client.

The logger is nullptr by default, which means no logging is performed.

Parameters
loggerLogger to use.

◆ set_ssl_ca_file()

void ignite::ignite_client_configuration::set_ssl_ca_file ( const std::string & ssl_ca_file)
inline

Set file path to SSL certificate authority to authenticate server certificate during a connection establishment.

Parameters
ssl_ca_fileFile path to SSL certificate authority.

◆ set_ssl_cert_file()

void ignite::ignite_client_configuration::set_ssl_cert_file ( const std::string & ssl_cert_file)
inline

Set file path to SSL certificate to use during a connection establishment.

Parameters
ssl_cert_fileFile path to SSL certificate.

◆ set_ssl_key_file()

void ignite::ignite_client_configuration::set_ssl_key_file ( const std::string & ssl_key_file)
inline

Set file path to the SSL private key to use during a connection establishment.

Parameters
ssl_key_fileFile path to the SSL private key.

◆ set_ssl_mode()

void ignite::ignite_client_configuration::set_ssl_mode ( ssl_mode ssl_mode)
inline

Set SSL mode.

See also
ssl_mode for details.
Parameters
ssl_modeSSL mode.

Member Data Documentation

◆ DEFAULT_HEARTBEAT_INTERVAL

std::chrono::microseconds ignite::ignite_client_configuration::DEFAULT_HEARTBEAT_INTERVAL = std::chrono::seconds(30)
staticconstexpr

Default heartbeat interval.

◆ DEFAULT_PORT

std::uint16_t ignite::ignite_client_configuration::DEFAULT_PORT = 10800
staticconstexpr

TCP port used by client by default if not specified explicitly.


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