Class PaintOp

java.lang.Object
protocols.apps.canvas.PaintOp

public final class PaintOp extends Object
A single paint operation: "cell (x,y) becomes colour argb". This is the atomic unit the canvas disseminates by gossip and the unit it stores per cell.

Last-writer-wins (why the canvas converges)

Each op carries a timestamp (the painter's wall clock at paint time) and the painter's originId. A cell keeps whichever op is the winner under the total order in isNewerThan(protocols.apps.canvas.PaintOp): higher timestamp first, ties broken by originId then opId. Because that order is total and deterministic, any two nodes that have applied the same set of ops hold the identical winner in every cell — independent of the order the gossip waves delivered them. Convergence is therefore a property of dissemination completeness alone, which is exactly what the experiments harness measures.

opId is a globally-unique identifier for the op, assigned once at the origin. It is the final tie-breaker, and the stable key the telemetry uses to correlate "broadcast on node A" with "delivered on node B".

  • Constructor Details

    • PaintOp

      public PaintOp(int x, int y, int argb, long timestamp, String originId, UUID opId)
  • Method Details