VersionVector

data class VersionVector(val vectorMap: MutableMap<String, Long> = mutableMapOf())

VersionVector is a vector clock used to detect relationships between changes, determining whether they are causally related or concurrent. It is similar to vector clocks but synced with the Lamport timestamp of the change.

Constructors

Link copied to clipboard
constructor(vectorMap: MutableMap<String, Long> = mutableMapOf())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard

Returns true if vector[other.actorID.value] is greater than or equal to the given ticket's Lamport.

Link copied to clipboard

Deep copy of this VersionVector.

Link copied to clipboard
fun filter(versionVector: VersionVector): VersionVector

Returns a new VersionVector consisting of entries filtered by the given VersionVector.

Link copied to clipboard
fun get(actorID: String): Long?

Gets the Lamport timestamp for the given actor.

Link copied to clipboard

Allows iteration over the VersionVector.

Link copied to clipboard

Returns a new VersionVector consisting of the maximum values of each vector.

Link copied to clipboard

Returns the maximum Lamport value from the vector.

Link copied to clipboard
fun set(actorID: String, lamport: Long)

Sets the Lamport timestamp for the given actor.

Link copied to clipboard
fun size(): Int

Returns the size of the VersionVector.