Ferricstore.Raft.CommandClock (ferricstore v0.4.1)

Copy Markdown View Source

Stamps Raft commands with a leader-side HLC timestamp before they enter the log.

The state machine uses the stamped physical millisecond for TTL and lock expiry decisions, making replay deterministic across replicas.

Summary

Types

hlc_ts()

@type hlc_ts() :: {non_neg_integer(), non_neg_integer()}

stamped_command()

@type stamped_command() :: {term(), %{hlc_ts: hlc_ts()}}

Functions

pipeline_command(shard_id, command, corr, priority)

@spec pipeline_command(term(), term(), reference() | integer(), atom()) :: term()

process_command(shard_id, command)

@spec process_command(term(), term()) :: term()

process_command(shard_id, command, opts)

@spec process_command(term(), term(), term()) :: term()

stamp(command)

@spec stamp(term()) :: stamped_command()

to_ttb(command)

@spec to_ttb(term()) :: {:ttb, binary()}