pub struct MessageOverlapMergeConfigBuilder { /* private fields */ }Implementations§
Source§impl MessageOverlapMergeConfigBuilder
impl MessageOverlapMergeConfigBuilder
Sourcepub fn initial_interval(self, interval: Duration) -> Self
pub fn initial_interval(self, interval: Duration) -> Self
Initial delay before starting message overlap merge attempts.
Default: 30s.
Examples found in repository?
17fn config_builder() -> Config {
18 Config::builder()
19 .dht_config(
20 DhtConfig::builder()
21 .retries(3)
22 .base_retry_interval(Duration::from_secs(5))
23 .max_retry_jitter(Duration::from_secs(10))
24 .get_timeout(Duration::from_secs(10))
25 .put_timeout(Duration::from_secs(10))
26 .build(),
27 )
28 .bootstrap_config(
29 BootstrapConfig::builder()
30 .max_bootstrap_records(5)
31 .publish_record_on_startup(true)
32 .check_older_records_first_on_startup(false)
33 .discovery_poll_interval(Duration::from_millis(2000))
34 .no_peers_retry_interval(Duration::from_millis(1500))
35 .per_peer_join_settle_time(Duration::from_millis(100))
36 .join_confirmation_wait_time(Duration::from_millis(500))
37 .build(),
38 )
39 .max_join_peer_count(4)
40 .publisher_config(
41 PublisherConfig::builder()
42 .initial_delay(Duration::from_secs(10))
43 .base_interval(Duration::from_secs(10))
44 .max_jitter(Duration::from_secs(50))
45 .build(),
46 )
47 .merge_config(
48 MergeConfig::builder()
49 .bubble_merge(
50 BubbleMergeConfig::builder()
51 .min_neighbors(4)
52 .initial_interval(Duration::from_secs(30))
53 .base_interval(Duration::from_secs(60))
54 .max_jitter(Duration::from_secs(120))
55 .fail_topic_creation_on_merge_startup_failure(true)
56 .max_join_peers(2)
57 .build(),
58 )
59 .message_overlap_merge(
60 MessageOverlapMergeConfig::builder()
61 .initial_interval(Duration::from_secs(30))
62 .base_interval(Duration::from_secs(60))
63 .max_jitter(Duration::from_secs(120))
64 .fail_topic_creation_on_merge_startup_failure(true)
65 .max_join_peers(2)
66 .build(),
67 )
68 .build(),
69 )
70 .timeouts(
71 TimeoutConfig::builder()
72 .join_peer_timeout(Duration::from_secs(5))
73 .broadcast_neighbors_timeout(Duration::from_secs(5))
74 .broadcast_timeout(Duration::from_secs(5))
75 .build(),
76 )
77 .build()
78}Sourcepub fn base_interval(self, interval: Duration) -> Self
pub fn base_interval(self, interval: Duration) -> Self
Base interval for message overlap merge attempts. No-op if interval is Duration::ZERO.
If base_interval is called only once with Duration::ZERO, default value prevails.
If base_interval is first called with a > Duration::ZERO, and then again with Duration::ZERO, the first set value is kept.
Default: 60s.
Examples found in repository?
17fn config_builder() -> Config {
18 Config::builder()
19 .dht_config(
20 DhtConfig::builder()
21 .retries(3)
22 .base_retry_interval(Duration::from_secs(5))
23 .max_retry_jitter(Duration::from_secs(10))
24 .get_timeout(Duration::from_secs(10))
25 .put_timeout(Duration::from_secs(10))
26 .build(),
27 )
28 .bootstrap_config(
29 BootstrapConfig::builder()
30 .max_bootstrap_records(5)
31 .publish_record_on_startup(true)
32 .check_older_records_first_on_startup(false)
33 .discovery_poll_interval(Duration::from_millis(2000))
34 .no_peers_retry_interval(Duration::from_millis(1500))
35 .per_peer_join_settle_time(Duration::from_millis(100))
36 .join_confirmation_wait_time(Duration::from_millis(500))
37 .build(),
38 )
39 .max_join_peer_count(4)
40 .publisher_config(
41 PublisherConfig::builder()
42 .initial_delay(Duration::from_secs(10))
43 .base_interval(Duration::from_secs(10))
44 .max_jitter(Duration::from_secs(50))
45 .build(),
46 )
47 .merge_config(
48 MergeConfig::builder()
49 .bubble_merge(
50 BubbleMergeConfig::builder()
51 .min_neighbors(4)
52 .initial_interval(Duration::from_secs(30))
53 .base_interval(Duration::from_secs(60))
54 .max_jitter(Duration::from_secs(120))
55 .fail_topic_creation_on_merge_startup_failure(true)
56 .max_join_peers(2)
57 .build(),
58 )
59 .message_overlap_merge(
60 MessageOverlapMergeConfig::builder()
61 .initial_interval(Duration::from_secs(30))
62 .base_interval(Duration::from_secs(60))
63 .max_jitter(Duration::from_secs(120))
64 .fail_topic_creation_on_merge_startup_failure(true)
65 .max_join_peers(2)
66 .build(),
67 )
68 .build(),
69 )
70 .timeouts(
71 TimeoutConfig::builder()
72 .join_peer_timeout(Duration::from_secs(5))
73 .broadcast_neighbors_timeout(Duration::from_secs(5))
74 .broadcast_timeout(Duration::from_secs(5))
75 .build(),
76 )
77 .build()
78}Sourcepub fn max_jitter(self, jitter: Duration) -> Self
pub fn max_jitter(self, jitter: Duration) -> Self
Max random jitter added to message overlap merge interval.
Default: 120s. Minimum is 0s.
Examples found in repository?
17fn config_builder() -> Config {
18 Config::builder()
19 .dht_config(
20 DhtConfig::builder()
21 .retries(3)
22 .base_retry_interval(Duration::from_secs(5))
23 .max_retry_jitter(Duration::from_secs(10))
24 .get_timeout(Duration::from_secs(10))
25 .put_timeout(Duration::from_secs(10))
26 .build(),
27 )
28 .bootstrap_config(
29 BootstrapConfig::builder()
30 .max_bootstrap_records(5)
31 .publish_record_on_startup(true)
32 .check_older_records_first_on_startup(false)
33 .discovery_poll_interval(Duration::from_millis(2000))
34 .no_peers_retry_interval(Duration::from_millis(1500))
35 .per_peer_join_settle_time(Duration::from_millis(100))
36 .join_confirmation_wait_time(Duration::from_millis(500))
37 .build(),
38 )
39 .max_join_peer_count(4)
40 .publisher_config(
41 PublisherConfig::builder()
42 .initial_delay(Duration::from_secs(10))
43 .base_interval(Duration::from_secs(10))
44 .max_jitter(Duration::from_secs(50))
45 .build(),
46 )
47 .merge_config(
48 MergeConfig::builder()
49 .bubble_merge(
50 BubbleMergeConfig::builder()
51 .min_neighbors(4)
52 .initial_interval(Duration::from_secs(30))
53 .base_interval(Duration::from_secs(60))
54 .max_jitter(Duration::from_secs(120))
55 .fail_topic_creation_on_merge_startup_failure(true)
56 .max_join_peers(2)
57 .build(),
58 )
59 .message_overlap_merge(
60 MessageOverlapMergeConfig::builder()
61 .initial_interval(Duration::from_secs(30))
62 .base_interval(Duration::from_secs(60))
63 .max_jitter(Duration::from_secs(120))
64 .fail_topic_creation_on_merge_startup_failure(true)
65 .max_join_peers(2)
66 .build(),
67 )
68 .build(),
69 )
70 .timeouts(
71 TimeoutConfig::builder()
72 .join_peer_timeout(Duration::from_secs(5))
73 .broadcast_neighbors_timeout(Duration::from_secs(5))
74 .broadcast_timeout(Duration::from_secs(5))
75 .build(),
76 )
77 .build()
78}Sourcepub fn fail_topic_creation_on_merge_startup_failure(self, fail: bool) -> Self
pub fn fail_topic_creation_on_merge_startup_failure(self, fail: bool) -> Self
Whether to fail topic creation
If a message overlap merge startup check fails (ret Err()) or just log and run topic without.
Default: true.
Examples found in repository?
17fn config_builder() -> Config {
18 Config::builder()
19 .dht_config(
20 DhtConfig::builder()
21 .retries(3)
22 .base_retry_interval(Duration::from_secs(5))
23 .max_retry_jitter(Duration::from_secs(10))
24 .get_timeout(Duration::from_secs(10))
25 .put_timeout(Duration::from_secs(10))
26 .build(),
27 )
28 .bootstrap_config(
29 BootstrapConfig::builder()
30 .max_bootstrap_records(5)
31 .publish_record_on_startup(true)
32 .check_older_records_first_on_startup(false)
33 .discovery_poll_interval(Duration::from_millis(2000))
34 .no_peers_retry_interval(Duration::from_millis(1500))
35 .per_peer_join_settle_time(Duration::from_millis(100))
36 .join_confirmation_wait_time(Duration::from_millis(500))
37 .build(),
38 )
39 .max_join_peer_count(4)
40 .publisher_config(
41 PublisherConfig::builder()
42 .initial_delay(Duration::from_secs(10))
43 .base_interval(Duration::from_secs(10))
44 .max_jitter(Duration::from_secs(50))
45 .build(),
46 )
47 .merge_config(
48 MergeConfig::builder()
49 .bubble_merge(
50 BubbleMergeConfig::builder()
51 .min_neighbors(4)
52 .initial_interval(Duration::from_secs(30))
53 .base_interval(Duration::from_secs(60))
54 .max_jitter(Duration::from_secs(120))
55 .fail_topic_creation_on_merge_startup_failure(true)
56 .max_join_peers(2)
57 .build(),
58 )
59 .message_overlap_merge(
60 MessageOverlapMergeConfig::builder()
61 .initial_interval(Duration::from_secs(30))
62 .base_interval(Duration::from_secs(60))
63 .max_jitter(Duration::from_secs(120))
64 .fail_topic_creation_on_merge_startup_failure(true)
65 .max_join_peers(2)
66 .build(),
67 )
68 .build(),
69 )
70 .timeouts(
71 TimeoutConfig::builder()
72 .join_peer_timeout(Duration::from_secs(5))
73 .broadcast_neighbors_timeout(Duration::from_secs(5))
74 .broadcast_timeout(Duration::from_secs(5))
75 .build(),
76 )
77 .build()
78}Sourcepub fn max_join_peers(self, max_join_peers: usize) -> Self
pub fn max_join_peers(self, max_join_peers: usize) -> Self
Max number of peers to join during a message overlap merge attempt. No-op if max_join_peers is zero.
If max_join_peers is called only once with zero, default value prevails.
If max_join_peers is first called with a > zero, and then again with zero, the first set value is kept.
Default: 2.
Examples found in repository?
17fn config_builder() -> Config {
18 Config::builder()
19 .dht_config(
20 DhtConfig::builder()
21 .retries(3)
22 .base_retry_interval(Duration::from_secs(5))
23 .max_retry_jitter(Duration::from_secs(10))
24 .get_timeout(Duration::from_secs(10))
25 .put_timeout(Duration::from_secs(10))
26 .build(),
27 )
28 .bootstrap_config(
29 BootstrapConfig::builder()
30 .max_bootstrap_records(5)
31 .publish_record_on_startup(true)
32 .check_older_records_first_on_startup(false)
33 .discovery_poll_interval(Duration::from_millis(2000))
34 .no_peers_retry_interval(Duration::from_millis(1500))
35 .per_peer_join_settle_time(Duration::from_millis(100))
36 .join_confirmation_wait_time(Duration::from_millis(500))
37 .build(),
38 )
39 .max_join_peer_count(4)
40 .publisher_config(
41 PublisherConfig::builder()
42 .initial_delay(Duration::from_secs(10))
43 .base_interval(Duration::from_secs(10))
44 .max_jitter(Duration::from_secs(50))
45 .build(),
46 )
47 .merge_config(
48 MergeConfig::builder()
49 .bubble_merge(
50 BubbleMergeConfig::builder()
51 .min_neighbors(4)
52 .initial_interval(Duration::from_secs(30))
53 .base_interval(Duration::from_secs(60))
54 .max_jitter(Duration::from_secs(120))
55 .fail_topic_creation_on_merge_startup_failure(true)
56 .max_join_peers(2)
57 .build(),
58 )
59 .message_overlap_merge(
60 MessageOverlapMergeConfig::builder()
61 .initial_interval(Duration::from_secs(30))
62 .base_interval(Duration::from_secs(60))
63 .max_jitter(Duration::from_secs(120))
64 .fail_topic_creation_on_merge_startup_failure(true)
65 .max_join_peers(2)
66 .build(),
67 )
68 .build(),
69 )
70 .timeouts(
71 TimeoutConfig::builder()
72 .join_peer_timeout(Duration::from_secs(5))
73 .broadcast_neighbors_timeout(Duration::from_secs(5))
74 .broadcast_timeout(Duration::from_secs(5))
75 .build(),
76 )
77 .build()
78}Sourcepub fn build(self) -> MessageOverlapMergeConfig
pub fn build(self) -> MessageOverlapMergeConfig
Build the MessageOverlapMergeConfig.
Examples found in repository?
17fn config_builder() -> Config {
18 Config::builder()
19 .dht_config(
20 DhtConfig::builder()
21 .retries(3)
22 .base_retry_interval(Duration::from_secs(5))
23 .max_retry_jitter(Duration::from_secs(10))
24 .get_timeout(Duration::from_secs(10))
25 .put_timeout(Duration::from_secs(10))
26 .build(),
27 )
28 .bootstrap_config(
29 BootstrapConfig::builder()
30 .max_bootstrap_records(5)
31 .publish_record_on_startup(true)
32 .check_older_records_first_on_startup(false)
33 .discovery_poll_interval(Duration::from_millis(2000))
34 .no_peers_retry_interval(Duration::from_millis(1500))
35 .per_peer_join_settle_time(Duration::from_millis(100))
36 .join_confirmation_wait_time(Duration::from_millis(500))
37 .build(),
38 )
39 .max_join_peer_count(4)
40 .publisher_config(
41 PublisherConfig::builder()
42 .initial_delay(Duration::from_secs(10))
43 .base_interval(Duration::from_secs(10))
44 .max_jitter(Duration::from_secs(50))
45 .build(),
46 )
47 .merge_config(
48 MergeConfig::builder()
49 .bubble_merge(
50 BubbleMergeConfig::builder()
51 .min_neighbors(4)
52 .initial_interval(Duration::from_secs(30))
53 .base_interval(Duration::from_secs(60))
54 .max_jitter(Duration::from_secs(120))
55 .fail_topic_creation_on_merge_startup_failure(true)
56 .max_join_peers(2)
57 .build(),
58 )
59 .message_overlap_merge(
60 MessageOverlapMergeConfig::builder()
61 .initial_interval(Duration::from_secs(30))
62 .base_interval(Duration::from_secs(60))
63 .max_jitter(Duration::from_secs(120))
64 .fail_topic_creation_on_merge_startup_failure(true)
65 .max_join_peers(2)
66 .build(),
67 )
68 .build(),
69 )
70 .timeouts(
71 TimeoutConfig::builder()
72 .join_peer_timeout(Duration::from_secs(5))
73 .broadcast_neighbors_timeout(Duration::from_secs(5))
74 .broadcast_timeout(Duration::from_secs(5))
75 .build(),
76 )
77 .build()
78}Trait Implementations§
Source§impl Clone for MessageOverlapMergeConfigBuilder
impl Clone for MessageOverlapMergeConfigBuilder
Source§fn clone(&self) -> MessageOverlapMergeConfigBuilder
fn clone(&self) -> MessageOverlapMergeConfigBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for MessageOverlapMergeConfigBuilder
impl RefUnwindSafe for MessageOverlapMergeConfigBuilder
impl Send for MessageOverlapMergeConfigBuilder
impl Sync for MessageOverlapMergeConfigBuilder
impl Unpin for MessageOverlapMergeConfigBuilder
impl UnsafeUnpin for MessageOverlapMergeConfigBuilder
impl UnwindSafe for MessageOverlapMergeConfigBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more