ChangeID

data class ChangeID(val clientSeq: UInt, val lamport: Long, val actor: String, val versionVector: VersionVector, val serverSeq: Long = 0)

Identifies the Change.

Parameters

clientSeq

: is the sequence number of the client that created this change.

lamport

: lamport` is the lamport clock of this change. This is used to determine the order of changes in logical time. It is optional and only present if the change has operations.

actor

: is the creator of this change.

versionVector

: is the vector clock of this change. This is used to determine the relationship is causal or not between changes. It is optional and only present if the change has operations.

serverSeq

: is optional and only present for changes stored on the server.

Constructors

Link copied to clipboard
constructor(clientSeq: UInt, lamport: Long, actor: String, versionVector: VersionVector, serverSeq: Long = 0)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val serverSeq: Long = 0
Link copied to clipboard

Functions

Link copied to clipboard

Creates a ticket of the given delimiter.

Link copied to clipboard
fun next(excludeClocks: Boolean = false): ChangeID

Creates a next ID of this ID.

Link copied to clipboard
fun setActor(actorID: String): ChangeID

Sets the given actorID.

Link copied to clipboard
fun setClocks(otherLamport: Long, vector: VersionVector): ChangeID

setClocks sets the given clocks to this ID. This is used when the snapshot is given from the server.

Link copied to clipboard
fun setLamport(lamport: Long): ChangeID

setLamport sets the given lamport clock.

Link copied to clipboard

Sets the vector vector.

Link copied to clipboard

syncClocks syncs logical clocks with the given ID.

Link copied to clipboard

Advances the lamport clock against the given ID without merging its version vector into the receiver's. It is the counterpart of syncClocks for attachments that have opted out of GC participation: the receiver does not need other actors' entries in its version vector because it never produces or consumes tombstones, and dropping them keeps each subsequent local Change's version vector at O(1) instead of O(num_actors). Lamport must still advance so that TimeTickets produced locally remain ordered against remote operations.

fun syncLamport(otherLamport: Long): ChangeID

Syncs lamport timestamp with the given ID.