20#include "hazelcast/util/export.h"
22#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
24#pragma warning(disable : 4251)
51 std::chrono::milliseconds initial_backoff_duration);
67 std::chrono::milliseconds max_backoff_duration);
98 std::chrono::milliseconds cluster_connect_timeout);
119 static constexpr std::chrono::milliseconds INITIAL_BACKOFF{ 1000 };
120 static constexpr std::chrono::milliseconds MAX_BACKOFF{ 30000 };
121 static constexpr std::chrono::milliseconds CLUSTER_CONNECT_TIMEOUT{ (
122 std::chrono::milliseconds::max)() };
123 static constexpr double JITTER = 0;
124 std::chrono::milliseconds initial_backoff_duration_ = INITIAL_BACKOFF;
125 std::chrono::milliseconds max_backoff_duration_ = MAX_BACKOFF;
126 double multiplier_ = 1.05;
127 std::chrono::milliseconds cluster_connect_timeout_ =
128 CLUSTER_CONNECT_TIMEOUT;
129 double jitter_ = JITTER;
136#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
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