ETS-backed bounded change log for Concord.
Stores %Event{} records keyed by {revision, op_index} in an
:ordered_set ETS table. Supports range queries for historical replay
and automatic compaction to bound memory usage.
Summary
Functions
Appends events to the change log. Called from the state machine on every mutation.
Returns events in the revision range [from, to] (inclusive).
Compacts the change log to keep only entries after keep_revision.
Returns the earliest revision still in the change log, or 0 if empty.
Ensures the change log ETS table exists.
Functions
@spec append([Concord.Sync.Event.t()]) :: :ok
Appends events to the change log. Called from the state machine on every mutation.
@spec changes(non_neg_integer(), non_neg_integer(), keyword()) :: [ Concord.Sync.Event.t() ]
Returns events in the revision range [from, to] (inclusive).
@spec compact(non_neg_integer()) :: non_neg_integer()
Compacts the change log to keep only entries after keep_revision.
@spec earliest_revision() :: non_neg_integer()
Returns the earliest revision still in the change log, or 0 if empty.
Ensures the change log ETS table exists.