Struct pd_client::config::Config[][src]

pub struct Config {
    pub endpoints: Vec<String>,
    pub retry_interval: ReadableDuration,
    pub retry_max_count: isize,
    pub retry_log_every: usize,
    pub update_interval: ReadableDuration,
    pub enable_forwarding: bool,
}

The configuration for a PD Client.

By default during initialization the client will attempt to reconnect every 300s for infinity, logging only every 10th duplicate error.

Fields

endpoints: Vec<String>

The PD endpoints for the client.

Default is "127.0.0.1:2379".

retry_interval: ReadableDuration

The interval at which to retry a PD connection initialization.

Default is 300ms.

retry_max_count: isize

The maximum number of times to retry a PD connection initialization.

Default is isize::MAX, represented by -1.

retry_log_every: usize

If the client observes the same error message on retry, it can repeat the message only every n times.

Default is 10. Set to 1 to disable this feature.

update_interval: ReadableDuration

The interval at which to update PD information.

Default is 10m.

enable_forwarding: bool

The switch to support forwarding requests to follower when the network partition problem happens.

Default is false.

Implementations

impl Config[src]

pub fn new(endpoints: Vec<String>) -> Self[src]

pub fn validate(&self) -> Result<(), Box<dyn Error>>[src]

Trait Implementations

impl Clone for Config[src]

impl Debug for Config[src]

impl Default for Config[src]

impl<'de> Deserialize<'de> for Config where
    Config: Default
[src]

impl PartialEq<Config> for Config[src]

impl Serialize for Config[src]

impl StructuralPartialEq for Config[src]

Auto Trait Implementations

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> Sealed<T> for T where
    T: ?Sized
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]