Ferricstore.Store.CompoundCommand (ferricstore v0.4.3)

Copy Markdown View Source

Builds the default Raft command contract for compound-key writes.

Router and the remaining Shard Raft-proxy helpers must use this module instead of hand-building equivalent tuples. Custom/direct shard calls still carry the Redis key because the local shard handler needs it for promotion and index bookkeeping; replicated default-instance commands keep the lean shape applied by Ferricstore.Raft.StateMachine.

Summary

Types

batch_put_entry()

@type batch_put_entry() :: {binary(), binary(), non_neg_integer()}

Functions

batch_delete(redis_key, compound_keys)

@spec batch_delete(binary(), [binary()]) ::
  {:compound_batch_delete, binary(), [binary()]}

batch_put(redis_key, entries)

@spec batch_put(binary(), [batch_put_entry()]) ::
  {:compound_batch_put, binary(), [batch_put_entry()]}

delete(compound_key)

@spec delete(binary()) :: {:compound_delete, binary()}

delete_prefix(prefix)

@spec delete_prefix(binary()) :: {:compound_delete_prefix, binary()}

normalize_batch_reply(error)

@spec normalize_batch_reply(term()) :: :ok | {:error, term()}

put(compound_key, value, expire_at_ms)

@spec put(binary(), binary(), non_neg_integer()) ::
  {:compound_put, binary(), binary(), non_neg_integer()}