raft_kv v0.2.2 RaftKV.Keyspaces View Source

Link to this section Summary

Functions

Type-aware getter for keyspaces

Type-aware setter for keyspaces

Type-aware getter for merge_candidates

Type-aware setter for merge_candidates

Creates a new instance of RaftKV.Keyspaces by using the given dict

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

Type-aware getter for ongoing_workflow

Type-aware setter for ongoing_workflow

Type-aware getter for pending_deregistrations_queue

Type-aware setter for pending_deregistrations_queue

Type-aware getter for split_candidates

Type-aware setter for split_candidates

Updates an existing instance of RaftKV.Keyspaces 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() :: %RaftKV.Keyspaces{
  keyspaces: RaftKV.Keyspaces.KeyspaceMap.t(),
  merge_candidates: RaftKV.Keyspaces.MergeCandidates.t(),
  ongoing_workflow: Croma.TypeGen.Nilable.RaftKV.Keyspaces.OngoingWorkflow.t(),
  pending_deregistrations_queue: Croma.Tuple.t(),
  split_candidates: RaftKV.Keyspaces.SplitCandidates.t()
}

Link to this section Functions

Link to this function add_consensus_group() View Source
add_consensus_group() :: :ok | {:error, :already_added}

Type-aware getter for keyspaces.

Type-aware setter for keyspaces.

Link to this function merge_candidates(keyspaces) View Source
merge_candidates(t()) :: RaftKV.Keyspaces.MergeCandidates.t()

Type-aware getter for merge_candidates.

Link to this function merge_candidates(s, field) View Source
merge_candidates(t(), RaftKV.Keyspaces.MergeCandidates.t()) :: t()

Type-aware setter for merge_candidates.

Creates a new instance of RaftKV.Keyspaces 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.

Link to this function ongoing_workflow(keyspaces) View Source
ongoing_workflow(t()) ::
  Croma.TypeGen.Nilable.RaftKV.Keyspaces.OngoingWorkflow.t()

Type-aware getter for ongoing_workflow.

Link to this function ongoing_workflow(s, field) View Source
ongoing_workflow(
  t(),
  Croma.TypeGen.Nilable.RaftKV.Keyspaces.OngoingWorkflow.t()
) :: t()

Type-aware setter for ongoing_workflow.

Link to this function pending_deregistrations_queue(keyspaces) View Source
pending_deregistrations_queue(t()) :: Croma.Tuple.t()

Type-aware getter for pending_deregistrations_queue.

Link to this function pending_deregistrations_queue(s, field) View Source
pending_deregistrations_queue(t(), Croma.Tuple.t()) :: t()

Type-aware setter for pending_deregistrations_queue.

Link to this function register(keyspace_name, policy) View Source
register(atom(), RaftKV.SplitMergePolicy.t()) :: :ok | {:error, :already_added}
Link to this function split_candidates(keyspaces) View Source
split_candidates(t()) :: RaftKV.Keyspaces.SplitCandidates.t()

Type-aware getter for split_candidates.

Link to this function split_candidates(s, field) View Source
split_candidates(t(), RaftKV.Keyspaces.SplitCandidates.t()) :: t()

Type-aware setter for split_candidates.

Link to this function submit_stats(map) View Source
submit_stats(%{
  optional(atom()) => %{
    optional(RaftKV.Hash.t()) =>
      {non_neg_integer(), non_neg_integer(), non_neg_integer(),
       non_neg_integer()}
  }
}) :: :ok

Updates an existing instance of RaftKV.Keyspaces 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.

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

Link to this function workflow_abort(pair) View Source
workflow_abort(RaftKV.Workflow.t()) :: :ok
Link to this function workflow_fetch_from_local_leader() View Source
workflow_fetch_from_local_leader() :: nil | RaftKV.Workflow.t()
Link to this function workflow_proceed(pair) View Source
workflow_proceed(RaftKV.Workflow.t()) :: nil | RaftKV.Workflow.t()