View Source ExWal.Recycler protocol (ex_wal v0.3.0)
The Recycler protocol defines the behaviour of a WAL file recycler.
Summary
Functions
get_min returns the current minimum log number that is allowed to be recycled.
Add attempts to recycle the log file specified by file. Returns true if the log file should not be deleted (i.e. the log is being recycled), and false otherwise.
Peek returns the log at the head of the recycling queue, or the zero value fileInfo and false if the queue is empty.
Pop removes the log number at the head of the recycling queue, enforcing that it matches the specified seq. An error is returned of the recycling queue is empty or the head log number does not match the specified one.
set_min sets the minimum log number that is allowed to be recycled.
Types
@type log() :: ExWal.Models.VirtualLog.t()
@type log_num() :: ExWal.Models.VirtualLog.log_num()
@type t() :: term()
All the types that implement this protocol.
Functions
get_min returns the current minimum log number that is allowed to be recycled.
@spec initialize(impl :: t(), capacity :: non_neg_integer()) :: :ok
Add attempts to recycle the log file specified by file. Returns true if the log file should not be deleted (i.e. the log is being recycled), and false otherwise.
Peek returns the log at the head of the recycling queue, or the zero value fileInfo and false if the queue is empty.
Pop removes the log number at the head of the recycling queue, enforcing that it matches the specified seq. An error is returned of the recycling queue is empty or the head log number does not match the specified one.
set_min sets the minimum log number that is allowed to be recycled.
@spec stop(impl :: t()) :: :ok