rafted_value v0.1.10 RaftedValue.Logs
Summary
Functions
Type-aware getter for followers
Type-aware setter for followers
Type-aware getter for i_committed
Type-aware setter for i_committed
Type-aware getter for i_max
Type-aware setter for i_max
Type-aware getter for i_min
Type-aware setter for i_min
Type-aware getter for map
Type-aware setter for map
Creates a new instance of Elixir.RaftedValue.Logs by using the given dict
and the default value of each field.
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
Updates an existing instance of Elixir.RaftedValue.Logs 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
Types
t() :: %RaftedValue.Logs{followers: Croma.TypeGen.Nilable.RaftedValue.FollowerIndices.t, i_committed: RaftedValue.LogIndex.t, i_max: RaftedValue.LogIndex.t, i_min: RaftedValue.LogIndex.t, map: RaftedValue.LogsMap.t}
Functions
add_entry(RaftedValue.Logs.t, RaftedValue.Config.t, (RaftedValue.LogIndex.t -> RaftedValue.LogEntry.t)) :: t
append_entries(RaftedValue.Logs.t, RaftedValue.Members.t, [RaftedValue.LogEntry.t], RaftedValue.LogIndex.t, RaftedValue.Config.t) :: {t, RaftedValue.Members.t, [RaftedValue.LogEntry.t]}
candidate_log_up_to_date?(RaftedValue.Logs.t, RaftedValue.LogInfo.t) :: boolean
commit_to_latest(RaftedValue.Logs.t, RaftedValue.Config.t) :: {t, [RaftedValue.LogEntry.t]}
decrement_next_index_of_follower(RaftedValue.Logs.t, pid) :: t
elected_leader(RaftedValue.Logs.t, RaftedValue.Members.t, RaftedValue.TermNumber.t, RaftedValue.Config.t) :: t
Type-aware getter for followers.
Type-aware setter for followers.
Type-aware getter for i_committed.
Type-aware setter for i_committed.
Type-aware getter for i_max.
Type-aware setter for i_max.
Type-aware getter for i_min.
Type-aware setter for i_min.
make_append_entries_req(RaftedValue.Logs.t, RaftedValue.TermNumber.t, pid, integer) :: {:ok, RaftedValue.RPC.AppendEntriesRequest.t} | {:too_old, t} | :error
Type-aware getter for map.
Type-aware setter for map.
Creates a new instance of Elixir.RaftedValue.Logs by using the given dict
and the default value of each field.
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
.
prepare_to_add_follower(RaftedValue.Logs.t, RaftedValue.TermNumber.t, pid, RaftedValue.Config.t) :: {t, RaftedValue.LogEntry.t}
prepare_to_remove_follower(RaftedValue.Logs.t, RaftedValue.TermNumber.t, pid, RaftedValue.Config.t) :: {t, RaftedValue.LogEntry.t}
set_follower_index(RaftedValue.Logs.t, RaftedValue.Members.t, RaftedValue.TermNumber.t, pid, RaftedValue.LogIndex.t, RaftedValue.Config.t) :: {t, [RaftedValue.LogEntry.t]}
Updates an existing instance of Elixir.RaftedValue.Logs 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
.