CausalTime

kofre.time.CausalTime
See theCausalTime companion object
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.

Attributes

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

Members list

Value members

Concrete methods

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product