Protocol definitions and data types for distributed state sharing.
This namespace defines the core abstractions:
Protocol definitions and data types for distributed state sharing. This namespace defines the core abstractions: - NodeInfo: cluster member information - SyncableState: versioned state that can be synchronized - GossipMessage: messages exchanged between nodes - IStateProvider: protocol for modules that provide syncable state
(alive-message sender incarnation)Create an alive message to refute suspicion.
Create an alive message to refute suspicion.
(current-version)Get current Lamport timestamp without incrementing.
Get current Lamport timestamp without incrementing.
Types of cluster events that can be subscribed to.
Types of cluster events that can be subscribed to.
(generate-node-id)Generate a unique node ID.
Generate a unique node ID.
(gossip-message->map msg)Convert GossipMessage to a plain map for serialization.
Convert GossipMessage to a plain map for serialization.
Protocol for modules that provide syncable state.
Protocol for modules that provide syncable state.
(apply-remote-state this states)Apply received remote states. Called when gossip brings updates. Returns {:applied n :conflicts n :rejected n}.
Apply received remote states. Called when gossip brings updates.
Returns {:applied n :conflicts n :rejected n}.(get-state-digest this)Return a digest map of [state-type key] -> version. Used for efficient delta sync.
Return a digest map of [state-type key] -> version. Used for efficient delta sync.
(get-sync-state this)Return current state as a vector of SyncableState records. Called periodically for anti-entropy sync.
Return current state as a vector of SyncableState records. Called periodically for anti-entropy sync.
(on-node-failure this node-id)Called when a cluster node is confirmed dead. Opportunity to promote shadow state, claim ownership, etc.
Called when a cluster node is confirmed dead. Opportunity to promote shadow state, claim ownership, etc.
(provider-type this)Return keyword identifying this provider type (e.g., :health, :circuit-breaker)
Return keyword identifying this provider type (e.g., :health, :circuit-breaker)
(join-message sender node-info)Create a join message when node joins cluster.
Create a join message when node joins cluster.
(leave-message sender)Create a leave message when node gracefully leaves.
Create a leave message when node gracefully leaves.
(make-event event-type node-id data)Create a cluster event.
Create a cluster event.
(make-message msg-type sender)(make-message msg-type sender target states digest payload)Create a gossip message.
Create a gossip message.
(make-node-info node-id address)(make-node-info node-id address metadata)Create a new NodeInfo record.
Create a new NodeInfo record.
(make-syncable-state state-type key value version source-node)Create a new SyncableState record.
Create a new SyncableState record.
(map->gossip-message m)Convert a plain map back to GossipMessage.
Convert a plain map back to GossipMessage.
(map->node-info m)Convert a plain map back to NodeInfo.
Convert a plain map back to NodeInfo.
(map->syncable-state m)Convert a plain map back to SyncableState.
Convert a plain map back to SyncableState.
(newer? a b)Check if state a is newer than state b based on version (Lamport timestamp).
Check if state a is newer than state b based on version (Lamport timestamp).
(next-version)Get next Lamport timestamp and increment clock.
Get next Lamport timestamp and increment clock.
(node-info->map node-info)Convert NodeInfo to a plain map for serialization.
Convert NodeInfo to a plain map for serialization.
(ping-ack-message sender target seq-num)Create a ping acknowledgment.
Create a ping acknowledgment.
(ping-message sender target seq-num)Create a ping message for failure detection.
Create a ping message for failure detection.
(ping-req-message sender intermediary target seq-num)Create an indirect ping request.
Create an indirect ping request.
(pull-message sender digest)Create a pull message with state digest.
Create a pull message with state digest.
(push-message sender states)Create a push message with state updates.
Create a push message with state updates.
(push-pull-message sender states digest)Create a push-pull message for bidirectional sync.
Create a push-pull message for bidirectional sync.
(reset-clock!)Reset Lamport clock (for testing).
Reset Lamport clock (for testing).
(state-key state)Generate a compound key for a SyncableState.
Generate a compound key for a SyncableState.
(suspect-message sender suspect-node incarnation)Create a suspect message when node may have failed.
Create a suspect message when node may have failed.
(syncable-state->map state)Convert SyncableState to a plain map for serialization.
Convert SyncableState to a plain map for serialization.
(update-clock! received-version)Update local clock based on received version (Lamport clock rule).
Update local clock based on received version (Lamport clock rule).
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |