barrel_rep_transport_local (barrel_docdb v1.1.1)
View Sourcebarrel_rep_transport_local - Local transport for replication
Transport implementation for replicating between databases in the same Erlang VM. The endpoint is simply the database name.
Summary
Functions
Get database info
Delete a local document
Which offered versions is this database missing?
Get changes since a sequence
Get a document for replication (tombstones included) with its version protocol metadata.
Get a local document
Put a local document
Apply a replicated version.
Synchronize local HLC with remote timestamp This ensures the local clock reflects causality with remote events. Note: HLC is global to the node, not per-database.
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().
-type db_name() :: binary().
-type docid() :: binary().
-type revid() :: binary().
-type seq() :: barrel_hlc:timestamp().
-type seq_string() :: binary().
-type view_name() :: binary().
Functions
Get database info
Delete a local document
-spec diff_versions(db_name(), #{docid() => binary()}) -> {ok, #{docid() => missing | have}} | {error, term()}.
Which offered versions is this database missing?
Get changes since a sequence
-spec get_doc(db_name(), docid(), map()) -> {ok, map(), map()} | {error, not_found} | {error, term()}.
Get a document for replication (tombstones included) with its version protocol metadata.
Get a local document
Put a local document
-spec put_version(db_name(), map(), binary(), binary(), boolean()) -> {ok, docid(), binary()} | {error, term()}.
Apply a replicated version.
-spec sync_hlc(db_name(), barrel_hlc:timestamp()) -> {ok, barrel_hlc:timestamp()} | {error, term()}.
Synchronize local HLC with remote timestamp This ensures the local clock reflects causality with remote events. Note: HLC is global to the node, not per-database.