18#include "hazelcast/client/client_config.h"
19#include "hazelcast/client/serialization_config.h"
20#include "hazelcast/client/config/ssl_config.h"
21#include "hazelcast/util/Preconditions.h"
22#include "hazelcast/client/config/client_flake_id_generator_config.h"
23#include "hazelcast/client/exception/protocol_exceptions.h"
24#include "hazelcast/client/internal/partition/strategy/StringPartitioningStrategy.h"
25#include "hazelcast/client/address.h"
26#include "hazelcast/client/config/client_network_config.h"
27#include "hazelcast/client/config/client_aws_config.h"
28#include "hazelcast/client/config/reliable_topic_config.h"
29#include "hazelcast/client/config/client_connection_strategy_config.h"
30#include "hazelcast/client/config/logger_config.h"
31#include "hazelcast/client/config/index_config.h"
32#include "hazelcast/client/config/matcher/matching_point_config_pattern_matcher.h"
33#include "hazelcast/client/query/predicates.h"
34#include "hazelcast/client/lifecycle_listener.h"
35#include "hazelcast/client/config/eviction_strategy_type.h"
36#include "hazelcast/client/cluster.h"
37#include "hazelcast/client/initial_membership_event.h"
58std::shared_ptr<serialization::global_serializer>
59serialization_config::get_global_serializer()
const
61 return global_serializer_;
66 const std::shared_ptr<serialization::global_serializer>& global_serializer)
68 global_serializer_ = global_serializer;
75 byte_order_ = byte_order;
86ssl_config::ssl_config()
87#ifdef HZ_BUILD_WITH_SSL
89 , ssl_protocol_(tlsv12)
93#ifdef HZ_BUILD_WITH_SSL
95ssl_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 "
101 "enable ssl. You already used the deprecated way.");
103 ssl_context_ = std::make_shared<boost::asio::ssl::context>(std::move(ctx));
108ssl_config::is_enabled()
const
110 return ssl_context_ || enabled_;
114ssl_config::set_enabled(
bool is_enabled)
116 util::Preconditions::check_ssl(
"ssl_config::set_enabled");
117 check_context_enabled_already();
118 this->enabled_ = is_enabled;
123ssl_config::check_context_enabled_already()
const
126 throw exception::illegal_argument(
127 "You should either use set_context or this method.");
132ssl_config::set_protocol(ssl_protocol protocol)
134 check_context_enabled_already();
135 this->ssl_protocol_ = protocol;
140ssl_config::get_protocol()
const
142 check_context_enabled_already();
143 return ssl_protocol_;
146const std::vector<std::string>&
147ssl_config::get_verify_files()
const
149 check_context_enabled_already();
150 return client_verify_files_;
154ssl_config::add_verify_file(
const std::string& filename)
156 check_context_enabled_already();
157 this->client_verify_files_.push_back(filename);
162ssl_config::get_cipher_list()
const
168ssl_config::set_cipher_list(
const std::string& ciphers)
170 this->cipher_list_ = ciphers;
178client_flake_id_generator_config::client_flake_id_generator_config(
179 const std::string& name)
182 , prefetch_validity_duration_(
195 client_flake_id_generator_config::name_ = n;
202 return prefetch_count_;
208 std::ostringstream out;
211 util::Preconditions::check_true(
213 prefetch_count_ = count;
217std::chrono::milliseconds
220 return prefetch_validity_duration_;
225 std::chrono::milliseconds duration)
227 util::Preconditions::check_not_negative(duration.count(),
228 "duration must be nonnegative");
229 prefetch_validity_duration_ = duration;
233constexpr std::chrono::milliseconds connection_retry_config::INITIAL_BACKOFF;
234constexpr std::chrono::milliseconds connection_retry_config::MAX_BACKOFF;
235constexpr std::chrono::milliseconds
236 connection_retry_config::CLUSTER_CONNECT_TIMEOUT;
237constexpr double connection_retry_config::JITTER;
239std::chrono::milliseconds
242 return initial_backoff_duration_;
247 std::chrono::milliseconds initial_backoff_duration)
249 util::Preconditions::check_not_negative(
250 initial_backoff_duration.count(),
251 "Initial backoff must be non-negative!");
252 initial_backoff_duration_ = initial_backoff_duration;
256std::chrono::milliseconds
259 return max_backoff_duration_;
264 std::chrono::milliseconds max_backoff_duration)
266 util::Preconditions::check_not_negative(
267 max_backoff_duration.count(),
"Max backoff must be non-negative!");
268 max_backoff_duration_ = max_backoff_duration;
281 util::Preconditions::check_true(
282 m >= 1.0,
"Multiplier must be greater than or equal to 1.0!");
287std::chrono::milliseconds
290 return cluster_connect_timeout_;
295 std::chrono::milliseconds cluster_connect_timeout)
297 util::Preconditions::check_not_negative(
298 cluster_connect_timeout.count(),
299 "Cluster connect timeout must be non-negative!");
300 cluster_connect_timeout_ = cluster_connect_timeout;
313 util::Preconditions::check_true(jitter >= 0.0 && jitter <= 1.0,
314 "Jitter must be in range [0.0, 1.0]");
320 : connection_timeout_(5000)
321 , smart_routing_(true)
333 ssl_config_ = config;
337std::chrono::milliseconds
340 return connection_timeout_;
354 return client_aws_config_;
360 return cloud_config_;
366 return smart_routing_;
372 client_network_config::smart_routing_ = smart_routing;
379 return address_list_;
385 address_list_.insert(
386 address_list_.end(), addresses.begin(), addresses.end());
393 address_list_ = addresses;
400 address_list_.push_back(
address);
405client_network_config::get_socket_options()
407 return socket_options_;
410client_network_config&
412 const std::chrono::milliseconds& timeout)
414 connection_timeout_ = timeout;
421 return use_public_address_;
427 use_public_address_ = should_use_public_address;
431client_connection_strategy_config::client_connection_strategy_config()
432 : async_start_(false)
433 , reconnect_mode_(ON)
439 return reconnect_mode_;
451 this->async_start_ = async_start;
466 return retry_config_;
473 retry_config_ = std::move(retry_config);
477constexpr int reliable_topic_config::DEFAULT_READ_BATCH_SIZE;
479reliable_topic_config::reliable_topic_config() =
default;
481reliable_topic_config::reliable_topic_config(std::string topic_name)
482 : read_batch_size_(DEFAULT_READ_BATCH_SIZE)
485 name_(
std::move(topic_name))
497 return read_batch_size_;
503 if (batch_size <= 0) {
504 BOOST_THROW_EXCEPTION(
505 exception::illegal_argument(
"ReliableTopicConfig::setReadBatchSize",
506 "readBatchSize should be positive"));
509 this->read_batch_size_ = batch_size;
514socket_options::socket_options()
515 : tcp_no_delay_(true)
517 , reuse_address_(true)
519 , buffer_size_(DEFAULT_BUFFER_SIZE_BYTE)
525 return tcp_no_delay_;
531 socket_options::tcp_no_delay_ = tcp_no_delay;
544 socket_options::keep_alive_ = keep_alive;
551 return reuse_address_;
557 socket_options::reuse_address_ = reuse_address;
564 return linger_seconds_;
570 socket_options::linger_seconds_ = linger_seconds;
583 socket_options::buffer_size_ = buffer_size;
587client_aws_config::client_aws_config()
589 , region_(
"us-east-1")
590 , host_header_(
"ec2.amazonaws.com")
603 this->access_key_ = util::Preconditions::check_has_text(
604 access_key,
"accessKey must contain text");
617 this->secret_key_ = util::Preconditions::check_has_text(
618 secret_key,
"secretKey must contain text");
632 util::Preconditions::check_has_text(region,
"region must contain text");
645 this->host_header_ = util::Preconditions::check_has_text(
646 host_header,
"hostHeader must contain text");
653 util::Preconditions::check_ssl(
"get_aws_config");
654 this->enabled_ = enabled;
666 const std::string& security_group_name)
668 this->security_group_name_ = security_group_name;
675 return security_group_name_;
681 this->tag_key_ = tag_key;
694 this->tag_value_ = tag_value;
713 this->iam_role_ = iam_role;
726 this->inside_aws_ = inside_aws;
733 return out <<
"client_aws_config{"
734 <<
"enabled=" << config.is_enabled() <<
", region='"
735 << config.get_region() <<
'\'' <<
", securityGroupName='"
736 << config.get_security_group_name() <<
'\'' <<
", tagKey='"
737 << config.get_tag_key() <<
'\'' <<
", tagValue='"
738 << config.get_tag_value() <<
'\'' <<
", hostHeader='"
739 << config.get_host_header() <<
'\'' <<
", iamRole='"
740 << config.get_iam_role() <<
"\'}";
744std::shared_ptr<std::string>
746 const std::vector<std::string>& config_patterns,
747 const std::string& item_name)
const
749 std::shared_ptr<std::string> candidate;
750 std::shared_ptr<std::string> duplicate;
751 int lastMatchingPoint = -1;
752 for (
const std::string& pattern : config_patterns) {
753 int matchingPoint = get_matching_point(pattern, item_name);
754 if (matchingPoint > -1 && matchingPoint >= lastMatchingPoint) {
755 if (matchingPoint == lastMatchingPoint) {
756 duplicate = candidate;
760 lastMatchingPoint = matchingPoint;
761 candidate.reset(
new std::string(pattern));
764 if (duplicate.get() != NULL) {
766 "MatchingPointConfigPatternMatcher::matches")
767 <<
"Configuration " << item_name
768 <<
" has duplicate configuration. Candidate:" << *candidate
769 <<
", duplicate:" << *duplicate)
776matching_point_config_pattern_matcher::get_matching_point(
777 const std::string& pattern,
778 const std::string& item_name)
const
780 size_t index = pattern.find(
'*');
781 if (index == std::string::npos) {
785 std::string firstPart = pattern.substr(0, index);
786 if (item_name.find(firstPart) != 0) {
790 std::string secondPart = pattern.substr(index + 1);
791 if (item_name.rfind(secondPart) !=
792 (item_name.length() - secondPart.length())) {
796 return (
int)(firstPart.length() + secondPart.length());
801 query::query_constants::KEY_ATTRIBUTE_NAME;
819index_config::add_attributes()
822eviction_config::eviction_config()
823 : size_(DEFAULT_MAX_ENTRY_COUNT)
824 , max_size_policy_(DEFAULT_MAX_SIZE_POLICY)
825 , eviction_policy_(DEFAULT_EVICTION_POLICY)
829eviction_config::get_size()
const
835eviction_config::set_size(int32_t size)
837 this->size_ = util::Preconditions::check_positive(
838 size,
"Size must be positive number!");
843eviction_config::get_maximum_size_policy()
const
845 return max_size_policy_;
849eviction_config::set_maximum_size_policy(
857eviction_config::get_eviction_policy()
const
859 return eviction_policy_;
863eviction_config::set_eviction_policy(eviction_policy policy)
865 this->eviction_policy_ = policy;
869eviction_strategy_type
870eviction_config::get_eviction_strategy_type()
const
873 return eviction_strategy_type::DEFAULT_EVICTION_STRATEGY;
879 out <<
"EvictionConfig{"
880 <<
"size=" << config.get_size()
881 <<
", maxSizePolicy=" << config.get_maximum_size_policy()
882 <<
", evictionPolicy=" << config.get_eviction_policy() <<
'}';
887near_cache_config::near_cache_config()
889 , time_to_live_seconds_(DEFAULT_TTL_SECONDS)
890 , max_idle_seconds_(DEFAULT_MAX_IDLE_SECONDS)
891 , in_memory_format_(DEFAULT_MEMORY_FORMAT)
892 , local_update_policy_(INVALIDATE)
893 , invalidate_on_change_(true)
894 , cache_local_entries_(false)
897near_cache_config::near_cache_config(
const std::string& cache_name)
903near_cache_config::near_cache_config(
const std::string& cache_name,
904 in_memory_format memory_format)
907 this->in_memory_format_ = memory_format;
910near_cache_config::near_cache_config(int32_t time_to_live_seconds,
911 int32_t max_idle_seconds,
912 bool invalidate_on_change,
913 in_memory_format in_memory_format,
917 this->time_to_live_seconds_ = time_to_live_seconds;
918 this->max_idle_seconds_ = max_idle_seconds;
919 this->invalidate_on_change_ = invalidate_on_change;
920 this->eviction_config_ = evict_config;
939 return time_to_live_seconds_;
945 this->time_to_live_seconds_ = util::Preconditions::check_not_negative(
946 time_to_live_seconds,
"TTL seconds cannot be negative!");
953 return max_idle_seconds_;
959 this->max_idle_seconds_ = util::Preconditions::check_not_negative(
960 max_idle_seconds,
"Max-Idle seconds cannot be negative!");
967 return invalidate_on_change_;
973 this->invalidate_on_change_ = invalidate_on_change;
977const in_memory_format&
980 return in_memory_format_;
985 const in_memory_format& in_memory_format)
987 this->in_memory_format_ = in_memory_format;
994 return cache_local_entries_;
1000 this->cache_local_entries_ = cache_local_entries;
1005near_cache_config::get_local_update_policy()
const
1007 return local_update_policy_;
1011near_cache_config::set_local_update_policy(
1012 const local_update_policy& local_update_policy)
1021 return eviction_config_;
1034 out <<
"NearCacheConfig{"
1035 <<
"timeToLiveSeconds=" << config.time_to_live_seconds_
1036 <<
", maxIdleSeconds=" << config.max_idle_seconds_
1037 <<
", invalidateOnChange=" << config.invalidate_on_change_
1038 <<
", inMemoryFormat=" << config.in_memory_format_
1039 <<
", cacheLocalEntries=" << config.cache_local_entries_
1040 <<
", localUpdatePolicy=" << config.local_update_policy_
1041 << config.eviction_config_;
1049 : cluster_name_(
"dev")
1050 , redo_operation_(false)
1051 , socket_interceptor_()
1052 , executor_pool_size_(-1)
1063 this->redo_operation_ = redo_operation;
1070 return redo_operation_;
1076 if (!load_balancer_) {
1077 auto index = std::make_shared<std::atomic<size_t>>(0);
1080 if (members.empty()) {
1081 return boost::optional<member>();
1083 auto i = index->fetch_add(1);
1084 return boost::make_optional(std::move(members[i % members.size()]));
1087 return *load_balancer_;
1100 return logger_config_;
1106 lifecycle_listeners_.emplace_back(std::move(listener));
1113 membership_listeners_.emplace_back(std::move(listener));
1117const std::vector<lifecycle_listener>&
1120 return lifecycle_listeners_;
1123const std::vector<membership_listener>&
1126 return membership_listeners_;
1132 this->socket_interceptor_ = std::move(interceptor);
1139 return socket_interceptor_;
1145 return serialization_config_;
1156const std::unordered_map<std::string, std::string>&
1165 properties_[name] = value;
1173 reliable_topic_config_map_[reliable_topic_config.
get_name()] =
1174 reliable_topic_config;
1181 auto it = reliable_topic_config_map_.find(name);
1182 if (it != reliable_topic_config_map_.end()) {
1186 return reliable_topic_config_map_
1192client_config::lookup_reliable_topic_config(
const std::string& name)
const
1194 auto it = reliable_topic_config_map_.find(name);
1195 if (it != reliable_topic_config_map_.end()) {
1202config::client_network_config&
1205 return network_config_;
1212 near_cache_config_map_.emplace(near_cache_config.
get_name(),
1220 auto nearCacheConfig = internal::config::ConfigUtils::lookup_by_pattern(
1221 config_pattern_matcher_, near_cache_config_map_, name);
1222 if (nearCacheConfig) {
1223 return nearCacheConfig;
1226 auto config_it = near_cache_config_map_.find(
"default");
1227 if (config_it != near_cache_config_map_.end()) {
1228 return &near_cache_config_map_.find(
"default")->second;
1240 this->network_config_ = network_config;
1244const boost::optional<std::string>&
1245client_config::get_instance_name()
const
1247 return instance_name_;
1251client_config::set_instance_name(
const std::string& instance_name)
1253 instance_name_ = instance_name;
1260 return executor_pool_size_;
1266 executor_pool_size_ = executor_pool_size;
1270client_config::get_connection_strategy_config()
1272 return connection_strategy_config_;
1276client_config::set_connection_strategy_config(
1277 const config::client_connection_strategy_config& connection_strategy_config)
1279 connection_strategy_config_ = connection_strategy_config;
1283const config::client_flake_id_generator_config*
1286 std::string baseName =
1287 internal::partition::strategy::StringPartitioningStrategy::get_base_name(
1289 auto config = internal::config::ConfigUtils::lookup_by_pattern<
1291 config_pattern_matcher_, flake_id_generator_config_map_, baseName);
1301 std::string baseName =
1302 internal::partition::strategy::StringPartitioningStrategy::get_base_name(
1304 auto config = internal::config::ConfigUtils::lookup_by_pattern<
1306 config_pattern_matcher_, flake_id_generator_config_map_, baseName);
1310 auto defConfig = flake_id_generator_config_map_.find(
"default");
1311 if (defConfig == flake_id_generator_config_map_.end()) {
1312 flake_id_generator_config_map_.emplace(
1315 defConfig = flake_id_generator_config_map_.find(
"default");
1318 flake_id_generator_config_map_.emplace(name, std::move(new_config));
1319 return &flake_id_generator_config_map_.find(name)->second;
1326 flake_id_generator_config_map_.emplace(config.get_name(), config);
1333 return cluster_name_;
1337client_config::set_cluster_name(
const std::string& cluster_name)
1339 cluster_name_ = cluster_name;
1343const std::unordered_set<std::string>&
1344client_config::get_labels()
const
1350client_config::set_labels(
const std::unordered_set<std::string>& labels)
1357client_config::add_label(
const std::string& label)
1359 labels_.insert(label);
1366 backup_acks_enabled_ = enabled;
1373 return backup_acks_enabled_;
1376const std::shared_ptr<security::credentials>&
1377client_config::get_credentials()
const
1379 return credentials_;
1384 const std::shared_ptr<security::credentials>& credential)
1386 credentials_ = credential;
1391username_password_credentials::username_password_credentials(
1392 const std::string& name,
1393 const std::string& password)
1395 , password_(password)
1399username_password_credentials::password()
const
1404credentials::credential_type
1405username_password_credentials::type()
const
1407 return credentials::credential_type::username_password;
1410const std::vector<byte>&
1411token_credentials::token()
const
1416credentials::credential_type
1417token_credentials::type()
const
1419 return credentials::credential_type::token;
1422token_credentials::token_credentials(
const std::vector<byte>& token)
1423 : credentials(token.empty() ?
"<empty>" :
"<token>")
1427credentials::~credentials() {}
1430credentials::name()
const
1435credentials::credentials(
const std::string& 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.
The ClientFlakeIdGeneratorConfig contains the configuration for the client regarding Flake ID Generat...
static constexpr int64_t DEFAULT_PREFETCH_VALIDITY_MILLIS
Default value for getPrefetchValidityMillis().
client_flake_id_generator_config & set_prefetch_count(int32_t count)
Sets how many IDs are pre-fetched on the background when one call to FlakeIdGenerator#newId() is made...
static constexpr int32_t MAXIMUM_PREFETCH_COUNT
Maximum value for prefetch count.
std::chrono::milliseconds get_prefetch_validity_duration() const
int32_t get_prefetch_count() const
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.
client_flake_id_generator_config & set_prefetch_validity_duration(std::chrono::milliseconds duration)
Sets for how long the pre-fetched IDs can be used.
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 true, client will route the key based operations to owner of the key on best-effort basis.
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 .
client_network_config()
Constructor with default values.
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.
bool use_public_address() const
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...
connection_retry_config & set_initial_backoff_duration(std::chrono::milliseconds initial_backoff_duration)
connection_retry_config & set_cluster_connect_timeout(std::chrono::milliseconds cluster_connect_timeout)
std::chrono::milliseconds get_cluster_connect_timeout() const
Timeout value for the client to give up to connect to the current cluster Theclient can shutdown afte...
std::chrono::milliseconds get_max_backoff_duration() const
When backoff reaches this upper bound, it does not increase any more.
connection_retry_config & set_multiplier(double multiplier)
connection_retry_config & set_jitter(double jitter)
At each iteration calculated back-off is randomized via following method random(-jitter * current_bac...
double get_multiplier() const
factor with which to multiply backoff time after a failed retry
connection_retry_config & set_max_backoff_duration(std::chrono::milliseconds max_backoff_duration)
When backoff reaches this upper bound, it does not increase any more.
double get_jitter() const
by how much to randomize backoffs.
std::chrono::milliseconds get_initial_backoff_duration() const
how long to wait after the first failure before retrying
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)
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
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
@ OBJECT
Extracted unique key value is interpreted as an object value.
static const unique_key_transformation DEFAULT_TRANSFORMATION
The default for \transformation.
static const std::string DEFAULT_KEY
The default for \key.
index_config(index_type type=DEFAULT_TYPE)
Creates an index configuration of the given type.
index_type type
Type of the index.