[][src]Struct actix_raft::admin::InitWithConfig

pub struct InitWithConfig {
    pub members: Vec<NodeId>,
}

Initialize a pristine Raft node with the given config & start a campaign to become leader.

Fields

members: Vec<NodeId>

All currently known members to initialize the new cluster with.

If the ID of the node this command is being submitted to is not present it will be added. If there are duplicates, they will be filtered out to ensure config is proper.

Methods

impl InitWithConfig[src]

pub fn new(members: Vec<NodeId>) -> Self[src]

Construct a new instance.

Trait Implementations

impl<D: AppData, R: AppDataResponse, E: AppError, N: RaftNetwork<D>, S: RaftStorage<D, R, E>> Handler<InitWithConfig> for Raft<D, R, E, N, S>[src]

type Result = ResponseActFuture<Self, (), InitWithConfigError>

The type of value that this handler will return.

fn handle(
    &mut self,
    msg: InitWithConfig,
    ctx: &mut Self::Context
) -> Self::Result
[src]

An admin message handler invoked exclusively for cluster formation.

This command will work for single-node or multi-node cluster formation. This command should be called with all discovered nodes which need to be part of cluster.

This command will be rejected if the node is not at index 0 & in the NonVoter state, as either of those constraints being false indicates that the cluster is already formed and in motion.

This routine will set the given config as the active config, only in memory, and will start an election.

All nodes must issue this command at startup, as they will not be able to vote for other nodes until they appear in their config. This handler will ensure that it is safe to execute this command.

Once a node becomes leader and detects that its index is 0, it will commit a new config entry (instead of the normal blank entry created by new leaders).

If a race condition takes place where two nodes persist an initial config and start an election, whichever node becomes leader will end up committing its entries to the cluster.

impl Message for InitWithConfig[src]

type Result = Result<(), InitWithConfigError>

The type of value that this message will resolved with if it is successful. Read more

Auto Trait Implementations

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> From<T> for T[src]

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

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>,