kofre.time

package kofre.time

Members list

Type members

Classlikes

class ArrayRanges(val inner: Array[Time], val used: Int)

Efficient storage of a set of Time when most stored values are contiguous ranges.

Efficient storage of a set of Time when most stored values are contiguous ranges.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object ArrayRanges

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
case class CausalTime(time: Time, causal: Long, random: Long)

This is a causally consistent wall-time clock that provides a total order in a distributed environment. It tries to be just wall-time clock if possible – this is the case when no updates happen “concurrently” where the concurrency window depends on the accuracy of different clocks (this is on the order of milliseconds even with well synchronized clocks). In case where there is clock drift, it may happen that the current wall-time clock is behind the observed time. Then we fall back to increasing the causal counter. This works, but has a weird “whoever does the most updates is the newest” semantics, which is undesirable in many practical use-cases. The random parameter is used for enforcing totality in cases where the causal values also happen to collide. It is slightly preferrable if random is monotonically increasing on a single replica, as then updates within the same millisecond from the same replica do not need to increment the causal counter.

This is a causally consistent wall-time clock that provides a total order in a distributed environment. It tries to be just wall-time clock if possible – this is the case when no updates happen “concurrently” where the concurrency window depends on the accuracy of different clocks (this is on the order of milliseconds even with well synchronized clocks). In case where there is clock drift, it may happen that the current wall-time clock is behind the observed time. Then we fall back to increasing the causal counter. This works, but has a weird “whoever does the most updates is the newest” semantics, which is undesirable in many practical use-cases. The random parameter is used for enforcing totality in cases where the causal values also happen to collide. It is slightly preferrable if random is monotonically increasing on a single replica, as then updates within the same millisecond from the same replica do not need to increment the causal counter.

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
CausalTime.type
case class Dot(place: Uid, time: Time)

A Dot is a globally unique point in time. Dots are partially ordered by their time per replicaId.

A Dot is a globally unique point in time. Dots are partially ordered by their time per replicaId.

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Dot.type
case class Dots(internal: Map[Uid, ArrayRanges])

Essentially a more efficient version of a Set. It typically tracks all dots known within some scope.

Essentially a more efficient version of a Set. It typically tracks all dots known within some scope.

This datastructure is used both for implementation of RDTs, as well as for ensuring causality during replication.

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Dots.type
object Time

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Time.type
case class VectorClock(timestamps: Map[Uid, Time])

Attributes

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

Attributes

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

Types

type Time = Long