RgaId

@Serializable
data class RgaId(val lamport: Long, val replicaId: ReplicaId, val seq: Long) : Comparable<RgaId>

A unique, totally-ordered identity for a single RGA element.

Carries two orthogonal counters:

  • lamport — the total-order tiebreak used by computeSequence. Monotonic per author but not dense (the clock jumps to max(seen) + 1).

  • seq — a dense, contiguous per-author delivery counter (1, 2, 3, …). This is the quantity Lamports cannot provide: it certifies contiguous delivery, so it is the key into the causal-stability version vectors used by Rga.compact (ADR-003 addendum v3, #262). seq never participates in ordering.

Total order (compareTo): higher lamport wins; replicaId breaks ties deterministically. seq is deliberately excluded — it tracks delivery, not order. Two real ids from the same author can never share a lamport (an author's clock is strictly monotonic), so the order is still total.

The special sentinel HEAD sorts before every real id and is used as the "insert at front" predecessor; its seq is 0 (it is never an author dot).

Constructors

Link copied to clipboard
constructor(lamport: Long, replicaId: ReplicaId, seq: Long)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val dot: Dot

This id's causal Dot(replicaId, seq). The key into causal-stability VVs.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val seq: Long

Functions

Link copied to clipboard
open operator override fun compareTo(other: RgaId): Int