![]() |
Hazelcast C++ Client
Hazelcast C++ Client Library
|
hazelcast_client configuration class. More...
#include <client_config.h>
Public Member Functions | |
client_config () | |
Constructor with default values. More... | |
client_config (const client_config &rhs)=delete | |
client_config & | operator= (const client_config &rhs)=delete |
client_config (client_config &&rhs) | |
client_config & | operator= (client_config &&rhs) |
const std::string & | get_cluster_name () const |
Returns the configured cluster name. More... | |
client_config & | set_cluster_name (const std::string &cluster_name) |
client_config & | set_credentials (const std::shared_ptr< security::credentials > &credential) |
There are two types of credentials you can provide, \username_password_credentials and \token_credentials. More... | |
const std::shared_ptr< security::credentials > & | get_credentials () const |
client_config & | set_redo_operation (bool redo_operation) |
If true, client will redo the operations that were executing on the server and client lost the connection. More... | |
bool | is_redo_operation () const |
see setRedoOperation returns redoOperation | |
client_config & | set_socket_interceptor (socket_interceptor &&interceptor) |
Will be called with the Socket, each time client creates a connection to any Member. More... | |
const socket_interceptor & | get_socket_interceptor () const |
Will be called with the Socket, each time client creates a connection to any Member. | |
client_config & | add_listener (lifecycle_listener &&listener) |
Adds a listener to configuration to be registered when hazelcast_client starts. More... | |
const std::vector< lifecycle_listener > & | get_lifecycle_listeners () const |
client_config & | add_listener (membership_listener &&listener) |
Adds a listener to configuration to be registered when hazelcast_client starts. More... | |
const std::vector< membership_listener > & | get_membership_listeners () const |
Returns registered membershipListeners. More... | |
load_balancer & | get_load_balancer () |
Used to distribute the operations to multiple Endpoints. More... | |
client_config & | set_load_balancer (load_balancer &&load_balancer) |
Used to distribute the operations to multiple connections. More... | |
serialization_config & | get_serialization_config () |
client_config & | set_serialization_config (serialization_config const &serialization_config) |
SerializationConfig is used to. More... | |
const std::unordered_map< std::string, std::string > & | get_properties () const |
Gets a reference to properties map. More... | |
client_config & | set_property (const std::string &name, const std::string &value) |
Sets the value of a named property. More... | |
client_config & | add_reliable_topic_config (const config::reliable_topic_config &reliable_topic_config) |
Adds a ClientReliableTopicConfig. More... | |
const config::reliable_topic_config & | get_reliable_topic_config (const std::string &name) |
Gets the ClientReliableTopicConfig for a given reliable topic name. More... | |
client_config & | add_near_cache_config (const config::near_cache_config &near_cache_config) |
Helper method to add a new NearCacheConfig. More... | |
const config::near_cache_config * | get_near_cache_config (const std::string &name) const |
Gets the NearCacheConfig configured for the map / cache with name. More... | |
config::client_network_config & | get_network_config () |
Gets {}. More... | |
client_config & | set_network_config (const config::client_network_config &network_config) |
Sets {}. More... | |
const boost::optional< std::string > & | get_instance_name () const |
client_config & | set_instance_name (const std::string &instance_name) |
int32_t | get_executor_pool_size () const |
Pool size for internal ExecutorService which handles responses etc. More... | |
void | set_executor_pool_size (int32_t executor_pool_size) |
Sets Client side Executor pool size. More... | |
config::client_connection_strategy_config & | get_connection_strategy_config () |
client_config & | set_connection_strategy_config (const config::client_connection_strategy_config &connection_strategy_config) |
const config::client_flake_id_generator_config * | find_flake_id_generator_config (const std::string &name) |
Returns a {} configuration for the given flake ID generator name. More... | |
const config::client_flake_id_generator_config * | get_flake_id_generator_config (const std::string &name) |
Returns the {} for the given name, creating one if necessary and adding it to the collection of known configurations. More... | |
client_config & | add_flake_id_generator_config (const config::client_flake_id_generator_config &config) |
Adds a flake ID generator configuration. More... | |
config::logger_config & | get_logger_config () |
const std::unordered_set< std::string > & | get_labels () const |
client_config & | set_labels (const std::unordered_set< std::string > &labels) |
client_config & | add_label (const std::string &label) |
client_config & | backup_acks_enabled (bool enabled) |
This feature reduces number of hops and increase performance for smart clients. More... | |
bool | backup_acks_enabled () |
Note that backup acks to client can be enabled only for smart client. More... | |
Friends | |
class | connection::ClientConnectionManagerImpl |
class | reliable_topic |
hazelcast_client configuration class.
Definition at line 107 of file client_config.h.
hazelcast::client::client_config::client_config | ( | ) |
Constructor with default values.
smart(true) redoOperation(false) connectionAttemptLimit(2) attemptPeriod(3000) defaultLoadBalancer: round robin load balancer
Definition at line 1060 of file config.cpp.
client_config & hazelcast::client::client_config::add_flake_id_generator_config | ( | const config::client_flake_id_generator_config & | config | ) |
Adds a flake ID generator configuration.
The configuration is saved under the config name, which may be a pattern with which the configuration will be obtained in the future.
config | the flake ID configuration |
Definition at line 1335 of file config.cpp.
client_config & hazelcast::client::client_config::add_listener | ( | lifecycle_listener && | listener | ) |
Adds a listener to configuration to be registered when hazelcast_client starts.
Warning 1: If listener should do a time consuming operation, off-load the operation to another thread. otherwise it will slow down the system.
Warning 2: Do not make a call to hazelcast. It can cause deadlock.
listener | lifecycle_listener |
Definition at line 1116 of file config.cpp.
client_config & hazelcast::client::client_config::add_listener | ( | membership_listener && | listener | ) |
Adds a listener to configuration to be registered when hazelcast_client starts.
Warning 1: If listener should do a time consuming operation, off-load the operation to another thread. otherwise it will slow down the system.
Warning 2: Do not make a call to hazelcast. It can cause deadlock.
listener | MembershipListener |
Definition at line 1123 of file config.cpp.
client_config & hazelcast::client::client_config::add_near_cache_config | ( | const config::near_cache_config & | near_cache_config | ) |
Helper method to add a new NearCacheConfig.
nearCacheConfig | NearCacheConfig to be added |
Memory ownership of the config is passed to the client config
Definition at line 1221 of file config.cpp.
client_config & hazelcast::client::client_config::add_reliable_topic_config | ( | const config::reliable_topic_config & | reliable_topic_config | ) |
Adds a ClientReliableTopicConfig.
reliableTopicConfig | the ReliableTopicConfig to add |
Definition at line 1182 of file config.cpp.
bool hazelcast::client::client_config::backup_acks_enabled | ( | ) |
Note that backup acks to client can be enabled only for smart client.
This config has no effect for unisocket clients.
Definition at line 1383 of file config.cpp.
client_config & hazelcast::client::client_config::backup_acks_enabled | ( | bool | enabled | ) |
This feature reduces number of hops and increase performance for smart clients.
It is enabled by default for smart clients. This config has no effect for unisocket clients.
enabled | enables client to get backup acknowledgements directly from the member that backups are applied |
Definition at line 1376 of file config.cpp.
const config::client_flake_id_generator_config * hazelcast::client::client_config::find_flake_id_generator_config | ( | const std::string & | name | ) |
Returns a {} configuration for the given flake ID generator name.
The name is matched by pattern to the configuration and by stripping the partition ID qualifier from the given
. If there is no config found by the name, it will return the configuration with the name
.
name | name of the flake ID generator config |
ConfigurationException | if ambiguous configurations are found |
Definition at line 1296 of file config.cpp.
const std::string & hazelcast::client::client_config::get_cluster_name | ( | ) | const |
Returns the configured cluster name.
The name is sent as part of client authentication message and may be verified on the member.
Definition at line 1343 of file config.cpp.
int32_t hazelcast::client::client_config::get_executor_pool_size | ( | ) | const |
Pool size for internal ExecutorService which handles responses etc.
Definition at line 1270 of file config.cpp.
const config::client_flake_id_generator_config * hazelcast::client::client_config::get_flake_id_generator_config | ( | const std::string & | name | ) |
Returns the {} for the given name, creating one if necessary and adding it to the collection of known configurations.
The configuration is found by matching the the configuration name pattern to the provided
without the partition qualifier (the part of the name after
). If no configuration matches, it will create one by cloning the
configuration and add it to the configuration collection.
This method is intended to easily and fluently create and add configurations more specific than the default configuration without explicitly adding it by invoking {}. Because it adds new configurations if they are not already present, this method is intended to be used before this config is used to create a hazelcast instance. Afterwards, newly added configurations may be ignored.
name | name of the flake ID generator config |
ConfigurationException | if ambiguous configurations are found |
Definition at line 1311 of file config.cpp.
const std::vector< lifecycle_listener > & hazelcast::client::client_config::get_lifecycle_listeners | ( | ) | const |
Definition at line 1130 of file config.cpp.
load_balancer & hazelcast::client::client_config::get_load_balancer | ( | ) |
Used to distribute the operations to multiple Endpoints.
Definition at line 1086 of file config.cpp.
config::logger_config & hazelcast::client::client_config::get_logger_config | ( | ) |
Definition at line 1110 of file config.cpp.
const std::vector< membership_listener > & hazelcast::client::client_config::get_membership_listeners | ( | ) | const |
Returns registered membershipListeners.
Definition at line 1136 of file config.cpp.
const config::near_cache_config * hazelcast::client::client_config::get_near_cache_config | ( | const std::string & | name | ) | const |
Gets the NearCacheConfig configured for the map / cache with name.
name | name of the map / cache |
Definition at line 1230 of file config.cpp.
config::client_network_config & hazelcast::client::client_config::get_network_config | ( | ) |
Gets {}.
Definition at line 1215 of file config.cpp.
const std::unordered_map< std::string, std::string > & hazelcast::client::client_config::get_properties | ( | ) | const |
Gets a reference to properties map.
Definition at line 1169 of file config.cpp.
const config::reliable_topic_config & hazelcast::client::client_config::get_reliable_topic_config | ( | const std::string & | name | ) |
Gets the ClientReliableTopicConfig for a given reliable topic name.
name | the name of the reliable topic |
Definition at line 1191 of file config.cpp.
serialization_config & hazelcast::client::client_config::get_serialization_config | ( | ) |
Definition at line 1155 of file config.cpp.
client_config & hazelcast::client::client_config::set_credentials | ( | const std::shared_ptr< security::credentials > & | credential | ) |
There are two types of credentials you can provide, \username_password_credentials and \token_credentials.
Definition at line 1395 of file config.cpp.
void hazelcast::client::client_config::set_executor_pool_size | ( | int32_t | executor_pool_size | ) |
Sets Client side Executor pool size.
executorPoolSize | pool size |
Definition at line 1276 of file config.cpp.
client_config & hazelcast::client::client_config::set_load_balancer | ( | load_balancer && | load_balancer | ) |
Used to distribute the operations to multiple connections.
If not set, round robin based load balancer is used
load_balancer |
Definition at line 1103 of file config.cpp.
client_config & hazelcast::client::client_config::set_network_config | ( | const config::client_network_config & | network_config | ) |
Sets {}.
networkConfig | {} to be set configured client_config for chaining com.hazelcast.client.config.client_network_config |
Definition at line 1249 of file config.cpp.
client_config & hazelcast::client::client_config::set_property | ( | const std::string & | name, |
const std::string & | value | ||
) |
Sets the value of a named property.
name | property name |
value | value of the property |
Definition at line 1175 of file config.cpp.
client_config & hazelcast::client::client_config::set_redo_operation | ( | bool | redo_operation | ) |
If true, client will redo the operations that were executing on the server and client lost the connection.
This can be because of network, or simply because the member died. However it is not clear whether the application is performed or not. For idempotent operations this is harmless, but for non idempotent ones retrying can cause to undesirable effects. Note that the redo can perform on any member.
If false, the operation will throw io_exception.
redoOperation | return itself ClientConfig |
Definition at line 1073 of file config.cpp.
client_config & hazelcast::client::client_config::set_serialization_config | ( | serialization_config const & | serialization_config | ) |
SerializationConfig is used to.
serializationConfig |
Definition at line 1161 of file config.cpp.
client_config & hazelcast::client::client_config::set_socket_interceptor | ( | socket_interceptor && | interceptor | ) |
Will be called with the Socket, each time client creates a connection to any Member.
Definition at line 1142 of file config.cpp.