Ferricstore.Raft.Batcher (ferricstore v0.4.0)

Copy Markdown View Source

WARaft write facade for default-instance call sites.

Default-instance writes are committed by Ferricstore.Raft.WARaftBackend; this module keeps the small batching API used by Router, Shard forwarding, and cross-shard helpers.

Summary

Types

command()

@type command() :: tuple()

Functions

await_local_applied(shard_index, raft_index, timeout_ms \\ 10000)

@spec await_local_applied(non_neg_integer(), non_neg_integer(), non_neg_integer()) ::
  :ok | {:error, :timeout}

batcher_name(shard_index)

@spec batcher_name(non_neg_integer()) :: atom()

extract_prefix(arg1)

@spec extract_prefix(command()) :: binary()

flush(shard_index, timeout \\ 10000)

@spec flush(non_neg_integer(), timeout()) :: :ok

flush_all(shard_count \\ 4, timeout \\ 10000)

@spec flush_all(non_neg_integer(), timeout()) ::
  :ok | {:error, [{non_neg_integer(), term()}]}

origin_accepting?(shard_index)

@spec origin_accepting?(non_neg_integer()) :: boolean()

origin_enqueue_ordered(shard_index, command)

@spec origin_enqueue_ordered(non_neg_integer(), command()) :: :ok | {:error, term()}

origin_submit(shard_index, command)

@spec origin_submit(non_neg_integer(), command()) :: :ok

origin_submit_batch(shard_index, commands)

@spec origin_submit_batch(non_neg_integer(), [command()]) :: :ok

origin_submit_batch_ordered(shard_index, commands)

@spec origin_submit_batch_ordered(non_neg_integer(), [command()]) ::
  :ok | {:error, term()}

origin_submit_ordered(shard_index, command)

@spec origin_submit_ordered(non_neg_integer(), command()) :: :ok | {:error, term()}

pause_writes_for_sync(shard_index, timeout \\ 30000)

@spec pause_writes_for_sync(non_neg_integer(), timeout()) :: :ok | {:error, term()}

remote_origin_from(origin_node, from)

@spec remote_origin_from(node(), GenServer.from()) :: GenServer.from()

resume_writes_for_sync(shard_index, timeout \\ 5000)

@spec resume_writes_for_sync(non_neg_integer(), timeout()) :: :ok | {:error, term()}

start_link(opts)

@spec start_link(keyword()) :: {:error, :removed}

write(shard_index, command)

@spec write(non_neg_integer(), command()) :: term()

write_async(shard_index, command, reply_to)

@spec write_async(non_neg_integer(), command(), GenServer.from()) :: :ok

write_async_quorum(shard_index, command, reply_to)

@spec write_async_quorum(non_neg_integer(), command(), GenServer.from()) :: :ok

write_async_quorum_forwarded(shard_index, command, reply_to, origin_node)

@spec write_async_quorum_forwarded(
  non_neg_integer(),
  command(),
  GenServer.from(),
  node()
) :: :ok

write_batch(shard_index, commands, reply_to)

@spec write_batch(non_neg_integer(), [command()], GenServer.from()) :: :ok

write_batch_forwarded(shard_index, commands, reply_to, origin_node)

@spec write_batch_forwarded(non_neg_integer(), [command()], GenServer.from(), node()) ::
  :ok

write_delete_batch(shard_index, keys, reply_to)

@spec write_delete_batch(non_neg_integer(), [binary()], GenServer.from()) :: :ok

write_delete_batch_forwarded(shard_index, keys, reply_to, origin_node)

@spec write_delete_batch_forwarded(
  non_neg_integer(),
  [binary()],
  GenServer.from(),
  node()
) :: :ok

write_put_batch(shard_index, entries, reply_to)

@spec write_put_batch(
  non_neg_integer(),
  [{binary(), binary(), non_neg_integer()}],
  GenServer.from()
) :: :ok

write_put_batch_forwarded(shard_index, entries, reply_to, origin_node)

@spec write_put_batch_forwarded(
  non_neg_integer(),
  [{binary(), binary(), non_neg_integer()}],
  GenServer.from(),
  node()
) :: :ok