RaftFleet.Cluster.State (raft_fleet v0.10.2) View Source
Link to this section Summary
Functions
Type-aware getter for consensus_groups.
Type-aware setter for consensus_groups.
Type-aware getter for members_per_leader_node.
Type-aware setter for members_per_leader_node.
Creates a new instance of RaftFleet.Cluster.State by using the given dict.
A variant of new/1 which returns t or raise if validation fails.
Type-aware getter for nodes_per_zone.
Type-aware setter for nodes_per_zone.
Type-aware getter for recently_removed_groups.
Type-aware setter for recently_removed_groups.
Updates an existing instance of RaftFleet.Cluster.State with the given dict.
The values in the dict are validated by each field's valid?/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 if the given value belongs to t/0 or not.
Link to this section Types
Specs
t() :: %RaftFleet.Cluster.State{
consensus_groups: RaftFleet.ConsensusGroups.t(),
members_per_leader_node: RaftFleet.MembersPerLeaderNode.t(),
nodes_per_zone: RaftFleet.NodesPerZone.t(),
recently_removed_groups: RaftFleet.RecentlyRemovedGroups.t()
}
Link to this section Functions
Specs
consensus_groups(t()) :: RaftFleet.ConsensusGroups.t()
Type-aware getter for consensus_groups.
Specs
consensus_groups(t(), RaftFleet.ConsensusGroups.t()) :: t()
Type-aware setter for consensus_groups.
Specs
members_per_leader_node(t()) :: RaftFleet.MembersPerLeaderNode.t()
Type-aware getter for members_per_leader_node.
Specs
members_per_leader_node(t(), RaftFleet.MembersPerLeaderNode.t()) :: t()
Type-aware setter for members_per_leader_node.
Specs
new(term()) :: Croma.Result.t(t())
Creates a new instance of RaftFleet.Cluster.State by using the given dict.
Values associated with the struct field names are fetched from the given dict
and then validated/converted with valid?/1/new/1.
For missing fields default values (if any) are used.
Returns {:ok, valid_struct} when all fields are filled with valid values.
Returns {:error, reason} if any error occurs (invalid value or no value is available).
See also moduledoc of Croma.Struct.
Specs
A variant of new/1 which returns t or raise if validation fails.
In other words, new/1 followed by Croma.Result.get!/1.
Specs
nodes_per_zone(t()) :: RaftFleet.NodesPerZone.t()
Type-aware getter for nodes_per_zone.
Specs
nodes_per_zone(t(), RaftFleet.NodesPerZone.t()) :: t()
Type-aware setter for nodes_per_zone.
Specs
recently_removed_groups(t()) :: RaftFleet.RecentlyRemovedGroups.t()
Type-aware getter for recently_removed_groups.
Specs
recently_removed_groups(t(), RaftFleet.RecentlyRemovedGroups.t()) :: t()
Type-aware setter for recently_removed_groups.
Specs
update(t(), Dict.t()) :: Croma.Result.t(t())
Updates an existing instance of RaftFleet.Cluster.State with the given dict.
The values in the dict are validated by each field's valid?/1 function.
Returns {:ok, valid_struct} or {:error, reason}.
Specs
A variant of update/2 which returns t or raise if validation fails.
In other words, update/2 followed by Croma.Result.get!/1.
Specs
Checks if the given value belongs to t/0 or not.