|
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::async::AnyExecutionContext ctx, std::reference_wrapper< util::config::ClioConfigDefinition const > config, std::shared_ptr< data::BackendInterface > backend, std::shared_ptr< LoadBalancerInterface > balancer, std::shared_ptr< NetworkValidatedLedgersInterface > ledgers, std::shared_ptr< LedgerPublisherInterface > publisher, std::shared_ptr< CacheLoaderInterface > cacheLoader, std::shared_ptr< CacheUpdaterInterface > cacheUpdater, std::shared_ptr< ExtractorInterface > extractor, std::shared_ptr< LoaderInterface > loader, std::shared_ptr< InitialLoadObserverInterface > initialLoadObserver, std::shared_ptr< TaskManagerProviderInterface > taskManagerProvider, std::shared_ptr< MonitorProviderInterface > monitorProvider, std::shared_ptr< SystemState > state) | |
| Create an instance of ETLService. | |
| void | run () override |
| Start all components to run ETL service. | |
| void | stop () override |
| Stop the ETL service. | |
| boost::json::object | getInfo () const override |
| Get state of ETL as a JSON object. | |
| bool | isAmendmentBlocked () const override |
| Check for the amendment blocked state. | |
| bool | isCorruptionDetected () const override |
| Check whether Clio detected DB corruptions. | |
| std::optional< ETLState > | getETLState () const override |
| Get the etl nodes' state. | |
| std::uint32_t | lastCloseAgeSeconds () const override |
| Get time passed since last ledger close, in seconds. | |
Static Public Member Functions | |
| static std::shared_ptr< ETLServiceInterface > | makeETLService (util::config::ClioConfigDefinition const &config, util::async::AnyExecutionContext ctx, std::shared_ptr< BackendInterface > backend, std::shared_ptr< feed::SubscriptionManagerInterface > subscriptions, std::shared_ptr< LoadBalancerInterface > 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::async::AnyExecutionContext | ctx, |
| std::reference_wrapper< util::config::ClioConfigDefinition const > | config, | ||
| std::shared_ptr< data::BackendInterface > | backend, | ||
| std::shared_ptr< LoadBalancerInterface > | balancer, | ||
| std::shared_ptr< NetworkValidatedLedgersInterface > | ledgers, | ||
| std::shared_ptr< LedgerPublisherInterface > | publisher, | ||
| std::shared_ptr< CacheLoaderInterface > | cacheLoader, | ||
| std::shared_ptr< CacheUpdaterInterface > | cacheUpdater, | ||
| std::shared_ptr< ExtractorInterface > | extractor, | ||
| std::shared_ptr< LoaderInterface > | loader, | ||
| std::shared_ptr< InitialLoadObserverInterface > | initialLoadObserver, | ||
| std::shared_ptr< TaskManagerProviderInterface > | taskManagerProvider, | ||
| std::shared_ptr< MonitorProviderInterface > | monitorProvider, | ||
| std::shared_ptr< SystemState > | state ) |
Create an instance of ETLService.
| ctx | The execution context for asynchronous operations |
| config | The Clio configuration definition |
| backend | Interface to the backend database |
| balancer | Load balancer for distributing work |
| ledgers | Interface for accessing network validated ledgers |
| publisher | Interface for publishing ledger data |
| cacheLoader | Interface for loading cache data |
| cacheUpdater | Interface for updating cache data |
| extractor | The extractor to use |
| loader | Interface for loading data |
| initialLoadObserver | The observer for initial data loading |
| taskManagerProvider | The provider of the task manager instance |
| monitorProvider | The provider of the monitor instance |
| state | System state tracking object |
|
overridevirtual |
Get the etl nodes' state.
Implements etl::ETLServiceInterface.
|
overridevirtual |
Get state of ETL as a JSON object.
Implements etl::ETLServiceInterface.
|
overridevirtual |
Check for the amendment blocked state.
Implements etl::ETLServiceInterface.
|
overridevirtual |
Check whether Clio detected DB corruptions.
Implements etl::ETLServiceInterface.
|
overridevirtual |
Get time passed since last ledger close, in seconds.
Implements etl::ETLServiceInterface.
|
static |
A factory function to spawn new ETLService instances.
Creates and runs the ETL service.
| config | The configuration to use |
| ctx | Execution context for asynchronous operations |
| backend | BackendInterface implementation |
| subscriptions | Subscription manager |
| balancer | Load balancer to use |
| ledgers | The network validated ledgers datastructure |
|
overridevirtual |
Start all components to run ETL service.
Implements etl::ETLServiceInterface.
|
overridevirtual |
Stop the ETL service.
Implements etl::ETLServiceInterface.