Module riak_core_metadata_object

Data Types

metadata_context()

metadata_context() = dvvset:vector()

metadata_modifier()

metadata_modifier() = fun(([metadata_value() | metadata_tombstone()] | undefined) -> metadata_value())

metadata_object()

metadata_object() = {metadata, dvvset:clock()}

metadata_tombstone()

metadata_tombstone() = '$deleted'

metadata_value()

metadata_value() = any()

Function Index

context/1returns the context (opaque causal history) for the given object.
empty_context/0returns the representation for an empty context (opaque causal history).
equal_context/2Returns true if the given context and the context of the existing object are equal.
hash/1returns a hash representing the metadata objects contents.
is_stale/2Determines if the given context (version vector) is causually newer than an existing object.
modify/4modifies a potentially existing object, setting its value and updating the causual history.
reconcile/2Reconciles a remote object received during replication or anti-entropy with a local object.
resolve/2Resolves siblings using either last-write-wins or the provided function and returns an object containing a single value.
value/1returns a single value.
value_count/1returns the number of siblings in the given object.
values/1returns a list of values held in the object.

Function Details

context/1

context(X1::metadata_object()) -> metadata_context()

returns the context (opaque causal history) for the given object

empty_context/0

empty_context() -> metadata_context()

returns the representation for an empty context (opaque causal history)

equal_context/2

equal_context(Context::metadata_context(), X2::metadata_object()) -> boolean()

Returns true if the given context and the context of the existing object are equal

hash/1

hash(X1::metadata_object()) -> binary()

returns a hash representing the metadata objects contents

is_stale/2

is_stale(RemoteContext::metadata_context(), X2::metadata_object()) -> boolean()

Determines if the given context (version vector) is causually newer than an existing object. If the object missing or if the context does not represent an anscestor of the current key, false is returned. Otherwise, when the context does represent an ancestor of the existing object or the existing object itself, true is returned

modify/4

modify(Obj::metadata_object() | undefined, Context::metadata_context(), Fun::metadata_value() | metadata_modifier(), ServerId::term()) -> metadata_object()

modifies a potentially existing object, setting its value and updating the causual history. If a function is provided as the third argument then this function also is used for conflict resolution. The difference between this function and resolve/2 is that the logical clock is advanced in the case of this function. Additionally, the resolution functions are slightly different.

reconcile/2

reconcile(RemoteObj::metadata_object(), LocalObj::metadata_object() | undefined) -> false | {true, metadata_object()}

Reconciles a remote object received during replication or anti-entropy with a local object. If the remote object is an anscestor of or is equal to the local one false is returned, otherwise the reconciled object is returned as the second element of the two-tuple

resolve/2

resolve(X1::metadata_object(), Reconcile::lww | fun(([metadata_value()]) -> metadata_value())) -> metadata_object()

Resolves siblings using either last-write-wins or the provided function and returns an object containing a single value. The causal history is not updated

value/1

value(Metadata::metadata_object()) -> metadata_value()

returns a single value. if the object holds more than one value an error is generated

See also: values/2.

value_count/1

value_count(X1::metadata_object()) -> non_neg_integer()

returns the number of siblings in the given object

values/1

values(X1::metadata_object()) -> [metadata_value()]

returns a list of values held in the object


Generated by EDoc