kofre.datatypes

Members list

Concise view

Type members

Classlikes

case class AddWinsSet[E](inner: DotMap[E, DotSet])

An AddWinsSet (Add-Wins Set) is a Delta CRDT modeling a set.

An AddWinsSet (Add-Wins Set) is a Delta CRDT modeling a set.

When an element is concurrently added and removed/cleared from the set then the add operation wins, i.e. the resulting set contains the element.

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object AddWinsSet

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class EnableWinsFlag(inner: DotSet)

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
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class Epoche[E](counter: Time, value: E)

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object Epoche

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Epoche.type
case class GrowMap[K, V](inner: 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 ORMapInterface, 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 ORMapInterface, 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

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object GrowMap

Attributes

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

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

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
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ObserveRemoveMap[K, V](inner: DotMap[K, V])

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

An ObserveRemoveMap (Observed-Remove Map) is a Delta CRDT that models a map from an arbitrary key type to nested causal Delta CRDTs. In contrast to GrowMap, ObserveRemoveMap allows the removal of key/value pairs from the map.

An ObserveRemoveMap (Observed-Remove Map) is a Delta CRDT that models a map from an arbitrary key type to nested causal Delta CRDTs. In contrast to GrowMap, ObserveRemoveMap allows the removal of key/value pairs from the map.

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

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

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

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 GCounterInterface) to enable both increments and decrements of the counter value.

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class RGA[E](order: Epoche[GList[Dot]], meta: DotFun[RGANode[E]])

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

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object RGA

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
RGA.type
case class TimedVal[A](value: A, replicaID: String, nanoTime: Long, timestamp: Long)

TimedVal is a case class for values that allows chronological ordering of values based on their time of creation. In the case that two values from two different replicas have the exact same timestamp, the lexical ordering of the ids of the two replicas is used to decide the ordering of the values. If two values from the same replica have the same timestamp, then the higher-resolution local nanoTime is used to decide ordering.

TimedVal is a case class for values that allows chronological ordering of values based on their time of creation. In the case that two values from two different replicas have the exact same timestamp, the lexical ordering of the ids of the two replicas is used to decide the ordering of the values. If two values from the same replica have the same timestamp, then the higher-resolution local nanoTime is used to decide ordering.

Instead of the default constructor, it is recommended that you use the apply method of the companion object which automatically fills in the timestamp and nanoTime using System.currentTimeMillis() and System.nanoTime() respectively.

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
object TimedVal

Attributes

Companion:
class
Graph
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
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

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