MoveOp

@Serializable
class MoveOp<V>(val ts: Long, val replica: ReplicaId, val node: String, val newParent: String, val value: V?, val seq: Long)

One move operation: "set the parent of node to newParent".

When node is freshly created by MovableTree.addNode, value carries the initial value for the node. For plain reparents (from MovableTree.move), value is null — the node's value was set when it was first created and never changes.

The (ts, replica) pair is the logical timestamp that determines the operation's position in the total replay order. Two ops with the same pair are treated as identical (idempotency); callers must ensure uniqueness per replica.

seq is a dense per-replica delivery counter (1, 2, 3, …) used by the causal-stability GC machinery. It is assigned at op-creation time by the replica named in replica and is separate from ts (which is a Lamport clock, not dense). The dot property (Dot(replica, seq)) is the causal identifier consumed by Quilter.

Logical identity is (ts, replica)seq is a delivery-tracking field that does not participate in equals or hashCode. Two ops with the same (ts, replica) represent the same logical operation; the one with the higher seq is canonical (minted by the true author). [insertSorted] deduplicates by (ts, replica) and retains the op with the higher seq so the canonical author's seq survives merges.

Wire-format note: adding seq is a breaking change. This is intentional and cheap pre-1.0 (see docs/op-log-crdt-compaction.md, #725).

Constructors

Link copied to clipboard
constructor(ts: Long, replica: ReplicaId, node: String, newParent: String, value: V?, seq: Long)

Properties

Link copied to clipboard
val dot: Dot

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

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

Dense per-replica delivery sequence number. Used by MovableTree.causalDots for GC.

Link copied to clipboard
val ts: Long
Link copied to clipboard
val value: V?

Functions

Link copied to clipboard
fun copy(ts: Long = this.ts, replica: ReplicaId = this.replica, node: String = this.node, newParent: String = this.newParent, value: V? = this.value, seq: Long = this.seq): MoveOp<V>
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Logical identity is (ts, replica) — seq is a delivery-tracking field.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String