rdts.datatypes

package rdts.datatypes

Members list

Type members

Classlikes

case class EnableWinsFlag(set: Dots, unset: Dots)

An EWFlag (Enable-Wins Flag) is a Delta CRDT modeling a boolean flag.

An EWFlag (Enable-Wins Flag) is a Delta CRDT modeling a boolean flag.

When the flag is concurrently disabled and enabled then the enable operation wins, i.e. the resulting flag is enabled.

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
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
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 a causality preserving clock based on milliseconds, using a random value as a tie breaker. The random values are non-fair, so a specific replica is more likely to win.

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
case class MultiVersionRegister[A](repr: Map[Dot, A], removed: Dots)

An MultiVersionRegister (Multi-Value Register) is a Delta CRDT modeling a register.

An MultiVersionRegister (Multi-Value Register) is a Delta CRDT modeling a register.

In the absence of concurrent writes, the MultiVersionRegister is either empty or holds one value. When multiple values are written concurrently, reading the MultiVersionRegister returns a set holding all these values.

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
case class ObserveRemoveMap[K, V](inner: Map[K, Entry[V]], removed: Dots)

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 ReplicatedList[E](order: Epoch[GrowOnlyList[Dot]], elements: Map[Dot, LastWriterWins[E]], deleted: Dots)

An RGA (Replicated Growable Array) is a Delta CRDT modeling a list.

An RGA (Replicated Growable Array) is a Delta CRDT modeling a list.

When two values are concurrently inserted at an index i, the value of the insert operation with the later timestamp will be at index i while the earlier inserted value will be pushed to index i+1. When an element is subject to two concurrent updates, the later update overwrites the earlier update. If an element is concurrently updated and deleted, the element will simply be deleted, ignoring the update.

Note that RGAs are implemented as linked lists, thus the time needed to execute operations toward the end of the list will scale linearly with the size of the list.

To correctly handle concurrent remote inserts next to elements that were deleted locally, the RGA implementation internally keeps deleted elements as hidden tombstones in the list. Since many tombstones will slow down the operations on this data structure, purgeTombstones should be executed periodically to remove tombstones from the list. Note however that this invalidates any concurrent insert operations. Ideally, purgeTombstones should only be called in downtime periods and only by privileged replicas.

This implementation was modeled after the RGA proposed by Roh et al. in "Replicated abstract data types: Building blocks for collaborative applications", see here However, since then the implementation was changed significantly, thus it may be a different or even a novel strategy by now.

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
case class ReplicatedSet[E](inner: Map[E, Dots], deleted: Dots)

A set that allows deletes. Each unique element tracks the dots of when it was inserted. Removals do not override concurrent inserts.

A set that allows deletes. Each unique element tracks the dots of when it was inserted. Removals do not override concurrent inserts.

Attributes

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

Attributes

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