Raft v0.2.1 Raft.Configuration
Defines a struct and common operations for managing cluster membership
Link to this section Summary
Functions
Gets a list of followers
Does the server have a vote
Determines if we have a majority based on the current configuration
Is the peer a member of the configuration
Gets the maximum index for which we have a quorum
Reconfigures the configuration with new servers. If the configuration state is
:none
then it moves directly into a stable configuration. Otherwise it
starts to transition to a new configuration
Returns the list of all servers based on the configuration state
Builds a new voter server server struct
Link to this section Types
t() :: %Raft.Configuration{ index: term(), new_servers: list(), old_servers: list(), state: config_state() }
Link to this section Functions
followers(Raft.Configuration.t(), peer()) :: [Raft.Configuration.Server.t()]
Gets a list of followers
Does the server have a vote.
Determines if we have a majority based on the current configuration.
member?(Raft.Configuration.t(), peer()) :: boolean()
Is the peer a member of the configuration.
quorum_max(Raft.Configuration.t(), map()) :: non_neg_integer()
Gets the maximum index for which we have a quorum.
reconfig(Raft.Configuration.t(), list()) :: Raft.Configuration.t()
Reconfigures the configuration with new servers. If the configuration state is
:none
then it moves directly into a stable configuration. Otherwise it
starts to transition to a new configuration.
servers(Raft.Configuration.t()) :: [Raft.Configuration.Server.t()]
Returns the list of all servers based on the configuration state.
Builds a new voter server server struct.