Ferricstore.Raft.Backend (ferricstore v0.4.0)

Copy Markdown View Source

Runtime write backend.

WARaft is the only supported production path. Runtime selection is fixed here so deploys and benchmarks cannot drift through config flags.

Summary

Functions

running()

@spec running() :: :waraft | :undefined

Returns the backend used by the currently running default application.

This is intentionally separate from selected/0: default-instance runtime routing must stay pinned to the backend that actually booted.

running_or_selected()

@spec running_or_selected() :: :waraft

running_waraft?()

@spec running_waraft?() :: boolean()

selected()

@spec selected() :: :waraft

waraft?()

@spec waraft?() :: boolean()

write(shard_index, command)

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

write_batch(shard_index, commands)

@spec write_batch(non_neg_integer(), [tuple()]) :: term()

write_delete_batch(shard_index, keys)

@spec write_delete_batch(non_neg_integer(), [binary()]) :: term()

write_many(shard_commands)

@spec write_many([{non_neg_integer(), tuple()}]) :: [term()]

write_put_batch(shard_index, entries)

@spec write_put_batch(non_neg_integer(), [{binary(), binary(), non_neg_integer()}]) ::
  term()