@@ -34,7 +34,7 @@ class PULSAR_PUBLIC AutoClusterFailover final : public ServiceInfoProvider {
3434 struct Config {
3535 const ServiceInfo primary;
3636 const std::vector<ServiceInfo> secondary;
37- std::chrono::milliseconds checkInterval{30000 }; // 30 seconds
37+ std::chrono::milliseconds checkInterval{5000 }; // 5 seconds
3838 uint32_t failoverThreshold{1 };
3939 uint32_t switchBackThreshold{1 };
4040
@@ -49,7 +49,7 @@ class PULSAR_PUBLIC AutoClusterFailover final : public ServiceInfoProvider {
4949 * ServiceInfo primary{...};
5050 * std::vector<ServiceInfo> secondaries{...};
5151 * AutoClusterFailover provider = AutoClusterFailover::Builder(primary, secondaries)
52- * .withCheckInterval(std::chrono::seconds(30 ))
52+ * .withCheckInterval(std::chrono::seconds(5 ))
5353 * .withFailoverThreshold(3)
5454 * .withSwitchBackThreshold(3)
5555 * .build();
@@ -68,19 +68,19 @@ class PULSAR_PUBLIC AutoClusterFailover final : public ServiceInfoProvider {
6868 Builder (ServiceInfo primary, std::vector<ServiceInfo> secondary)
6969 : config_(std::move(primary), std::move(secondary)) {}
7070
71- // Set how frequently probes run against the active cluster(s).
71+ // Set how frequently probes run against the active cluster(s). Default: 5 seconds.
7272 Builder& withCheckInterval (std::chrono::milliseconds interval) {
7373 config_.checkInterval = interval;
7474 return *this ;
7575 }
7676
77- // Set the number of consecutive failed probes required before attempting failover.
77+ // Set the number of consecutive failed probes required before attempting failover. Default: 1.
7878 Builder& withFailoverThreshold (uint32_t threshold) {
7979 config_.failoverThreshold = threshold;
8080 return *this ;
8181 }
8282
83- // Set the number of consecutive successful primary probes required before switching back.
83+ // Set the number of consecutive successful primary probes required before switching back. Default: 1.
8484 Builder& withSwitchBackThreshold (uint32_t threshold) {
8585 config_.switchBackThreshold = threshold;
8686 return *this ;
0 commit comments