34 #include "hazelcast/client/client_config.h" 
   35 #include "hazelcast/client/serialization_config.h" 
   36 #include "hazelcast/client/config/ssl_config.h" 
   37 #include "hazelcast/util/Preconditions.h" 
   38 #include "hazelcast/client/config/client_flake_id_generator_config.h" 
   39 #include "hazelcast/client/exception/protocol_exceptions.h" 
   40 #include "hazelcast/client/internal/partition/strategy/StringPartitioningStrategy.h" 
   41 #include "hazelcast/client/address.h" 
   42 #include "hazelcast/client/config/client_network_config.h" 
   43 #include "hazelcast/client/config/client_aws_config.h" 
   44 #include "hazelcast/client/config/reliable_topic_config.h" 
   45 #include "hazelcast/client/config/client_connection_strategy_config.h" 
   46 #include "hazelcast/client/config/logger_config.h" 
   47 #include "hazelcast/client/config/index_config.h" 
   48 #include "hazelcast/client/config/matcher/matching_point_config_pattern_matcher.h" 
   49 #include "hazelcast/client/query/predicates.h" 
   50 #include "hazelcast/client/lifecycle_listener.h" 
   51 #include "hazelcast/client/config/eviction_strategy_type.h" 
   52 #include "hazelcast/client/cluster.h" 
   53 #include "hazelcast/client/initial_membership_event.h" 
   69         std::shared_ptr<serialization::global_serializer> serialization_config::get_global_serializer()
 const {
 
   70             return global_serializer_;
 
   74                 const std::shared_ptr<serialization::global_serializer> &global_serializer) {
 
   75             global_serializer_ = global_serializer;
 
   80             byte_order_ = byte_order;
 
   89             ssl_config::ssl_config()
 
   90 #ifdef HZ_BUILD_WITH_SSL 
   91             : enabled_(
false), ssl_protocol_(tlsv12)
 
   95 #ifdef HZ_BUILD_WITH_SSL 
   96             ssl_config &ssl_config::set_context(boost::asio::ssl::context ctx) {
 
   97                 util::Preconditions::check_ssl(
"ssl_config::set_context");
 
   99                     throw exception::illegal_argument(
 
  100                             "You should either use the deprecated methods or this method to enable ssl. You already used the deprecated way.");
 
  102                 ssl_context_ = std::make_shared<boost::asio::ssl::context>(std::move(ctx));
 
  106             bool ssl_config::is_enabled()
 const {
 
  107                 return ssl_context_ || enabled_;
 
  110             ssl_config &ssl_config::set_enabled(
bool is_enabled) {
 
  111                 util::Preconditions::check_ssl(
"ssl_config::set_enabled");
 
  112                 check_context_enabled_already();
 
  113                 this->enabled_ = is_enabled;
 
  117             void ssl_config::check_context_enabled_already()
 const {
 
  119                     throw exception::illegal_argument(
"You should either use set_context or this method.");
 
  123             ssl_config &ssl_config::set_protocol(ssl_protocol protocol) {
 
  124                 check_context_enabled_already();
 
  125                 this->ssl_protocol_ = protocol;
 
  129             ssl_protocol ssl_config::get_protocol()
 const {
 
  130                 check_context_enabled_already();
 
  131                 return ssl_protocol_;
 
  134             const std::vector<std::string> &ssl_config::get_verify_files()
 const {
 
  135                 check_context_enabled_already();
 
  136                 return client_verify_files_;
 
  139             ssl_config &ssl_config::add_verify_file(
const std::string &filename) {
 
  140                 check_context_enabled_already();
 
  141                 this->client_verify_files_.push_back(filename);
 
  145             const std::string &ssl_config::get_cipher_list()
 const {
 
  149             ssl_config &ssl_config::set_cipher_list(
const std::string &ciphers) {
 
  150                 this->cipher_list_ = ciphers;
 
  157             client_flake_id_generator_config::client_flake_id_generator_config(
const std::string &name)
 
  158                     : name_(name), prefetch_count_(client_flake_id_generator_config::DEFAULT_PREFETCH_COUNT),
 
  159                       prefetch_validity_duration_(client_flake_id_generator_config::DEFAULT_PREFETCH_VALIDITY_MILLIS) {}
 
  161             const std::string &client_flake_id_generator_config::get_name()
 const {
 
  166                 client_flake_id_generator_config::name_ = n;
 
  170             int32_t client_flake_id_generator_config::get_prefetch_count()
 const {
 
  171                 return prefetch_count_;
 
  175                 std::ostringstream out;
 
  176                 out << 
"prefetch-count must be 1.." << MAXIMUM_PREFETCH_COUNT << 
", not " << count;
 
  177                 util::Preconditions::check_true(count > 0 && count <= MAXIMUM_PREFETCH_COUNT, out.str());
 
  178                 prefetch_count_ = count;
 
  182             std::chrono::milliseconds client_flake_id_generator_config::get_prefetch_validity_duration()
 const {
 
  183                 return prefetch_validity_duration_;
 
  187             client_flake_id_generator_config::set_prefetch_validity_duration(std::chrono::milliseconds duration) {
 
  188                 util::Preconditions::check_not_negative(duration.count(),
 
  189                                                         "duration must be nonnegative");
 
  190                 prefetch_validity_duration_ = duration;
 
  194             constexpr std::chrono::milliseconds connection_retry_config::INITIAL_BACKOFF;
 
  195             constexpr std::chrono::milliseconds connection_retry_config::MAX_BACKOFF;
 
  196             constexpr std::chrono::milliseconds connection_retry_config::CLUSTER_CONNECT_TIMEOUT;
 
  197             constexpr 
double connection_retry_config::JITTER;
 
  199             std::chrono::milliseconds connection_retry_config::get_initial_backoff_duration()
 const {
 
  200                 return initial_backoff_duration_;
 
  204             connection_retry_config::set_initial_backoff_duration(std::chrono::milliseconds initial_backoff_duration) {
 
  205                 util::Preconditions::check_not_negative(initial_backoff_duration.count(),
 
  206                                                         "Initial backoff must be non-negative!");
 
  207                 initial_backoff_duration_ = initial_backoff_duration;
 
  211             std::chrono::milliseconds connection_retry_config::get_max_backoff_duration()
 const {
 
  212                 return max_backoff_duration_;
 
  216             connection_retry_config::set_max_backoff_duration(std::chrono::milliseconds max_backoff_duration) {
 
  217                 util::Preconditions::check_not_negative(max_backoff_duration.count(),
 
  218                                                         "Max backoff must be non-negative!");
 
  219                 max_backoff_duration_ = max_backoff_duration;
 
  223             double connection_retry_config::get_multiplier()
 const {
 
  228                 util::Preconditions::check_true(m >= 1.0, 
"Multiplier must be greater than or equal to 1.0!");
 
  233             std::chrono::milliseconds connection_retry_config::get_cluster_connect_timeout()
 const {
 
  234                 return cluster_connect_timeout_;
 
  238                     std::chrono::milliseconds cluster_connect_timeout) {
 
  239                 util::Preconditions::check_not_negative(cluster_connect_timeout.count(),
 
  240                                                         "Cluster connect timeout must be non-negative!");
 
  241                 cluster_connect_timeout_ = cluster_connect_timeout;
 
  245             double connection_retry_config::get_jitter()
 const {
 
  250                 util::Preconditions::check_true(jitter >= 0.0 && jitter <= 1.0, 
"Jitter must be in range [0.0, 1.0]");
 
  255             client_network_config::client_network_config()
 
  256                     : connection_timeout_(5000), smart_routing_(true) {}
 
  263                 ssl_config_ = config;
 
  268                 return connection_timeout_;
 
  277                 return client_aws_config_;
 
  281                 return cloud_config_;
 
  285                 return smart_routing_;
 
  289                 client_network_config::smart_routing_ = smart_routing;
 
  294                 return address_list_;
 
  298                 address_list_.insert(address_list_.end(), addresses.begin(), addresses.end());
 
  303                 address_list_ = addresses;
 
  308                 address_list_.push_back(
address);
 
  313                 return socket_options_;
 
  317                 connection_timeout_ = timeout;
 
  321             client_connection_strategy_config::client_connection_strategy_config() : async_start_(false), reconnect_mode_(ON) {
 
  325                 return reconnect_mode_;
 
  333                 this->async_start_ = async_start;
 
  344                 return retry_config_;
 
  349                 retry_config_ = std::move(retry_config);
 
  353             constexpr 
int reliable_topic_config::DEFAULT_READ_BATCH_SIZE;
 
  355             reliable_topic_config::reliable_topic_config() = 
default;
 
  357             reliable_topic_config::reliable_topic_config(std::string topic_name) : read_batch_size_(DEFAULT_READ_BATCH_SIZE),
 
  359                                                                                    name_(std::move(topic_name)) {
 
  367                 return read_batch_size_;
 
  371                 if (batch_size <= 0) {
 
  372                     BOOST_THROW_EXCEPTION(exception::illegal_argument(
"ReliableTopicConfig::setReadBatchSize",
 
  373                                                                               "readBatchSize should be positive"));
 
  376                 this->read_batch_size_ = batch_size;
 
  381             socket_options::socket_options() : tcp_no_delay_(true), keep_alive_(true), reuse_address_(true), linger_seconds_(3),
 
  382                                                buffer_size_(DEFAULT_BUFFER_SIZE_BYTE) {}
 
  385                 return tcp_no_delay_;
 
  389                 socket_options::tcp_no_delay_ = tcp_no_delay;
 
  398                 socket_options::keep_alive_ = keep_alive;
 
  403                 return reuse_address_;
 
  407                 socket_options::reuse_address_ = reuse_address;
 
  412                 return linger_seconds_;
 
  416                 socket_options::linger_seconds_ = linger_seconds;
 
  425                 socket_options::buffer_size_ = buffer_size;
 
  429             client_aws_config::client_aws_config() : enabled_(false), region_(
"us-east-1"), host_header_(
"ec2.amazonaws.com"),
 
  438                 this->access_key_ = util::Preconditions::check_has_text(access_key, 
"accessKey must contain text");
 
  447                 this->secret_key_ = util::Preconditions::check_has_text(secret_key, 
"secretKey must contain text");
 
  456                 this->region_ = util::Preconditions::check_has_text(region, 
"region must contain text");
 
  465                 this->host_header_ = util::Preconditions::check_has_text(host_header, 
"hostHeader must contain text");
 
  470                 util::Preconditions::check_ssl(
"get_aws_config");
 
  471                 this->enabled_ = enabled;
 
  480                 this->security_group_name_ = security_group_name;
 
  485                 return security_group_name_;
 
  489                 this->tag_key_ = tag_key;
 
  498                 this->tag_value_ = tag_value;
 
  511                 this->iam_role_ = iam_role;
 
  520                 this->inside_aws_ = inside_aws;
 
  525                 return out << 
"client_aws_config{" 
  527                            << 
", region='" << config.
get_region() << 
'\'' 
  536                 std::shared_ptr<std::string>
 
  538                                                                const std::string &item_name)
 const {
 
  539                     std::shared_ptr<std::string> candidate;
 
  540                     std::shared_ptr<std::string> duplicate;
 
  541                     int lastMatchingPoint = -1;
 
  542                     for (
const std::string &pattern  : config_patterns) {
 
  543                         int matchingPoint = get_matching_point(pattern, item_name);
 
  544                         if (matchingPoint > -1 && matchingPoint >= lastMatchingPoint) {
 
  545                             if (matchingPoint == lastMatchingPoint) {
 
  546                                 duplicate = candidate;
 
  550                             lastMatchingPoint = matchingPoint;
 
  551                             candidate.reset(
new std::string(pattern));
 
  554                     if (duplicate.get() != NULL) {
 
  556                                 "MatchingPointConfigPatternMatcher::matches") << 
"Configuration " << item_name
 
  557                                                                               << 
" has duplicate configuration. Candidate:" 
  558                                                                               << *candidate << 
", duplicate:" 
  559                                                                               << *duplicate).build();
 
  564                 int matching_point_config_pattern_matcher::get_matching_point(
const std::string &pattern,
 
  565                                                                               const std::string &item_name)
 const {
 
  566                     size_t index = pattern.find(
'*');
 
  567                     if (index == std::string::npos) {
 
  571                     std::string firstPart = pattern.substr(0, index);
 
  572                     if (item_name.find(firstPart) != 0) {
 
  576                     std::string secondPart = pattern.substr(index + 1);
 
  577                     if (item_name.rfind(secondPart) != (item_name.length() - secondPart.length())) {
 
  581                     return (
int) (firstPart.length() + secondPart.length());
 
  589                                                                          transformation(DEFAULT_TRANSFORMATION) {}
 
  593             index_config::index_config() : 
type(DEFAULT_TYPE) {}
 
  597             void index_config::add_attributes() {}
 
  599             eviction_config::eviction_config() : size_(DEFAULT_MAX_ENTRY_COUNT), max_size_policy_(DEFAULT_MAX_SIZE_POLICY),
 
  600                                                  eviction_policy_(DEFAULT_EVICTION_POLICY) {}
 
  602             int32_t eviction_config::get_size()
 const {
 
  606             eviction_config &eviction_config::set_size(int32_t size) {
 
  607                 this->size_ = util::Preconditions::check_positive(size, 
"Size must be positive number!");
 
  612                 return max_size_policy_;
 
  620             eviction_policy eviction_config::get_eviction_policy()
 const {
 
  621                 return eviction_policy_;
 
  624             eviction_config &eviction_config::set_eviction_policy(eviction_policy policy) {
 
  625                 this->eviction_policy_ = policy;
 
  629             eviction_strategy_type eviction_config::get_eviction_strategy_type()
 const {
 
  631                 return eviction_strategy_type::DEFAULT_EVICTION_STRATEGY;
 
  634             std::ostream &operator<<(std::ostream &out, 
const eviction_config &config) {
 
  635                 out << 
"EvictionConfig{" 
  636                     << 
"size=" << config.get_size()
 
  637                     << 
", maxSizePolicy=" << config.get_maximum_size_policy()
 
  638                     << 
", evictionPolicy=" << config.get_eviction_policy()
 
  644             near_cache_config::near_cache_config() : name_(
"default"), time_to_live_seconds_(DEFAULT_TTL_SECONDS),
 
  645                                                  max_idle_seconds_(DEFAULT_MAX_IDLE_SECONDS),
 
  646                                                  in_memory_format_(DEFAULT_MEMORY_FORMAT),
 
  647                                                  local_update_policy_(INVALIDATE), invalidate_on_change_(true),
 
  648                                                  cache_local_entries_(false) {
 
  651             near_cache_config::near_cache_config(
const std::string &cache_name) : near_cache_config() {
 
  655             near_cache_config::near_cache_config(
const std::string &cache_name, in_memory_format memory_format)
 
  656                     : near_cache_config(name_) {
 
  657                 this->in_memory_format_ = memory_format;
 
  660             near_cache_config::near_cache_config(int32_t time_to_live_seconds, int32_t max_idle_seconds, 
bool invalidate_on_change,
 
  661                                              in_memory_format in_memory_format, 
const eviction_config &evict_config)
 
  662                     : near_cache_config(name_, in_memory_format) {
 
  663                 this->time_to_live_seconds_ = time_to_live_seconds;
 
  664                 this->max_idle_seconds_ = max_idle_seconds;
 
  665                 this->invalidate_on_change_ = invalidate_on_change;
 
  666                 this->eviction_config_ = evict_config;
 
  679                 return time_to_live_seconds_;
 
  683                 this->time_to_live_seconds_ = util::Preconditions::check_not_negative(time_to_live_seconds,
 
  684                                                                                 "TTL seconds cannot be negative!");
 
  689                 return max_idle_seconds_;
 
  693                 this->max_idle_seconds_ = util::Preconditions::check_not_negative(max_idle_seconds,
 
  694                                                                              "Max-Idle seconds cannot be negative!");
 
  699                 return invalidate_on_change_;
 
  703                 this->invalidate_on_change_ = invalidate_on_change;
 
  708                 return in_memory_format_;
 
  712                 this->in_memory_format_ = in_memory_format;
 
  717                 return cache_local_entries_;
 
  721                 this->cache_local_entries_ = cache_local_entries;
 
  726                 return local_update_policy_;
 
  729             near_cache_config &near_cache_config::set_local_update_policy(
const local_update_policy &local_update_policy) {
 
  735                 return eviction_config_;
 
  743             int32_t near_cache_config::calculate_max_size(int32_t max_size) {
 
  744                 return (max_size == 0) ? INT32_MAX : util::Preconditions::check_not_negative(max_size,
 
  745                                                                                           "Max-size cannot be negative!");
 
  748             std::ostream &operator<<(std::ostream &out, 
const near_cache_config &config) {
 
  749                 out << 
"NearCacheConfig{" 
  750                     << 
"timeToLiveSeconds=" << config.time_to_live_seconds_
 
  751                     << 
", maxIdleSeconds=" << config.max_idle_seconds_
 
  752                     << 
", invalidateOnChange=" << config.invalidate_on_change_
 
  753                     << 
", inMemoryFormat=" << config.in_memory_format_
 
  754                     << 
", cacheLocalEntries=" << config.cache_local_entries_
 
  755                     << 
", localUpdatePolicy=" << config.local_update_policy_
 
  756                     << config.eviction_config_;
 
  764                                        socket_interceptor_(), executor_pool_size_(-1) {}
 
  771             this->redo_operation_ = redo_operation;
 
  776             return redo_operation_;
 
  780             if (!load_balancer_) {
 
  781                 auto index = std::make_shared<std::atomic<size_t>>(0);
 
  784                     if (members.empty()) {
 
  785                         return boost::optional<member>();
 
  787                     auto i = index->fetch_add(1);
 
  788                     return boost::make_optional(std::move(members[i % members.size()]));
 
  791             return *load_balancer_;
 
  800             return logger_config_;
 
  804             lifecycle_listeners_.emplace_back(std::move(listener));
 
  809             membership_listeners_.emplace_back(std::move(listener));
 
  814             return lifecycle_listeners_;
 
  818             return membership_listeners_;
 
  822             this->socket_interceptor_ = std::move(interceptor);
 
  827             return socket_interceptor_;
 
  831             return serialization_config_;
 
  844             properties_[name] = value;
 
  849             reliable_topic_config_map_[reliable_topic_config.
get_name()] = reliable_topic_config;
 
  854             auto it = reliable_topic_config_map_.find(name);
 
  855             if (it != reliable_topic_config_map_.end()) {
 
  859             return reliable_topic_config_map_.emplace(name, name).first->second;
 
  863             auto it = reliable_topic_config_map_.find(name);
 
  864             if (it != reliable_topic_config_map_.end()) {
 
  872             return network_config_;
 
  876             near_cache_config_map_.emplace(near_cache_config.
get_name(), near_cache_config);
 
  881             auto nearCacheConfig = internal::config::ConfigUtils::lookup_by_pattern(
 
  882                     config_pattern_matcher_, near_cache_config_map_, name);
 
  883             if (nearCacheConfig) {
 
  884                 return nearCacheConfig;
 
  887             auto config_it = near_cache_config_map_.find(
"default");
 
  888             if (config_it != near_cache_config_map_.end()) {
 
  889                 return &near_cache_config_map_.find(
"default")->second;
 
  898             this->network_config_ = network_config;
 
  902         const boost::optional<std::string> &client_config::get_instance_name()
 const {
 
  903             return instance_name_;
 
  906         client_config &client_config::set_instance_name(
const std::string &instance_name) {
 
  907             client_config::instance_name_ = instance_name;
 
  912             return executor_pool_size_;
 
  916             client_config::executor_pool_size_ = executor_pool_size;
 
  920             return connection_strategy_config_;
 
  923         client_config &client_config::set_connection_strategy_config(
 
  924                 const config::client_connection_strategy_config &connection_strategy_config) {
 
  925             client_config::connection_strategy_config_ = connection_strategy_config;
 
  929         const config::client_flake_id_generator_config *
 
  931             std::string baseName = internal::partition::strategy::StringPartitioningStrategy::get_base_name(name);
 
  932             auto config = internal::config::ConfigUtils::lookup_by_pattern<config::client_flake_id_generator_config>(
 
  933                     config_pattern_matcher_, flake_id_generator_config_map_, baseName);
 
  943             std::string baseName = internal::partition::strategy::StringPartitioningStrategy::get_base_name(name);
 
  944             auto config = internal::config::ConfigUtils::lookup_by_pattern<config::client_flake_id_generator_config>(
 
  945                     config_pattern_matcher_, flake_id_generator_config_map_, baseName);
 
  949             auto defConfig = flake_id_generator_config_map_.find(
"default");
 
  950             if (defConfig == flake_id_generator_config_map_.end()) {
 
  953             defConfig = flake_id_generator_config_map_.find(
"default");
 
  956             flake_id_generator_config_map_.emplace(name, std::move(new_config));
 
  957             return &flake_id_generator_config_map_.find(name)->second;
 
  962             flake_id_generator_config_map_.emplace(config.
get_name(), config);
 
  967             return cluster_name_;
 
  970         client_config &client_config::set_cluster_name(
const std::string &cluster_name) {
 
  971             cluster_name_ = cluster_name;
 
  975         const std::unordered_set<std::string> &client_config::get_labels()
 const {
 
  979         client_config &client_config::set_labels(
const std::unordered_set<std::string> &labels) {
 
  984         client_config &client_config::add_label(
const std::string &label) {
 
  985             labels_.insert(label);
 
  990             backup_acks_enabled_ = enabled;
 
  995             return backup_acks_enabled_;
 
  998         const std::shared_ptr<security::credentials> &client_config::get_credentials()
 const {
 
 1003             credentials_ = credential;
 
 1007         namespace security {
 
 1008             username_password_credentials::username_password_credentials(
const std::string &name,
 
 1009                                                                          const std::string &password) : credentials(name),
 
 1010                                                                                                         password_(password) {}
 
 1012             const std::string &username_password_credentials::password()
 const {
 
 1016             const credentials::credential_type username_password_credentials::type()
 const {
 
 1017                 return credentials::credential_type::username_password;
 
 1020             const std::vector<byte> &token_credentials::token()
 const {
 
 1024             const credentials::credential_type token_credentials::type()
 const {
 
 1025                 return credentials::credential_type::token;
 
 1028             token_credentials::token_credentials(
const std::vector<byte> &token) : credentials(
 
 1029                     token.empty() ? 
"<empty>" : 
"<token>"), token_(token) {}
 
 1031             credentials::~credentials() {}
 
 1033             const std::string &credentials::name()
 const {
 
 1037             credentials::credentials(
const std::string &name) : name_(name) {}
 
Represents an address of a client or member in the cluster.
 
hazelcast_client configuration class.
 
client_config & set_serialization_config(serialization_config const &serialization_config)
SerializationConfig is used to.
 
serialization_config & get_serialization_config()
 
const config::reliable_topic_config & get_reliable_topic_config(const std::string &name)
Gets the ClientReliableTopicConfig for a given reliable topic name.
 
client_config & set_socket_interceptor(socket_interceptor &&interceptor)
Will be called with the Socket, each time client creates a connection to any Member.
 
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 connec...
 
void set_executor_pool_size(int32_t executor_pool_size)
Sets Client side Executor pool size.
 
const config::near_cache_config * get_near_cache_config(const std::string &name) const
Gets the NearCacheConfig configured for the map / cache with name.
 
client_config & add_listener(lifecycle_listener &&listener)
Adds a listener to configuration to be registered when hazelcast_client starts.
 
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_credent...
 
const std::unordered_map< std::string, std::string > & get_properties() const
Gets a reference to properties map.
 
const socket_interceptor & get_socket_interceptor() const
Will be called with the Socket, each time client creates a connection to any Member.
 
client_config()
Constructor with default values.
 
config::client_network_config & get_network_config()
Gets {}.
 
int32_t get_executor_pool_size() const
Pool size for internal ExecutorService which handles responses etc.
 
client_config & add_reliable_topic_config(const config::reliable_topic_config &reliable_topic_config)
Adds a ClientReliableTopicConfig.
 
bool is_redo_operation() const
see setRedoOperation returns redoOperation
 
const std::vector< membership_listener > & get_membership_listeners() const
Returns registered membershipListeners.
 
client_config & add_flake_id_generator_config(const config::client_flake_id_generator_config &config)
Adds a flake ID generator configuration.
 
const std::string & get_cluster_name() const
Returns the configured cluster name.
 
config::logger_config & get_logger_config()
 
bool backup_acks_enabled()
Note that backup acks to client can be enabled only for smart client.
 
client_config & set_load_balancer(load_balancer &&load_balancer)
Used to distribute the operations to multiple connections.
 
load_balancer & get_load_balancer()
Used to distribute the operations to multiple Endpoints.
 
client_config & set_network_config(const config::client_network_config &network_config)
Sets {}.
 
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...
 
client_config & add_near_cache_config(const config::near_cache_config &near_cache_config)
Helper method to add a new NearCacheConfig.
 
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.
 
client_config & set_property(const std::string &name, const std::string &value)
Sets the value of a named property.
 
const std::vector< lifecycle_listener > & get_lifecycle_listeners() const
 
Hazelcast cluster interface.
 
std::vector< member > get_members()
Set of current members of the cluster.
 
The client_aws_config contains the configuration for client to connect to nodes in aws environment.
 
const std::string & get_access_key() const
Gets the access key to access AWS.
 
const std::string & get_tag_key() const
Gets the tag key.
 
const std::string & get_security_group_name() const
Gets the security group name.
 
const std::string & get_region() const
Gets the region where the EC2 instances running the Hazelcast members will be running.
 
const std::string & get_host_header() const
Gets the host header; the address where the EC2 API can be found.
 
client_aws_config & set_secret_key(const std::string &secret_key)
Sets the secret key to access AWS.
 
client_aws_config & set_host_header(const std::string &host_header)
Sets the host header; the address where the EC2 API can be found.
 
client_aws_config & set_tag_key(const std::string &tag_key)
Sets the tag key.
 
client_aws_config & set_iam_role(const std::string &iam_role)
Sets the tag value.
 
client_aws_config & set_inside_aws(bool inside_aws)
Set to true if client is inside aws environment Default value is false.
 
client_aws_config & set_region(const std::string ®ion)
Sets the region where the EC2 instances running the Hazelcast members will be running.
 
bool is_enabled() const
Checks if the aws join mechanism is enabled.
 
bool is_inside_aws() const
If client is inside aws, it will use private ip addresses directly, otherwise it will convert private...
 
const std::string & get_secret_key() const
Gets the secret key to access AWS.
 
client_aws_config & set_enabled(bool enabled)
Enables or disables the aws join mechanism.
 
const std::string & get_tag_value() const
Gets the tag value.
 
client_aws_config & set_access_key(const std::string &access_key)
Sets the access key to access AWS.
 
client_aws_config & set_tag_value(const std::string &tag_value)
Sets the tag value.
 
const std::string & get_iam_role() const
Gets the iamRole name.
 
client_aws_config & set_security_group_name(const std::string &security_group_name)
Sets the security group name.
 
Client connection strategy configuration is used for setting custom strategies and configuring strate...
 
client_connection_strategy_config & set_reconnect_mode(reconnect_mode reconnect_mode)
How a client reconnect to cluster after a disconnect can be configured.
 
client_connection_strategy_config & set_retry_config(connection_retry_config retry_config)
connection_retry_config controls the period among the retries and when a client should give up retryi...
 
client_connection_strategy_config & set_async_start(bool async_start)
Set true for non blocking hazelcast_client(const client_config &).
 
connection_retry_config & get_retry_config()
connection_retry_config controls the period among the retries and when a client should give up retryi...
 
reconnect_mode get_reconnect_mode() const
 
reconnect_mode
Reconnect options.
 
bool is_async_start() const
Client instance creation won't block on hazelcast_client(ClientConfig &) if this value is true.
 
static constexpr int64_t DEFAULT_PREFETCH_VALIDITY_MILLIS
Default value for getPrefetchValidityMillis().
 
const std::string & get_name() const
Returns the configuration name.
 
client_flake_id_generator_config & set_name(const std::string &n)
Sets the name or name pattern for this config.
 
Contains configuration parameters for client network related behaviour.
 
client_network_config & set_addresses(const std::vector< address > &addresses)
Adds given addresses to candidate address list that client will use to establish initial connection.
 
bool is_smart_routing() const
See client_network_config::setSmartRouting(boolean) for details.
 
std::vector< address > get_addresses() const
Returns the list of candidate addresses that client will use to establish initial connection.
 
client_network_config & add_addresses(const std::vector< address > &addresses)
Adds given addresses to candidate address list that client will use to establish initial connection.
 
client_network_config & add_address(const address &address)
Adds given address to candidate address list that client will use to establish initial connection.
 
client_network_config & set_smart_routing(bool smart_routing)
If.
 
client_network_config & set_connection_timeout(const std::chrono::milliseconds &timeout)
 
client_aws_config & get_aws_config()
Returns the current client_aws_config.
 
ssl_config & get_ssl_config()
Returns the current \ssl_config .
 
std::chrono::milliseconds get_connection_timeout() const
Connection timeout value for connecting to a member server.
 
cloud_config & get_cloud_config()
Returns the current cloud_config.
 
client_network_config & set_aws_config(const client_aws_config &client_aws_config)
Sets configuration to connect nodes in aws environment.
 
client_network_config & set_ssl_config(const config::ssl_config &config)
Sets the ssl_config.
 
Connection Retry Config is controls the period among the retries and when should a client gave up ret...
 
Configuration for eviction.
 
max_size_policy
Maximum Size Policy.
 
std::shared_ptr< std::string > matches(const std::vector< std::string > &config_patterns, const std::string &item_name) const override
Returns the best match for an item name out of a list of configuration patterns.
 
Contains the configuration for a Near Cache.
 
near_cache_config & set_cache_local_entries(bool cache_local_entries)
True to cache local entries also.
 
virtual near_cache_config & set_in_memory_format(const in_memory_format &in_memory_format)
Sets the data type used to store entries.
 
near_cache_config & set_eviction_config(const eviction_config &eviction_config)
Sets the eviction configuration.
 
const in_memory_format & get_in_memory_format() const
Gets the data type used to store entries.
 
int32_t get_time_to_live_seconds() const
Gets the maximum number of seconds for each entry to stay in the Near Cache.
 
near_cache_config & set_time_to_live_seconds(int32_t time_to_live_seconds)
Sets the maximum number of seconds for each entry to stay in the Near Cache.
 
near_cache_config & set_invalidate_on_change(bool invalidate_on_change)
True to evict the cached entries if the entries are changed (updated or removed).
 
const std::string & get_name() const
Gets the name of the Near Cache.
 
eviction_config & get_eviction_config()
The eviction configuration.
 
bool is_cache_local_entries() const
If true, cache local entries also.
 
bool is_invalidate_on_change() const
True to evict the cached entries if the entries are changed (updated or removed).
 
near_cache_config & set_name(const std::string &name)
Sets the name of the Near Cache.
 
int32_t get_max_idle_seconds() const
Maximum number of seconds each entry can stay in the Near Cache as untouched (not-read).
 
local_update_policy
Local Update Policy enum.
 
near_cache_config & set_max_idle_seconds(int32_t max_idle_seconds)
Maximum number of seconds each entry can stay in the Near Cache as untouched (not-read).
 
const std::string & get_name() const
Gets the name of the reliable topic.
 
reliable_topic_config & set_read_batch_size(int batch_size)
Sets the read batch size.
 
int get_read_batch_size() const
Gets the maximum number of items to read in a batch.
 
socket_options & set_tcp_no_delay(bool tcp_no_delay)
Enable/disable TCP_NODELAY socket option.
 
socket_options & set_reuse_address(bool reuse_address)
Enable/disable the SO_REUSEADDR socket option.
 
socket_options & set_linger_seconds(int linger_seconds)
Enable/disable SO_LINGER with the specified linger time in seconds.
 
bool is_keep_alive() const
SO_KEEPALIVE socket option.
 
socket_options & set_keep_alive(bool keep_alive)
Enable/disable SO_KEEPALIVE socket option.
 
bool is_reuse_address() const
SO_REUSEADDR socket option.
 
bool is_tcp_no_delay() const
TCP_NODELAY socket option.
 
int get_buffer_size_in_bytes() const
If set to 0 or less, then it is not set on the socket.
 
socket_options & set_buffer_size_in_bytes(int buffer_size)
If set to 0 or less, then it is not set on the socket.
 
int get_linger_seconds() const
Gets SO_LINGER with the specified linger time in seconds.
 
Contains configuration parameters for ssl related behaviour.
 
Listener object for listening lifecycle events of hazelcast instance.
 
load_balancer allows you to send operations to one of a number of endpoints(Members).
 
load_balancer & next(Handler &&h) &
The function returns the next member to route to.
 
Cluster membership listener.
 
SerializationConfig is used to.
 
serialization_config & set_portable_version(int v)
 
serialization_config & set_global_serializer(const std::shared_ptr< serialization::global_serializer > &global_serializer)
 
serialization_config & set_byte_order(boost::endian::order byte_order)
 
int get_portable_version() const
Portable version will be used to differentiate two same class that have changes on it ,...
 
serialization_config()
Constructor default value of version is zero.
 
boost::endian::order get_byte_order() const
 
An interface that provides the ability to intercept the creation of sockets.
 
hazelcast.cloud configuration to let the client connect the cluster via hazelcast....
 
bitmap_index_options()
Constructs a new bitmap index options instance with all options set to default values.
 
unique_key_transformation
 
static const unique_key_transformation DEFAULT_TRANSFORMATION
The default for \transformation.
 
static const std::string DEFAULT_KEY
The default for \key.
 
index_type type
Type of the index.