Clio develop
The XRP Ledger API server.
|
This class is responsible for continuously extracting data from a p2p node, and writing that data to the databases. More...
#include <ETLService.hpp>
Public Member Functions | |
ETLService (util::config::ClioConfigDefinition const &config, boost::asio::io_context &ioc, std::shared_ptr< BackendInterface > backend, std::shared_ptr< feed::SubscriptionManagerInterface > subscriptions, std::shared_ptr< LoadBalancerType > balancer, std::shared_ptr< NetworkValidatedLedgersInterface > ledgers) | |
Create an instance of ETLService. | |
~ETLService () override | |
Stops components and joins worker thread. | |
void | stop () |
Stop the ETL service. | |
std::uint32_t | lastCloseAgeSeconds () const |
Get time passed since last ledger close, in seconds. | |
bool | isAmendmentBlocked () const |
Check for the amendment blocked state. | |
bool | isCorruptionDetected () const |
Check whether Clio detected DB corruptions. | |
boost::json::object | getInfo () const |
Get state of ETL as a JSON object. | |
std::optional< etl::ETLState > | getETLState () const noexcept |
Get the etl nodes' state. | |
Public Member Functions inherited from etl::ETLServiceTag |
Static Public Member Functions | |
static std::shared_ptr< ETLService > | makeETLService (util::config::ClioConfigDefinition const &config, boost::asio::io_context &ioc, std::shared_ptr< BackendInterface > backend, std::shared_ptr< feed::SubscriptionManagerInterface > subscriptions, std::shared_ptr< LoadBalancerType > balancer, std::shared_ptr< NetworkValidatedLedgersInterface > ledgers) |
A factory function to spawn new ETLService instances. | |
This class is responsible for continuously extracting data from a p2p node, and writing that data to the databases.
Usually, multiple different processes share access to the same network accessible databases, in which case only one such process is performing ETL and writing to the database. The other processes simply monitor the database for new ledgers, and publish those ledgers to the various subscription streams. If a monitoring process determines that the ETL writer has failed (no new ledgers written for some time), the process will attempt to become the ETL writer.
If there are multiple monitoring processes that try to become the ETL writer at the same time, one will win out, and the others will fall back to monitoring/publishing. In this sense, this class dynamically transitions from monitoring to writing and from writing to monitoring, based on the activity of other processes running on different machines.
etl::ETLService::ETLService | ( | util::config::ClioConfigDefinition const & | config, |
boost::asio::io_context & | ioc, | ||
std::shared_ptr< BackendInterface > | backend, | ||
std::shared_ptr< feed::SubscriptionManagerInterface > | subscriptions, | ||
std::shared_ptr< LoadBalancerType > | balancer, | ||
std::shared_ptr< NetworkValidatedLedgersInterface > | ledgers ) |
Create an instance of ETLService.
config | The configuration to use |
ioc | io context to run on |
backend | BackendInterface implementation |
subscriptions | Subscription manager |
balancer | Load balancer to use |
ledgers | The network validated ledgers datastructure |
|
inlinenoexcept |
Get the etl nodes' state.
|
inline |
Get state of ETL as a JSON object.
|
inline |
Check for the amendment blocked state.
|
inline |
Check whether Clio detected DB corruptions.
|
inline |
Get time passed since last ledger close, in seconds.
|
inlinestatic |
A factory function to spawn new ETLService instances.
Creates and runs the ETL service.
config | The configuration to use |
ioc | io context to run on |
backend | BackendInterface implementation |
subscriptions | Subscription manager |
balancer | Load balancer to use |
ledgers | The network validated ledgers datastructure |
|
inline |
Stop the ETL service.