raft_fleet v0.6.1 RaftFleet.Cluster.State 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 node_to_purge

Type-aware setter for node_to_purge

Type-aware getter for nodes_per_zone

Type-aware setter for nodes_per_zone

Type-aware getter for recently_removed_consensus_names

Type-aware setter for recently_removed_consensus_names

Type-aware getter for recently_removed_groups

Type-aware setter for recently_removed_groups

Type-aware getter for unhealthy_members_map

Type-aware setter for unhealthy_members_map

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

Link to this type t() View Source
t() :: %RaftFleet.Cluster.State{
  consensus_groups: RaftFleet.ConsensusGroups.t(),
  members_per_leader_node: RaftFleet.MembersPerLeaderNode.t(),
  node_to_purge: Croma.TypeGen.Nilable.Croma.Atom.t(),
  nodes_per_zone: RaftFleet.NodesPerZone.t(),
  recently_removed_consensus_names: RaftFleet.CappedQueue.t(),
  recently_removed_groups:
    Croma.TypeGen.Nilable.RaftFleet.RecentlyRemovedGroups.t(),
  unhealthy_members_map: Croma.TypeGen.Nilable.Croma.Map.t()
}

Link to this section Functions

Link to this function add_group(state0, group, n_replica) View Source
Link to this function consensus_groups(state) View Source
consensus_groups(t()) :: RaftFleet.ConsensusGroups.t()

Type-aware getter for consensus_groups.

Link to this function consensus_groups(s, field) View Source
consensus_groups(t(), RaftFleet.ConsensusGroups.t()) :: t()

Type-aware setter for consensus_groups.

Link to this function members_per_leader_node(state) View Source
members_per_leader_node(t()) :: RaftFleet.MembersPerLeaderNode.t()

Type-aware getter for members_per_leader_node.

Link to this function members_per_leader_node(s, field) View Source
members_per_leader_node(t(), RaftFleet.MembersPerLeaderNode.t()) :: t()

Type-aware setter for members_per_leader_node.

Link to this function migrate_from_older_version(state) View Source

Creates a new instance of RaftFleet.Cluster.State 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 valid?/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.

Type-aware getter for node_to_purge.

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

Type-aware setter for node_to_purge.

Link to this function nodes_per_zone(state) View Source
nodes_per_zone(t()) :: RaftFleet.NodesPerZone.t()

Type-aware getter for nodes_per_zone.

Link to this function nodes_per_zone(s, field) View Source
nodes_per_zone(t(), RaftFleet.NodesPerZone.t()) :: t()

Type-aware setter for nodes_per_zone.

Link to this function recently_removed_consensus_names(state) View Source
recently_removed_consensus_names(t()) :: RaftFleet.CappedQueue.t()

Type-aware getter for recently_removed_consensus_names.

Link to this function recently_removed_consensus_names(s, field) View Source
recently_removed_consensus_names(t(), RaftFleet.CappedQueue.t()) :: t()

Type-aware setter for recently_removed_consensus_names.

Link to this function recently_removed_groups(state) View Source
recently_removed_groups(t()) ::
  Croma.TypeGen.Nilable.RaftFleet.RecentlyRemovedGroups.t()

Type-aware getter for recently_removed_groups.

Link to this function recently_removed_groups(s, field) View Source
recently_removed_groups(
  t(),
  Croma.TypeGen.Nilable.RaftFleet.RecentlyRemovedGroups.t()
) :: t()

Type-aware setter for recently_removed_groups.

Link to this function remove_group(state0, group) View Source
Link to this function unhealthy_members_map(state) View Source
unhealthy_members_map(t()) :: Croma.TypeGen.Nilable.Croma.Map.t()

Type-aware getter for unhealthy_members_map.

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

Type-aware setter for unhealthy_members_map.

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}.

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.

Link to this function update_removed_groups(state0, node, index_or_group_name_or_nil, now, wait_time) View Source
Link to this function update_unhealthy_members(state0, from_node, counts, threshold) View Source

Checks if the given value belongs to t/0 or not.