barrel_rep_checkpoint (barrel_docdb v1.0.0)
View Sourcebarrel_rep_checkpoint - Checkpoint management for replication
Manages replication checkpoints, which track the progress of replication between source and target databases. Checkpoints are stored as local documents (not replicated).
Summary
Functions
Decode HLC timestamp from storage
Delete checkpoints from both databases
Encode HLC timestamp for storage in checkpoint
Get the last processed HLC
Get the starting HLC for this replication session
Check if checkpoint should be written and write it if needed
Create a new checkpoint state
Read checkpoint document
Set the last processed sequence (HLC timestamp)
Write checkpoint to both source and target databases
Types
-type att_info() :: #{name := binary(), content_type := binary(), length := non_neg_integer(), digest := binary(), chunked => boolean(), chunk_size => pos_integer(), chunk_count => pos_integer()}.
-type change() :: map().
-opaque checkpoint()
-type db_name() :: binary().
-type docid() :: binary().
-type revid() :: binary().
-type seq() :: barrel_hlc:timestamp().
-type seq_string() :: binary().
-type view_name() :: binary().
Functions
Decode HLC timestamp from storage
-spec delete(checkpoint()) -> ok.
Delete checkpoints from both databases
Encode HLC timestamp for storage in checkpoint
-spec get_last_seq(checkpoint()) -> barrel_hlc:timestamp() | first.
Get the last processed HLC
-spec get_start_seq(checkpoint()) -> barrel_hlc:timestamp() | first.
Get the starting HLC for this replication session
-spec maybe_write_checkpoint(checkpoint()) -> checkpoint().
Check if checkpoint should be written and write it if needed
-spec new(map()) -> checkpoint().
Create a new checkpoint state
Read checkpoint document
-spec set_last_seq(barrel_hlc:timestamp() | first, checkpoint()) -> checkpoint().
Set the last processed sequence (HLC timestamp)
-spec write_checkpoint(checkpoint()) -> ok.
Write checkpoint to both source and target databases