Liking cljdoc? Tell your friends :D

lb.cluster.protocol

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
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
raw docstring

alive-messageclj

(alive-message sender incarnation)

Create an alive message to refute suspicion.

Create an alive message to refute suspicion.
sourceraw docstring

current-versionclj

(current-version)

Get current Lamport timestamp without incrementing.

Get current Lamport timestamp without incrementing.
sourceraw docstring

event-typesclj

Types of cluster events that can be subscribed to.

Types of cluster events that can be subscribed to.
sourceraw docstring

generate-node-idclj

(generate-node-id)

Generate a unique node ID.

Generate a unique node ID.
sourceraw docstring

gossip-message->mapclj

(gossip-message->map msg)

Convert GossipMessage to a plain map for serialization.

Convert GossipMessage to a plain map for serialization.
sourceraw docstring

IStateProvidercljprotocol

Protocol for modules that provide syncable state.

Protocol for modules that provide syncable state.

apply-remote-stateclj

(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-digestclj

(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-stateclj

(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-failureclj

(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-typeclj

(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)
sourceraw docstring

join-messageclj

(join-message sender node-info)

Create a join message when node joins cluster.

Create a join message when node joins cluster.
sourceraw docstring

leave-messageclj

(leave-message sender)

Create a leave message when node gracefully leaves.

Create a leave message when node gracefully leaves.
sourceraw docstring

make-eventclj

(make-event event-type node-id data)

Create a cluster event.

Create a cluster event.
sourceraw docstring

make-messageclj

(make-message msg-type sender)
(make-message msg-type sender target states digest payload)

Create a gossip message.

Create a gossip message.
sourceraw docstring

make-node-infoclj

(make-node-info node-id address)
(make-node-info node-id address metadata)

Create a new NodeInfo record.

Create a new NodeInfo record.
sourceraw docstring

make-syncable-stateclj

(make-syncable-state state-type key value version source-node)

Create a new SyncableState record.

Create a new SyncableState record.
sourceraw docstring

map->gossip-messageclj

(map->gossip-message m)

Convert a plain map back to GossipMessage.

Convert a plain map back to GossipMessage.
sourceraw docstring

map->node-infoclj

(map->node-info m)

Convert a plain map back to NodeInfo.

Convert a plain map back to NodeInfo.
sourceraw docstring

map->syncable-stateclj

(map->syncable-state m)

Convert a plain map back to SyncableState.

Convert a plain map back to SyncableState.
sourceraw docstring

message-typesclj

Valid gossip message types.

Valid gossip message types.
sourceraw docstring

newer?clj

(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).
sourceraw docstring

next-versionclj

(next-version)

Get next Lamport timestamp and increment clock.

Get next Lamport timestamp and increment clock.
sourceraw docstring

node-info->mapclj

(node-info->map node-info)

Convert NodeInfo to a plain map for serialization.

Convert NodeInfo to a plain map for serialization.
sourceraw docstring

ping-ack-messageclj

(ping-ack-message sender target seq-num)

Create a ping acknowledgment.

Create a ping acknowledgment.
sourceraw docstring

ping-messageclj

(ping-message sender target seq-num)

Create a ping message for failure detection.

Create a ping message for failure detection.
sourceraw docstring

ping-req-messageclj

(ping-req-message sender intermediary target seq-num)

Create an indirect ping request.

Create an indirect ping request.
sourceraw docstring

pull-messageclj

(pull-message sender digest)

Create a pull message with state digest.

Create a pull message with state digest.
sourceraw docstring

push-messageclj

(push-message sender states)

Create a push message with state updates.

Create a push message with state updates.
sourceraw docstring

push-pull-messageclj

(push-pull-message sender states digest)

Create a push-pull message for bidirectional sync.

Create a push-pull message for bidirectional sync.
sourceraw docstring

reset-clock!clj

(reset-clock!)

Reset Lamport clock (for testing).

Reset Lamport clock (for testing).
sourceraw docstring

state-keyclj

(state-key state)

Generate a compound key for a SyncableState.

Generate a compound key for a SyncableState.
sourceraw docstring

suspect-messageclj

(suspect-message sender suspect-node incarnation)

Create a suspect message when node may have failed.

Create a suspect message when node may have failed.
sourceraw docstring

syncable-state->mapclj

(syncable-state->map state)

Convert SyncableState to a plain map for serialization.

Convert SyncableState to a plain map for serialization.
sourceraw docstring

update-clock!clj

(update-clock! received-version)

Update local clock based on received version (Lamport clock rule).

Update local clock based on received version (Lamport clock rule).
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close