Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
cluster::ClusterCommunicationService Class Reference

Service to post and read messages to/from the cluster. It uses a backend to communicate with the cluster. More...

#include <ClusterCommunicationService.hpp>

Inheritance diagram for cluster::ClusterCommunicationService:
Collaboration diagram for cluster::ClusterCommunicationService:

Classes

struct  MakeResult
 Result of ClusterCommunicationService::make(). More...

Public Member Functions

 ClusterCommunicationService (std::shared_ptr< data::BackendInterface > backend, std::unique_ptr< etl::WriterStateInterface > writerState, std::unique_ptr< data::LedgerCacheLoadingStateInterface > cacheLoadingState, std::chrono::steady_clock::duration readInterval=kDEFAULT_READ_INTERVAL, std::chrono::steady_clock::duration writeInterval=kDEFAULT_WRITE_INTERVAL)
 Construct a new Cluster Communication Service object.
 ClusterCommunicationService (ClusterCommunicationService &&)=delete
 ClusterCommunicationService (ClusterCommunicationService const &)=delete
ClusterCommunicationServiceoperator= (ClusterCommunicationService &&)=delete
ClusterCommunicationServiceoperator= (ClusterCommunicationService const &)=delete
void run ()
 Start the service.
void stop ()
 Stop the service.

Static Public Member Functions

static MakeResult make (util::config::ClioConfigDefinition const &config, std::shared_ptr< BackendInterface > backend, std::shared_ptr< etl::SystemState > state)
 Factory method: construct the service and return a cache loading state for the caller.

Static Public Attributes

static constexpr std::chrono::milliseconds kDEFAULT_READ_INTERVAL {1000}
static constexpr std::chrono::milliseconds kDEFAULT_WRITE_INTERVAL {1000}

Detailed Description

Service to post and read messages to/from the cluster. It uses a backend to communicate with the cluster.

Constructor & Destructor Documentation

◆ ClusterCommunicationService()

cluster::ClusterCommunicationService::ClusterCommunicationService ( std::shared_ptr< data::BackendInterface > backend,
std::unique_ptr< etl::WriterStateInterface > writerState,
std::unique_ptr< data::LedgerCacheLoadingStateInterface > cacheLoadingState,
std::chrono::steady_clock::duration readInterval = kDEFAULT_READ_INTERVAL,
std::chrono::steady_clock::duration writeInterval = kDEFAULT_WRITE_INTERVAL )

Construct a new Cluster Communication Service object.

Parameters
backendThe backend to use for communication.
writerStateThe state showing whether clio is writing to the database.
cacheLoadingStateState controlling cache loading permission for this node.
readIntervalThe interval to read messages from the cluster.
writeIntervalThe interval to write messages to the cluster.

Member Function Documentation

◆ make()

ClusterCommunicationService::MakeResult cluster::ClusterCommunicationService::make ( util::config::ClioConfigDefinition const & config,
std::shared_ptr< BackendInterface > backend,
std::shared_ptr< etl::SystemState > state )
static

Factory method: construct the service and return a cache loading state for the caller.

Reads the cache.limit_load_in_cluster config flag: if true, loading is immediately allowed (single-node mode); if false, the cluster will gate permission via CacheLoaderDecider.

Parameters
configThe application configuration
backendThe data backend
stateThe shared ETL system state
Returns
A MakeResult containing the service and a cache loading state clone

The documentation for this class was generated from the following files: