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"
58 std::shared_ptr<serialization::global_serializer>
59 serialization_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;
86 ssl_config::ssl_config()
87 #ifdef HZ_BUILD_WITH_SSL
89 , ssl_protocol_(tlsv12)
93 #ifdef HZ_BUILD_WITH_SSL
95 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 "
101 "enable ssl. You already used the deprecated way.");
103 ssl_context_ = std::make_shared<boost::asio::ssl::context>(std::move(ctx));
108 ssl_config::is_enabled()
const
110 return ssl_context_ || enabled_;
114 ssl_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;
123 ssl_config::check_context_enabled_already()
const
126 throw exception::illegal_argument(
127 "You should either use set_context or this method.");
132 ssl_config::set_protocol(ssl_protocol protocol)
134 check_context_enabled_already();
135 this->ssl_protocol_ = protocol;
140 ssl_config::get_protocol()
const
142 check_context_enabled_already();
143 return ssl_protocol_;
146 const std::vector<std::string>&
147 ssl_config::get_verify_files()
const
149 check_context_enabled_already();
150 return client_verify_files_;
154 ssl_config::add_verify_file(
const std::string& filename)
156 check_context_enabled_already();
157 this->client_verify_files_.push_back(filename);
162 ssl_config::get_cipher_list()
const
168 ssl_config::set_cipher_list(
const std::string& ciphers)
170 this->cipher_list_ = ciphers;
178 client_flake_id_generator_config::client_flake_id_generator_config(
179 const std::string& name)
181 , prefetch_count_(client_flake_id_generator_config::DEFAULT_PREFETCH_COUNT)
182 , prefetch_validity_duration_(
183 client_flake_id_generator_config::DEFAULT_PREFETCH_VALIDITY_MILLIS)
187 client_flake_id_generator_config::get_name()
const
193 client_flake_id_generator_config::set_name(
const std::string& n)
195 client_flake_id_generator_config::name_ = n;
200 client_flake_id_generator_config::get_prefetch_count()
const
202 return prefetch_count_;
206 client_flake_id_generator_config::set_prefetch_count(int32_t count)
208 std::ostringstream out;
209 out <<
"prefetch-count must be 1.." << MAXIMUM_PREFETCH_COUNT <<
", not "
211 util::Preconditions::check_true(
212 count > 0 && count <= MAXIMUM_PREFETCH_COUNT, out.str());
213 prefetch_count_ = count;
217 std::chrono::milliseconds
218 client_flake_id_generator_config::get_prefetch_validity_duration()
const
220 return prefetch_validity_duration_;
224 client_flake_id_generator_config::set_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;
233 constexpr std::chrono::milliseconds connection_retry_config::INITIAL_BACKOFF;
234 constexpr std::chrono::milliseconds connection_retry_config::MAX_BACKOFF;
235 constexpr std::chrono::milliseconds
236 connection_retry_config::CLUSTER_CONNECT_TIMEOUT;
237 constexpr
double connection_retry_config::JITTER;
239 std::chrono::milliseconds
240 connection_retry_config::get_initial_backoff_duration()
const
242 return initial_backoff_duration_;
246 connection_retry_config::set_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;
256 std::chrono::milliseconds
257 connection_retry_config::get_max_backoff_duration()
const
259 return max_backoff_duration_;
263 connection_retry_config::set_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;
273 connection_retry_config::get_multiplier()
const
279 connection_retry_config::set_multiplier(
double m)
281 util::Preconditions::check_true(
282 m >= 1.0,
"Multiplier must be greater than or equal to 1.0!");
287 std::chrono::milliseconds
288 connection_retry_config::get_cluster_connect_timeout()
const
290 return cluster_connect_timeout_;
294 connection_retry_config::set_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;
305 connection_retry_config::get_jitter()
const
311 connection_retry_config::set_jitter(
double jitter)
313 util::Preconditions::check_true(jitter >= 0.0 && jitter <= 1.0,
314 "Jitter must be in range [0.0, 1.0]");
319 client_network_config::client_network_config()
320 : connection_timeout_(5000)
321 , smart_routing_(true)
333 ssl_config_ = config;
337 std::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);
405 client_network_config::get_socket_options()
407 return socket_options_;
410 client_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;
431 client_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);
477 constexpr
int reliable_topic_config::DEFAULT_READ_BATCH_SIZE;
479 reliable_topic_config::reliable_topic_config() =
default;
481 reliable_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;
514 socket_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;
587 client_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='"
744 std::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)
776 matching_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;
804 index_config::bitmap_index_options::unique_key_transformation::OBJECT;
808 , transformation(DEFAULT_TRANSFORMATION)
812 index_config::index_type::SORTED;
814 index_config::index_config()
823 index_config::add_attributes()
826 eviction_config::eviction_config()
827 : size_(DEFAULT_MAX_ENTRY_COUNT)
828 , max_size_policy_(DEFAULT_MAX_SIZE_POLICY)
829 , eviction_policy_(DEFAULT_EVICTION_POLICY)
833 eviction_config::get_size()
const
839 eviction_config::set_size(int32_t size)
841 this->size_ = util::Preconditions::check_positive(
842 size,
"Size must be positive number!");
847 eviction_config::get_maximum_size_policy()
const
849 return max_size_policy_;
853 eviction_config::set_maximum_size_policy(
861 eviction_config::get_eviction_policy()
const
863 return eviction_policy_;
867 eviction_config::set_eviction_policy(eviction_policy policy)
869 this->eviction_policy_ = policy;
873 eviction_strategy_type
874 eviction_config::get_eviction_strategy_type()
const
877 return eviction_strategy_type::DEFAULT_EVICTION_STRATEGY;
881 operator<<(std::ostream& out,
const eviction_config& config)
883 out <<
"EvictionConfig{"
884 <<
"size=" << config.get_size()
885 <<
", maxSizePolicy=" << config.get_maximum_size_policy()
886 <<
", evictionPolicy=" << config.get_eviction_policy() <<
'}';
891 near_cache_config::near_cache_config()
893 , time_to_live_seconds_(DEFAULT_TTL_SECONDS)
894 , max_idle_seconds_(DEFAULT_MAX_IDLE_SECONDS)
895 , in_memory_format_(DEFAULT_MEMORY_FORMAT)
896 , local_update_policy_(INVALIDATE)
897 , invalidate_on_change_(true)
898 , cache_local_entries_(false)
901 near_cache_config::near_cache_config(
const std::string& cache_name)
902 : near_cache_config()
907 near_cache_config::near_cache_config(
const std::string& cache_name,
908 in_memory_format memory_format)
909 : near_cache_config(name_)
911 this->in_memory_format_ = memory_format;
914 near_cache_config::near_cache_config(int32_t time_to_live_seconds,
915 int32_t max_idle_seconds,
916 bool invalidate_on_change,
917 in_memory_format in_memory_format,
918 const eviction_config& evict_config)
919 : near_cache_config(name_, in_memory_format)
921 this->time_to_live_seconds_ = time_to_live_seconds;
922 this->max_idle_seconds_ = max_idle_seconds;
923 this->invalidate_on_change_ = invalidate_on_change;
924 this->eviction_config_ = evict_config;
943 return time_to_live_seconds_;
949 this->time_to_live_seconds_ = util::Preconditions::check_not_negative(
950 time_to_live_seconds,
"TTL seconds cannot be negative!");
957 return max_idle_seconds_;
963 this->max_idle_seconds_ = util::Preconditions::check_not_negative(
964 max_idle_seconds,
"Max-Idle seconds cannot be negative!");
971 return invalidate_on_change_;
977 this->invalidate_on_change_ = invalidate_on_change;
981 const in_memory_format&
984 return in_memory_format_;
989 const in_memory_format& in_memory_format)
991 this->in_memory_format_ = in_memory_format;
998 return cache_local_entries_;
1004 this->cache_local_entries_ = cache_local_entries;
1009 near_cache_config::get_local_update_policy()
const
1011 return local_update_policy_;
1015 near_cache_config::set_local_update_policy(
1016 const local_update_policy& local_update_policy)
1025 return eviction_config_;
1036 near_cache_config::calculate_max_size(int32_t max_size)
1038 return (max_size == 0) ? INT32_MAX
1039 : util::Preconditions::check_not_negative(
1040 max_size,
"Max-size cannot be negative!");
1044 operator<<(std::ostream& out,
const near_cache_config& config)
1046 out <<
"NearCacheConfig{"
1047 <<
"timeToLiveSeconds=" << config.time_to_live_seconds_
1048 <<
", maxIdleSeconds=" << config.max_idle_seconds_
1049 <<
", invalidateOnChange=" << config.invalidate_on_change_
1050 <<
", inMemoryFormat=" << config.in_memory_format_
1051 <<
", cacheLocalEntries=" << config.cache_local_entries_
1052 <<
", localUpdatePolicy=" << config.local_update_policy_
1053 << config.eviction_config_;
1061 : cluster_name_(
"dev")
1062 , redo_operation_(false)
1063 , socket_interceptor_()
1064 , executor_pool_size_(-1)
1075 this->redo_operation_ = redo_operation;
1082 return redo_operation_;
1088 if (!load_balancer_) {
1089 auto index = std::make_shared<std::atomic<size_t>>(0);
1092 if (members.empty()) {
1093 return boost::optional<member>();
1095 auto i = index->fetch_add(1);
1096 return boost::make_optional(std::move(members[i % members.size()]));
1099 return *load_balancer_;
1112 return logger_config_;
1118 lifecycle_listeners_.emplace_back(std::move(listener));
1125 membership_listeners_.emplace_back(std::move(listener));
1129 const std::vector<lifecycle_listener>&
1132 return lifecycle_listeners_;
1135 const std::vector<membership_listener>&
1138 return membership_listeners_;
1144 this->socket_interceptor_ = std::move(interceptor);
1151 return socket_interceptor_;
1157 return serialization_config_;
1168 const std::unordered_map<std::string, std::string>&
1177 properties_[name] = value;
1185 reliable_topic_config_map_[reliable_topic_config.
get_name()] =
1186 reliable_topic_config;
1193 auto it = reliable_topic_config_map_.find(name);
1194 if (it != reliable_topic_config_map_.end()) {
1198 return reliable_topic_config_map_
1204 client_config::lookup_reliable_topic_config(
const std::string& name)
const
1206 auto it = reliable_topic_config_map_.find(name);
1207 if (it != reliable_topic_config_map_.end()) {
1214 config::client_network_config&
1217 return network_config_;
1224 near_cache_config_map_.emplace(near_cache_config.
get_name(),
1232 auto nearCacheConfig = internal::config::ConfigUtils::lookup_by_pattern(
1233 config_pattern_matcher_, near_cache_config_map_, name);
1234 if (nearCacheConfig) {
1235 return nearCacheConfig;
1238 auto config_it = near_cache_config_map_.find(
"default");
1239 if (config_it != near_cache_config_map_.end()) {
1240 return &near_cache_config_map_.find(
"default")->second;
1252 this->network_config_ = network_config;
1256 const boost::optional<std::string>&
1257 client_config::get_instance_name()
const
1259 return instance_name_;
1263 client_config::set_instance_name(
const std::string& instance_name)
1265 client_config::instance_name_ = instance_name;
1272 return executor_pool_size_;
1278 client_config::executor_pool_size_ = executor_pool_size;
1282 client_config::get_connection_strategy_config()
1284 return connection_strategy_config_;
1288 client_config::set_connection_strategy_config(
1289 const config::client_connection_strategy_config& connection_strategy_config)
1291 client_config::connection_strategy_config_ = connection_strategy_config;
1295 const config::client_flake_id_generator_config*
1298 std::string baseName =
1299 internal::partition::strategy::StringPartitioningStrategy::get_base_name(
1301 auto config = internal::config::ConfigUtils::lookup_by_pattern<
1303 config_pattern_matcher_, flake_id_generator_config_map_, baseName);
1313 std::string baseName =
1314 internal::partition::strategy::StringPartitioningStrategy::get_base_name(
1316 auto config = internal::config::ConfigUtils::lookup_by_pattern<
1318 config_pattern_matcher_, flake_id_generator_config_map_, baseName);
1322 auto defConfig = flake_id_generator_config_map_.find(
"default");
1323 if (defConfig == flake_id_generator_config_map_.end()) {
1324 flake_id_generator_config_map_.emplace(
1327 defConfig = flake_id_generator_config_map_.find(
"default");
1330 flake_id_generator_config_map_.emplace(name, std::move(new_config));
1331 return &flake_id_generator_config_map_.find(name)->second;
1338 flake_id_generator_config_map_.emplace(config.
get_name(), config);
1345 return cluster_name_;
1349 client_config::set_cluster_name(
const std::string& cluster_name)
1351 cluster_name_ = cluster_name;
1355 const std::unordered_set<std::string>&
1356 client_config::get_labels()
const
1362 client_config::set_labels(
const std::unordered_set<std::string>& labels)
1369 client_config::add_label(
const std::string& label)
1371 labels_.insert(label);
1378 backup_acks_enabled_ = enabled;
1385 return backup_acks_enabled_;
1388 const std::shared_ptr<security::credentials>&
1389 client_config::get_credentials()
const
1391 return credentials_;
1396 const std::shared_ptr<security::credentials>& credential)
1398 credentials_ = credential;
1402 namespace security {
1403 username_password_credentials::username_password_credentials(
1404 const std::string& name,
1405 const std::string& password)
1407 , password_(password)
1411 username_password_credentials::password()
const
1416 credentials::credential_type
1417 username_password_credentials::type()
const
1419 return credentials::credential_type::username_password;
1422 const std::vector<byte>&
1423 token_credentials::token()
const
1428 credentials::credential_type
1429 token_credentials::type()
const
1431 return credentials::credential_type::token;
1434 token_credentials::token_credentials(
const std::vector<byte>& token)
1435 : credentials(token.empty() ?
"<empty>" :
"<token>")
1439 credentials::~credentials() {}
1442 credentials::name()
const
1447 credentials::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 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 {} 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.
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...
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.