kofre.datatypes

package kofre.datatypes

Members list

Type members

Classlikes

case class Epoch[E](counter: Time, value: E)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Epoch

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Epoch.type
case class GrowOnlyCounter(inner: Map[Uid, Int])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

A GCounter is a Delta CRDT modeling an increment-only counter.

A GCounter is a Delta CRDT modeling an increment-only counter.

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class GrowOnlyList[E](inner: Map[Node[LastWriterWins[E]], Elem[LastWriterWins[E]]])

A GrowOnlyList is a Delta CRDT modeling a grow-only list where list elements can neither be removed nor modified.

A GrowOnlyList is a Delta CRDT modeling a grow-only list where list elements can neither be removed nor modified.

Concurrent inserts at the same index i are resolved by the timestamps of the insert operations: the later insert will be at index i while the earlier insert will be pushed to index i+1.

Note: GrowOnlyList is implemented as a linked list, thus the time needed to execute operations at the end of the list will scale linearly with the length of the list. Similarly, toList always has to iterate the whole list, so for applications that don't always need the whole list you should consider using toLazyList instead.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object GrowOnlyList

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
object GrowOnlyMap

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object GrowOnlySet

A GrowOnlySet is a Delta CRDT modeling a simple grow-only set.

A GrowOnlySet is a Delta CRDT modeling a simple grow-only set.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class LastWriterWins[+A](timestamp: CausalTime, payload: A)

A LastWriterWins (register) is a common fallback for datatypes that don’t have good merge semantics.

A LastWriterWins (register) is a common fallback for datatypes that don’t have good merge semantics.

Concurrent writes are resolved by wallclock time first (favouring replicas with clock drift into the future), and by replica ID, in case both writes happened in the same millisecond.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object PosNegCounter

A PNCounter (Positive-Negative Counter) is a Delta CRDT modeling a counter.

A PNCounter (Positive-Negative Counter) is a Delta CRDT modeling a counter.

It is composed of two grow-only counters (see GrowOnlyCounter) to enable both increments and decrements of the counter value.

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class TwoPhaseSet[E](added: Set[E], removed: Set[E])

A TwoPhaseSet (Two-Phase Set) is a Delta CRDT modeling a set.

A TwoPhaseSet (Two-Phase Set) is a Delta CRDT modeling a set.

The set is modeled as two grow-only sets, a set of added elements and a set of removed elements. Because of this, elements that were removed from the set once can never be re-added.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object TwoPhaseSet

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

Types

type GrowOnlyMap[K, V] = Map[K, V]

A GMap (Grow-only Map) is a Delta CRDT that models a map from an arbitrary key type to nested Delta CRDTs. In contrast to kofre.datatypes.contextual.ObserveRemoveMap, key/value pairs cannot be removed from this map. However, due to the smaller internal representation, mutate operations on large maps are a lot faster than on ObserveRemoveMap.

A GMap (Grow-only Map) is a Delta CRDT that models a map from an arbitrary key type to nested Delta CRDTs. In contrast to kofre.datatypes.contextual.ObserveRemoveMap, key/value pairs cannot be removed from this map. However, due to the smaller internal representation, mutate operations on large maps are a lot faster than on ObserveRemoveMap.

The nested CRDTs can be queried/mutated by calling the queryKey/mutateKey methods with a DeltaQuery/DeltaMutator generated by a CRDT Interface method of the nested CRDT. For example, to enable a nested EWFlag, one would pass EWFlagInterface.enable() as the DeltaMutator to mutateKey.

Attributes

type GrowOnlySet[E] = Set[E]