metadata_context() = dvvset:vector()
metadata_modifier() = fun(([metadata_value() | metadata_tombstone()] | undefined) -> metadata_value())
metadata_object() = {metadata, dvvset:clock()}
metadata_tombstone() = '$deleted'
metadata_value() = any()
| context/1 | returns the context (opaque causal history) for the given object. |
| empty_context/0 | returns the representation for an empty context (opaque causal history). |
| equal_context/2 | Returns true if the given context and the context of the existing object are equal. |
| hash/1 | returns a hash representing the metadata objects contents. |
| is_stale/2 | Determines if the given context (version vector) is causually newer than an existing object. |
| modify/4 | modifies a potentially existing object, setting its value and updating the causual history. |
| reconcile/2 | Reconciles a remote object received during replication or anti-entropy with a local object. |
| resolve/2 | Resolves siblings using either last-write-wins or the provided function and returns an object containing a single value. |
| value/1 | returns a single value. |
| value_count/1 | returns the number of siblings in the given object. |
| values/1 | returns a list of values held in the object. |
context(X1::metadata_object()) -> metadata_context()
returns the context (opaque causal history) for the given object
empty_context() -> metadata_context()
returns the representation for an empty context (opaque causal history)
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(X1::metadata_object()) -> binary()
returns a hash representing the metadata objects contents
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(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(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(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(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(X1::metadata_object()) -> non_neg_integer()
returns the number of siblings in the given object
values(X1::metadata_object()) -> [metadata_value()]
returns a list of values held in the object
Generated by EDoc