RandomKRegular

The k-regular partial mesh: a seeded random k-out sample of the roster (k = recommendedActiveViewSize(N), via partialView), re-drawn on roster churn. The union of every peer's independent draw is connected with high probability — see recommendedActiveViewSize.

random must be seeded per-peer by the caller (e.g. from the peer's identity) so peers choose independently — a shared seed would make every peer pick the same neighbours, collapsing the random graph. The policy owns all selection randomness; use one instance per node.

Constructors

Link copied to clipboard
constructor(random: Random)

Functions

Link copied to clipboard
open override fun activeView(self: PeerId, roster: Set<PeerId>): Set<PeerId>

The peers this node eager-floods to and GCs against, selected from roster (which includes self; the result never does). Called on every roster or liveness change with the currently-live members.

Link copied to clipboard
open override fun antiEntropyPool(self: PeerId, roster: Set<PeerId>): Set<PeerId>

The pool this node samples anti-entropy partners from — usually every other member (roster minus self); structural topologies may restrict it (e.g. tier-local). Never contains self.