An immutable, contiguous VSR operation log.
Summary
Types
@type t() :: %ViewstampedReplication.Log{ base_op_number: non_neg_integer(), entries: [ViewstampedReplication.LogEntry.t()] }
Functions
@spec append(t(), ViewstampedReplication.LogEntry.t()) :: {:ok, t()} | {:error, term()}
@spec append!(t(), ViewstampedReplication.LogEntry.t()) :: t()
@spec compact(t(), non_neg_integer()) :: {:ok, t()} | {:error, term()}
@spec fetch(t(), pos_integer()) :: {:ok, ViewstampedReplication.LogEntry.t()} | :compacted | :error
@spec fetch!(t(), pos_integer()) :: ViewstampedReplication.LogEntry.t()
@spec last(t()) :: ViewstampedReplication.LogEntry.t() | nil
@spec last_op_number(t()) :: non_neg_integer()
@spec new() :: t()
@spec new([ViewstampedReplication.LogEntry.t()]) :: {:ok, t()} | {:error, term()}
@spec new(non_neg_integer(), [ViewstampedReplication.LogEntry.t()]) :: {:ok, t()} | {:error, term()}
@spec suffix(t(), non_neg_integer()) :: [ViewstampedReplication.LogEntry.t()]
@spec to_list(t()) :: [ViewstampedReplication.LogEntry.t()]
@spec truncate_suffix(t(), non_neg_integer()) :: t()