Behaviours: riak_dt.
References
http://hal.upmc.fr/inria-00555588/
See also: riak_kv_gcounter.
any_pncounter() = pncounter() | v1_pncounter()
decrement_op() = decrement | {decrement, pos_integer()}
abstract datatype: pncounter()
pncounter_op() = riak_dt_gcounter:gcounter_op() | decrement_op()
pncounter_q() = positive | negative
v1_pncounter() = {riak_dt_gcounter:gcounter(), riak_dt_gcounter:gcounter()}
version() = integer()
| change_versions/3 | |
| current_version/1 | |
| equal/2 | Are two pncounter()s structurally equal? This is not value/1 equality. |
| from_binary/1 | |
| merge/2 | Merge two pncounter()s to a single pncounter(). |
| new/0 | Create a new, empty pncounter() |
| new/2 | Create a pncounter() with an initial Value for Actor. |
| parent_clock/2 | no-op. |
| stat/2 | |
| stats/1 | |
| to_binary/1 | Encode an effecient binary representation of pncounter() |
| to_binary/2 | |
| to_version/2 | |
| update/3 | Update a pncounter(). |
| update/4 | |
| value/1 | The single, total value of a pncounter() |
| value/2 | query the parts of a pncounter()
valid queries are positive or negative. |
change_versions(Version::version(), X2::version(), PNCnt::any_pncounter()) -> any_pncounter()
current_version(PNCnt::any_pncounter()) -> version()
equal(PNCntA::pncounter(), PNCntB::pncounter()) -> boolean()
Are two pncounter()s structurally equal? This is not value/1 equality.
Two counters might represent the total -42, and not be equal/2. Equality here is
that both counters represent exactly the same information.
from_binary(B::binary()) -> {ok, any_pncounter()} | {error, unsupported_version, Vers::pos_integer()} | {error, invalid_binary}
merge(PNCntA::pncounter(), PNCntB::pncounter()) -> pncounter()
Merge two pncounter()s to a single pncounter(). This is the Least Upper Bound
function described in the literature.
new() -> pncounter()
Create a new, empty pncounter()
new(Actor::term(), Value::integer()) -> pncounter()
Create a pncounter() with an initial Value for Actor.
parent_clock(Clock::riak_dt_vclock:vclock(), Cntr::pncounter()) -> pncounter()
no-op
stat(X1::atom(), PNCounter::pncounter()) -> number() | undefined
stats(PNCounter::pncounter()) -> [{atom(), number()}]
to_binary(PNCnt::any_pncounter()) -> binary()
Encode an effecient binary representation of pncounter()
to_binary(Vers::version(), PNCnt::any_pncounter()) -> {ok, binary()} | {error, unsupported_version, Vers::pos_integer()}
to_version(ToVer::pos_integer(), C::any_pncounter()) -> any_pncounter()
update(Op::pncounter_op(), Actor::riak_dt:actor() | riak_dt:dot(), PNCnt::pncounter()) -> {ok, pncounter()}
Update a pncounter(). The first argument is either the atom
increment or decrement or the two tuples {increment, pos_integer()} or
{decrement, pos_integer()}. In the case of the former, the operation's amount
is 1. Otherwise it is the value provided in the tuple's second element.
Actor is any term, and the 3rd argument is the pncounter() to update.
pncounter()
update(Op, Actor, Cntr, Ctx) -> any()
value(PNCnt::pncounter()) -> integer()
The single, total value of a pncounter()
value(X1::pncounter_q(), PNCnt::pncounter()) -> integer()
query the parts of a pncounter()
valid queries are positive or negative.
Generated by EDoc