Module riak_dt_lwwreg

An LWW Register CRDT.

Behaviours: riak_dt.

References

Description

An LWW Register CRDT.

Data Types

lww_q()

lww_q() = timestamp

lwwreg()

abstract datatype: lwwreg()

lwwreg_op()

lwwreg_op() = {assign, term(), non_neg_integer()} | {assign, term()}

Function Index

equal/2Are two lwwreg()s structurally equal? This is not value/1 equality.
from_binary/1Decode binary lwwreg()
merge/2Merge two lwwreg()s to a single lwwreg().
new/0Create a new, empty lwwreg()
parent_clock/2
stat/2
stats/1
to_binary/1Encode an effecient binary representation of an lwwreg()
to_binary/2
to_version/2
update/3Assign a Value to the lwwreg() associating the update with time TS
update/4
value/1The single total value of a gcounter().
value/2query for this lwwreg().

Function Details

equal/2

equal(X1::lwwreg(), X2::lwwreg()) -> boolean()

Are two lwwreg()s structurally equal? This is not value/1 equality. Two registers might represent the value armchair, and not be equal/2. Equality here is that both registers contain the same value and timestamp.

from_binary/1

from_binary(B::binary()) -> {ok, lwwreg()} | {error, unsupported_version, Vers::pos_integer()} | {error, invalid_binary}

Decode binary lwwreg()

merge/2

merge(LWWReg1::lwwreg(), LWWReg2::lwwreg()) -> lwwreg()

Merge two lwwreg()s to a single lwwreg(). This is the Least Upper Bound function described in the literature.

new/0

new() -> lwwreg()

Create a new, empty lwwreg()

parent_clock/2

parent_clock(Clock::riak_dt_vclock:vclock(), Reg::lwwreg()) -> lwwreg()

stat/2

stat(X1::atom(), LWW::lwwreg()) -> number() | undefined

stats/1

stats(LWW::lwwreg()) -> [{atom(), number()}]

to_binary/1

to_binary(LWWReg::lwwreg()) -> binary()

Encode an effecient binary representation of an lwwreg()

to_binary/2

to_binary(Vers::pos_integer(), LWW::lwwreg()) -> {ok, binary()} | {error, unsupported_version, Vers::pos_integer()}

to_version/2

to_version(Version::pos_integer(), LWW::lwwreg()) -> lwwreg()

update/3

update(X1::lwwreg_op(), Actor::term(), OldLWWReg::lwwreg()) -> {ok, lwwreg()}

Assign a Value to the lwwreg() associating the update with time TS

update/4

update(Op, Actor, Reg, Ctx) -> any()

value/1

value(X1::lwwreg()) -> term()

The single total value of a gcounter().

value/2

value(X1::lww_q(), X2::lwwreg()) -> non_neg_integer()

query for this lwwreg(). timestamp is the only query option.


Generated by EDoc