raft_kv v0.2.5 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
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()
}
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
add_consensus_group()
View Source
add_consensus_group() :: :ok | {:error, :already_added}
add_consensus_group() :: :ok | {:error, :already_added}
keyspaces(keyspaces)
View Source
keyspaces(t()) :: RaftKV.Keyspaces.KeyspaceMap.t()
keyspaces(t()) :: RaftKV.Keyspaces.KeyspaceMap.t()
Type-aware getter for keyspaces.
keyspaces(s, field)
View Source
keyspaces(t(), RaftKV.Keyspaces.KeyspaceMap.t()) :: t()
keyspaces(t(), RaftKV.Keyspaces.KeyspaceMap.t()) :: t()
Type-aware setter for keyspaces.
make_rv_config(rv_config_options \\ [heartbeat_timeout: 1000, election_timeout: 2000, election_timeout_clock_drift_margin: 1000, leader_hook_module: RaftKV.Keyspaces.Hook])
View Source
make_rv_config(Keyword.t()) :: RaftedValue.Config.t()
make_rv_config(Keyword.t()) :: RaftedValue.Config.t()
merge_candidates(keyspaces)
View Source
merge_candidates(t()) :: RaftKV.Keyspaces.MergeCandidates.t()
merge_candidates(t()) :: RaftKV.Keyspaces.MergeCandidates.t()
Type-aware getter for merge_candidates.
merge_candidates(s, field)
View Source
merge_candidates(t(), RaftKV.Keyspaces.MergeCandidates.t()) :: t()
merge_candidates(t(), RaftKV.Keyspaces.MergeCandidates.t()) :: t()
Type-aware setter for merge_candidates.
new(dict)
View Source
new(term()) :: Croma.Result.t(t())
new(term()) :: Croma.Result.t(t())
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.
new!(dict) View Source
A variant of new/1 which returns t or raise if validation fails.
In other words, new/1 followed by Croma.Result.get!/1.
ongoing_workflow(keyspaces)
View Source
ongoing_workflow(t()) ::
Croma.TypeGen.Nilable.RaftKV.Keyspaces.OngoingWorkflow.t()
ongoing_workflow(t()) :: Croma.TypeGen.Nilable.RaftKV.Keyspaces.OngoingWorkflow.t()
Type-aware getter for ongoing_workflow.
ongoing_workflow(s, field) View Source
Type-aware setter for ongoing_workflow.
pending_deregistrations_queue(keyspaces)
View Source
pending_deregistrations_queue(t()) :: Croma.Tuple.t()
pending_deregistrations_queue(t()) :: Croma.Tuple.t()
Type-aware getter for pending_deregistrations_queue.
pending_deregistrations_queue(s, field)
View Source
pending_deregistrations_queue(t(), Croma.Tuple.t()) :: t()
pending_deregistrations_queue(t(), Croma.Tuple.t()) :: t()
Type-aware setter for pending_deregistrations_queue.
register(keyspace_name, policy)
View Source
register(atom(), RaftKV.SplitMergePolicy.t()) :: :ok | {:error, :already_added}
register(atom(), RaftKV.SplitMergePolicy.t()) :: :ok | {:error, :already_added}
split_candidates(keyspaces)
View Source
split_candidates(t()) :: RaftKV.Keyspaces.SplitCandidates.t()
split_candidates(t()) :: RaftKV.Keyspaces.SplitCandidates.t()
Type-aware getter for split_candidates.
split_candidates(s, field)
View Source
split_candidates(t(), RaftKV.Keyspaces.SplitCandidates.t()) :: t()
split_candidates(t(), RaftKV.Keyspaces.SplitCandidates.t()) :: t()
Type-aware setter for split_candidates.
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
submit_stats(%{
optional(atom()) => %{
optional(RaftKV.Hash.t()) =>
{non_neg_integer(), non_neg_integer(), non_neg_integer(),
non_neg_integer()}
}
}) :: :ok
update(s, dict)
View Source
update(t(), Dict.t()) :: Croma.Result.t(t())
update(t(), Dict.t()) :: Croma.Result.t(t())
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}.
update!(s, dict) View Source
A variant of update/2 which returns t or raise if validation fails.
In other words, update/2 followed by Croma.Result.get!/1.
valid?(value) View Source
Checks if the given value belongs to t/0 or not.
workflow_abort(pair)
View Source
workflow_abort(RaftKV.Workflow.t()) :: :ok
workflow_abort(RaftKV.Workflow.t()) :: :ok
workflow_fetch_from_local_leader()
View Source
workflow_fetch_from_local_leader() :: nil | RaftKV.Workflow.t()
workflow_fetch_from_local_leader() :: nil | RaftKV.Workflow.t()
workflow_proceed(pair)
View Source
workflow_proceed(RaftKV.Workflow.t()) :: nil | RaftKV.Workflow.t()
workflow_proceed(RaftKV.Workflow.t()) :: nil | RaftKV.Workflow.t()