rafted_value v0.4.0 RaftedValue.Members View Source

Link to this section Summary

Functions

Type-aware getter for all

Type-aware setter for all

Type-aware getter for leader

Type-aware setter for leader

Creates a new instance of RaftedValue.Members by using the given dict

A variant of new/1 which returns t or raise if validation fails

Type-aware getter for pending_leader_change

Type-aware setter for pending_leader_change

Type-aware getter for uncommitted_membership_change

Type-aware setter for uncommitted_membership_change

Updates an existing instance of RaftedValue.Members with the given dict. The values in the dict are validated by each field’s validate/1 function. Returns {:ok, valid_struct} or {:error, reason}

A variant of update/2 which returns t or raise if validation fails. In other words, update/2 followed by Croma.Result.get!/1

Checks that the given dict is valid or not by using each field’s validate/1 function. Returns {:ok, valid_struct} or {:error, reason}

A variant of validate/1 which returns t or raise if validation fails. In other words, validate/1 followed by Croma.Result.get!/1

Link to this section Types

Link to this type t() View Source
t() :: %RaftedValue.Members{all: RaftedValue.PidSet.t, leader: Croma.TypeGen.Nilable.Croma.Pid.t, pending_leader_change: Croma.TypeGen.Nilable.Croma.Pid.t, uncommitted_membership_change: Croma.TypeGen.Nilable.RaftedValue.LogEntry.t}

Link to this section Functions

Link to this function all(members) View Source
all(t) :: RaftedValue.PidSet.t

Type-aware getter for all.

Link to this function all(s, field) View Source
all(t, RaftedValue.PidSet.t) :: t

Type-aware setter for all.

Link to this function force_remove_member(m, pid) View Source
force_remove_member(RaftedValue.Members.t, pid) :: t

Type-aware getter for leader.

Type-aware setter for leader.

Link to this function membership_change_committed(m, index) View Source
membership_change_committed(RaftedValue.Members.t, LogIndex.t) :: t

Creates a new instance of RaftedValue.Members by using the given dict.

For missing fields, default/0 of each field type will be used.

Returns {:ok, valid_struct} or {:error, reason}. The values in the dict are validated by each field’s validate/1 function.

A variant of new/1 which returns t or raise if validation fails.

In other words, new/1 followed by Croma.Result.get!/1.

Link to this function new_for_lonely_leader() View Source
new_for_lonely_leader() :: t
Link to this function other_members_list(a0) View Source
other_members_list(RaftedValue.Members.t) :: [pid]
Link to this function pending_leader_change(members) View Source
pending_leader_change(t) :: Croma.TypeGen.Nilable.Croma.Pid.t

Type-aware getter for pending_leader_change.

Link to this function pending_leader_change(s, field) View Source
pending_leader_change(t, Croma.TypeGen.Nilable.Croma.Pid.t) :: t

Type-aware setter for pending_leader_change.

Link to this function put_leader(m, leader_or_nil) View Source
put_leader(t, nil | pid) :: t
Link to this function start_adding_follower(m, entry) View Source
start_adding_follower(RaftedValue.Members.t, {any, any, :add_follower, any}) :: Croma.Result.t(t)
Link to this function start_removing_follower(m, entry) View Source
start_removing_follower(RaftedValue.Members.t, {any, any, :remove_follower, any}) :: Croma.Result.t(t)
Link to this function start_replacing_leader(m, new_leader) View Source
start_replacing_leader(RaftedValue.Members.t, nil | pid) :: Croma.Result.t(t)
Link to this function uncommitted_membership_change(members) View Source
uncommitted_membership_change(t) :: Croma.TypeGen.Nilable.RaftedValue.LogEntry.t

Type-aware getter for uncommitted_membership_change.

Link to this function uncommitted_membership_change(s, field) View Source
uncommitted_membership_change(t, Croma.TypeGen.Nilable.RaftedValue.LogEntry.t) :: t

Type-aware setter for uncommitted_membership_change.

Updates an existing instance of RaftedValue.Members with the given dict. The values in the dict are validated by each field’s validate/1 function. Returns {:ok, valid_struct} or {:error, reason}.

Link to this function update!(s, dict) View Source
update!(t, Dict.t) :: t

A variant of update/2 which returns t or raise if validation fails. In other words, update/2 followed by Croma.Result.get!/1.

Checks that the given dict is valid or not by using each field’s validate/1 function. Returns {:ok, valid_struct} or {:error, reason}.

Link to this function validate!(dict) View Source
validate!(Dict.t) :: t

A variant of validate/1 which returns t or raise if validation fails. In other words, validate/1 followed by Croma.Result.get!/1.