Packages

c

akka.cluster

VectorClock

final case class VectorClock(versions: TreeMap[Node, Long] = ...) extends Product with Serializable

Representation of a Vector-based clock (counting clock), inspired by Lamport logical clocks.

Reference:
   1) Leslie Lamport (1978). "Time, clocks, and the ordering of events in a distributed system". Communications of the ACM 21 (7): 558-565.
   2) Friedemann Mattern (1988). "Virtual Time and Global States of Distributed Systems". Workshop on Parallel and Distributed Algorithms: pp. 215-226

Based on code from the 'vlock' VectorClock library by Coda Hale.

Annotations
@SerialVersionUID()
Source
VectorClock.scala
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. VectorClock
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new VectorClock(versions: TreeMap[Node, Long] = ...)

Value Members

  1. def :+(node: Node): VectorClock

    Increment the version for the node passed as argument.

    Increment the version for the node passed as argument. Returns a new VectorClock.

  2. def <(that: VectorClock): Boolean

    Returns true if this is before that else false.

  3. def <>(that: VectorClock): Boolean

    Returns true if this and that are concurrent else false.

  4. def ==(that: VectorClock): Boolean

    Returns true if this VectorClock has the same history as the 'that' VectorClock else false.

  5. def >(that: VectorClock): Boolean

    Returns true if this is after that else false.

  6. def compareTo(that: VectorClock): Ordering

    Compare two vector clocks.

    Compare two vector clocks. The outcome will be one of the following:

    1. Clock 1 is SAME (==)       as Clock 2 iff for all i c1(i) == c2(i)
    2. Clock 1 is BEFORE (<)      Clock 2 iff for all i c1(i) <= c2(i) and there exist a j such that c1(j) < c2(j)
    3. Clock 1 is AFTER (>)       Clock 2 iff for all i c1(i) >= c2(i) and there exist a j such that c1(j) > c2(j).
    4. Clock 1 is CONCURRENT (<>) to Clock 2 otherwise.
  7. def merge(that: VectorClock): VectorClock

    Merges this VectorClock with another VectorClock.

    Merges this VectorClock with another VectorClock. E.g. merges its versioned history.

  8. def prune(removedNode: Node): VectorClock
  9. def toString(): String
    Definition Classes
    VectorClock → AnyRef → Any
  10. val versions: TreeMap[Node, Long]