Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
cluster Namespace Reference

This namespace implements cluster coordination between Clio nodes. More...

Classes

class  Backend
 Backend communication handler for cluster state synchronization. More...
class  CacheLoaderDecider
 Decides which node in the cluster should load the ledger cache. More...
struct  ClioNode
 Represents a node in the cluster. More...
class  ClusterCommunicationService
 Service to post and read messages to/from the cluster. It uses a backend to communicate with the cluster. More...
struct  ClusterCommunicationServiceTag
 Tag type for cluster communication service implementations. More...
class  Metrics
 Manages Prometheus metrics for cluster communication and node tracking. More...
class  WriterDecider
 Decides which node in the cluster should be the writer based on cluster state. More...

Concepts

concept  SomeClusterCommunicationService
 Concept for cluster communication service implementations.

Functions

void tag_invoke (boost::json::value_from_tag, boost::json::value &jv, ClioNode const &node)
 Convert a ClioNode to a JSON object.
ClioNode tag_invoke (boost::json::value_to_tag< ClioNode >, boost::json::value const &jv)
 Convert a JSON object to a ClioNode.

Detailed Description

This namespace implements cluster coordination between Clio nodes.

Nodes share their state through the database to elect a writer and decide which node may load the ledger cache.

Function Documentation

◆ tag_invoke() [1/2]

void cluster::tag_invoke ( boost::json::value_from_tag ,
boost::json::value & jv,
ClioNode const & node )

Convert a ClioNode to a JSON object.

The UUID is not serialized; it is stored separately in the database.

Parameters
jvThe JSON value to populate
nodeThe node to convert

◆ tag_invoke() [2/2]

ClioNode cluster::tag_invoke ( boost::json::value_to_tag< ClioNode > ,
boost::json::value const & jv )

Convert a JSON object to a ClioNode.

Missing optional fields get backward compatible defaults. The UUID of the result is a fresh empty UUID that the caller is expected to fill.

Parameters
jvThe JSON value to convert
Returns
The converted ClioNode
Exceptions
std::runtime_errorif the update time cannot be parsed, db_role exceeds DbRole::Max, or a field is missing or mistyped