CrdtType class sealed

The conflict-resolution rule for a single field of a document.

A MergeStrategy assigns one CrdtType to each field path it produces. The engine stores the type alongside the field's CRDT record and, when two peers hold different values for that record, merges them according to the type:

  • LwwRegister — last-write-wins by Hybrid Logical Clock. The default, and the behaviour of every field before per-field types existed.
  • OrSet — an observed-remove set: concurrent adds and removes both take effect, with an add winning over a remove that did not observe it.
  • PnCounter — a positive/negative counter whose value is the sum of every peer's deltas, so concurrent increments all count.

The hierarchy is sealed so a later sequence or text CRDT can be added without changing the MergeStrategy interface.

The merge itself happens in TypedCrdtTable, the layer that wraps every collection's storage engine; the engine only records the type's tag alongside the record.

Implementers

Properties

hashCode → int
The hash code for this object.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tag → String
A stable short identifier persisted in the engine's crdt_type column.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override