raft_fleet v0.1.2 RaftFleet.Cluster.State

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 Elixir.RaftFleet.Cluster.State 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

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 unhealthy_members_map

Type-aware setter for unhealthy_members_map

Updates an existing instance of Elixir.RaftFleet.Cluster.State 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 :: %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, unhealthy_members_map: RaftFleet.UnhealthyMembersCountsMap.t}

Functions

add_group(state, group, n_replica)
add_node(state, n, z)
consensus_groups(state)

Specs

consensus_groups(t) :: RaftFleet.ConsensusGroups.t

Type-aware getter for consensus_groups.

consensus_groups(s, field)

Specs

consensus_groups(t, RaftFleet.ConsensusGroups.t) :: t

Type-aware setter for consensus_groups.

members_per_leader_node(state)

Specs

members_per_leader_node(t) :: RaftFleet.MembersPerLeaderNode.t

Type-aware getter for members_per_leader_node.

members_per_leader_node(s, field)

Specs

members_per_leader_node(t, RaftFleet.MembersPerLeaderNode.t) :: t

Type-aware setter for members_per_leader_node.

new(dict)

Specs

new(Dict.t) :: Croma.Result.t(t)

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

new!(dict)

Specs

new!(Dict.t) :: t

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

node_to_purge(state)

Specs

node_to_purge(t) :: Croma.TypeGen.Nilable.Croma.Atom.t

Type-aware getter for node_to_purge.

node_to_purge(s, field)

Specs

node_to_purge(t, Croma.TypeGen.Nilable.Croma.Atom.t) :: t

Type-aware setter for node_to_purge.

nodes_per_zone(state)

Specs

nodes_per_zone(t) :: RaftFleet.NodesPerZone.t

Type-aware getter for nodes_per_zone.

nodes_per_zone(s, field)

Specs

nodes_per_zone(t, RaftFleet.NodesPerZone.t) :: t

Type-aware setter for nodes_per_zone.

recently_removed_consensus_names(state)

Specs

recently_removed_consensus_names(t) :: RaftFleet.CappedQueue.t

Type-aware getter for recently_removed_consensus_names.

recently_removed_consensus_names(s, field)

Specs

recently_removed_consensus_names(t, RaftFleet.CappedQueue.t) :: t

Type-aware setter for recently_removed_consensus_names.

remove_group(state, group)
remove_node(state, n)
unhealthy_members_map(state)

Specs

unhealthy_members_map(t) :: RaftFleet.UnhealthyMembersCountsMap.t

Type-aware getter for unhealthy_members_map.

unhealthy_members_map(s, field)

Specs

unhealthy_members_map(t, RaftFleet.UnhealthyMembersCountsMap.t) :: t

Type-aware setter for unhealthy_members_map.

update(s, dict)

Specs

update(t, Dict.t) :: Croma.Result.t(t)

Updates an existing instance of Elixir.RaftFleet.Cluster.State 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}.

update!(s, dict)

Specs

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.

update_unhealthy_members(state, from_node, counts, threshold)
validate(dict)

Specs

validate(Dict.t) :: Croma.Result.t(t)

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

validate!(dict)

Specs

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.