Interface ReconcilableState
- All Known Implementing Classes:
CredentialRevocationRegistry, RevocationRegistry
public interface ReconcilableState
A piece of replicated state that participates in anti-entropy (spec ยง5.3). The
gossip bus periodically sends this state's
digest() to one random
partner; the partner answers with deltaFor(byte[]) computed against
that digest, and the asker applies it via applyDelta(byte[]). Digest
and delta encodings are opaque to the bus and owned by the state.
Implementations must make applyDelta idempotent and commutative,
which CRDT-backed states are by construction.
-
Method Summary
Modifier and TypeMethodDescriptionvoidapplyDelta(byte[] delta) Merges a delta produced by another replica'sdeltaFor(byte[]).byte[]deltaFor(byte[] remoteDigest) Computes the delta a remote replica is missing, given its digest.byte[]digest()Returns a compact summary of everything this replica holds.
-
Method Details
-
digest
byte[] digest()Returns a compact summary of everything this replica holds. -
deltaFor
byte[] deltaFor(byte[] remoteDigest) Computes the delta a remote replica is missing, given its digest.- Parameters:
remoteDigest- the remote replica's digest- Returns:
- delta bytes for
applyDelta(byte[]); empty array when nothing is missing
-
applyDelta
void applyDelta(byte[] delta) Merges a delta produced by another replica'sdeltaFor(byte[]).- Parameters:
delta- the delta bytes
-