barrel_p2p_ormap (barrel_p2p v0.1.0)

View Source

Summary

Types

dot/0

-type dot() :: {node(), barrel_p2p_hlc:timestamp()}.

entry/0

-type entry() :: value_entry() | tombstone_entry().

ormap/0

-type ormap() :: #{term() => entry()}.

tombstone_entry/0

-type tombstone_entry() :: {tombstone, barrel_p2p_hlc:timestamp()}.

value_entry/0

-type value_entry() :: {value, term(), #{dot() => true}}.

Functions

absorb_clock(Map)

-spec absorb_clock(ormap()) -> ok.

add(Key, Value, Map)

-spec add(term(), term(), ormap()) -> ormap().

gc_tombstones(Map, CutoffWallMs)

-spec gc_tombstones(ormap(), non_neg_integer()) -> ormap().

get(Key, Map)

-spec get(term(), ormap()) -> {ok, term()} | not_found.

get_entry(Key, Map)

-spec get_entry(term(), ormap()) -> {ok, entry()} | not_found.

is_empty(Map)

-spec is_empty(ormap()) -> boolean().

keys(Map)

-spec keys(ormap()) -> [term()].

merge(Map1, Map2)

-spec merge(ormap(), ormap()) -> ormap().

new()

-spec new() -> ormap().

remove(Key, Map)

-spec remove(term(), ormap()) -> ormap().

to_list(Map)

-spec to_list(ormap()) -> [{term(), term()}].