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

This namespace contains everything to do with the ETL and ETL sources. More...

Namespaces

namespace  model
 This namespace contains the data models used by the ETL pipeline and its extensions.

Classes

struct  AmendmentBlockHandlerInterface
 The interface of a handler for amendment blocking. More...
class  CacheLoader
 Cache loading interface. More...
struct  CacheLoaderInterface
 An interface for the Cache Loader. More...
struct  CacheLoaderSettings
 Settings for the cache loader. More...
struct  CacheUpdaterInterface
 An interface for the Cache Updater. More...
class  CorruptionDetector
 A helper to notify Clio operator about a corruption in the DB. More...
class  ETLService
 This class is responsible for continuously extracting data from a p2p node, and writing that data to the databases. More...
struct  ETLServiceInterface
 This is a base class for any ETL service implementations. More...
struct  ETLState
 This class is responsible for fetching and storing the state of the ETL information, such as the network id. More...
struct  ExtractorInterface
 An interface for the Extractor. More...
struct  InitialLoadObserverInterface
 The interface for observing the initial ledger load. More...
struct  LedgerFetcherInterface
 An interface for LedgerFetcher. More...
struct  LedgerPublisherInterface
 The interface of a scheduler for the extraction process. More...
class  LoadBalancer
 This class is used to manage connections to transaction processing processes. More...
class  LoadBalancerInterface
 An interface for LoadBalancer. More...
struct  LoadBalancerTag
 A tag class to help identify LoadBalancer in templated code. More...
struct  LoaderInterface
 An interface for a ETL Loader. More...
class  MonitorInterface
 An interface for the monitor service An implementation of this service is responsible for periodically checking various datasources to detect newly ingested ledgers. More...
struct  MonitorProviderInterface
 An interface for providing Monitor instances. More...
class  NetworkValidatedLedgers
 This datastructure is used to keep track of the sequence of the most recent ledger validated by the network. More...
class  NetworkValidatedLedgersInterface
 An interface for NetworkValidatedLedgers. More...
struct  RegistryInterface
 The interface for a registry that can dispatch transactions and objects to extensions. More...
struct  SchedulerInterface
 The interface of a scheduler for the extraction process. More...
class  SourceBase
 Provides an implementation of a ETL source. More...
struct  SystemState
 Represents the state of the ETL subsystem. More...
struct  TaskManagerInterface
 An interface for the Task Manager. More...
struct  TaskManagerProviderInterface
 An interface for providing the Task Manager. More...
class  ThreadSafeQueue
 Generic thread-safe queue with a max capacity. More...
class  WriterState
 Implementation of WriterStateInterface that manages ETL writer state. More...
class  WriterStateInterface
 Interface for managing writer state in the ETL subsystem. More...

Concepts

concept  SomeLoadBalancer
 Concept for load balancer implementations.

Typedefs

using InitialLedgerLoadResult = std::expected<std::vector<std::string>, InitialLedgerLoadError>
 The result type of the initial ledger load.
using SourcePtr = std::unique_ptr<SourceBase>
 Owning pointer to an ETL source.
using SourceFactory
 Factory function creating an ETL source from its configuration and hooks.

Enumerations

enum class  InitialLedgerLoadError { Cancelled , Errored }
 Represents possible errors for initial ledger load. More...
enum class  LoaderError { AmendmentBlocked , WriteConflict }
 Enumeration of possible errors that can occur during loading operations. More...

Functions

CacheLoaderSettings makeCacheLoaderSettings (util::config::ClioConfigDefinition const &config)
 Create a CacheLoaderSettings object from a Config object.
std::vector< xrpl::uint256 > getMarkers (size_t numMarkers)
 Partitions the uint256 keyspace into numMarkers partitions, each of equal size.
ETLState tag_invoke (boost::json::value_to_tag< ETLState >, boost::json::value const &jv)
 Parse a boost::json::value into a ETLState.
std::vector< MPTHolderData > getMPTHolderFromTx (xrpl::TxMeta const &txMeta, xrpl::STTx const &sttx)
 Pull MPT data from TX via ETLService.
std::vector< MPTokenIssuanceTransactionsData > getMPTokenIssuanceTxsFromTx (xrpl::TxMeta const &txMeta, xrpl::STTx const &sttx)
 Pull MPT issuance transaction index data from a transaction.
std::optional< MPTHolderData > getMPTHolderFromObj (std::string const &key, std::string const &blob)
 Pull MPT data from ledger object via loadInitialLedger.
std::pair< std::vector< NFTTransactionsData >, std::optional< NFTsData > > getNftokenModifyData (xrpl::TxMeta const &txMeta, xrpl::STTx const &sttx)
 Get the NFT URI change data from a NFToken Modify transaction.
std::pair< std::vector< NFTTransactionsData >, std::optional< NFTsData > > getNFTokenMintData (xrpl::TxMeta const &txMeta, xrpl::STTx const &sttx)
 Get the NFT Token mint data from a transaction.
std::pair< std::vector< NFTTransactionsData >, std::optional< NFTsData > > getNFTokenBurnData (xrpl::TxMeta const &txMeta, xrpl::STTx const &sttx)
 Get the NFT Token burn data from a transaction.
std::pair< std::vector< NFTTransactionsData >, std::optional< NFTsData > > getNFTokenAcceptOfferData (xrpl::TxMeta const &txMeta, xrpl::STTx const &sttx)
 Get the NFT Token accept offer data from a transaction.
std::pair< std::vector< NFTTransactionsData >, std::optional< NFTsData > > getNFTokenCancelOfferData (xrpl::TxMeta const &txMeta, xrpl::STTx const &sttx)
 Get the NFT Token cancel offer data from a transaction.
std::pair< std::vector< NFTTransactionsData >, std::optional< NFTsData > > getNFTokenCreateOfferData (xrpl::TxMeta const &txMeta, xrpl::STTx const &sttx)
 Get the NFT Token create offer data from a transaction.
std::pair< std::vector< NFTTransactionsData >, std::optional< NFTsData > > getNFTDataFromTx (xrpl::TxMeta const &txMeta, xrpl::STTx const &sttx)
 Pull NFT data from TX via ETLService.
std::vector< NFTsData > getNFTDataFromObj (std::uint32_t seq, std::string const &key, std::string const &blob)
 Pull NFT data from ledger object via loadInitialLedger.
std::vector< NFTsData > getUniqueNFTsDatas (std::vector< NFTsData > const &nfts)
 Get the unique NFTs data from a vector of NFTsData happening in the same ledger. For example, if a NFT has both accept offer and burn happening in the same ledger,we only keep the final state of the NFT.
SourcePtr makeSource (util::config::ObjectView const &config, boost::asio::io_context &ioc, std::shared_ptr< feed::SubscriptionManagerInterface > subscriptions, std::shared_ptr< NetworkValidatedLedgersInterface > validatedLedgers, std::chrono::steady_clock::duration forwardingTimeout, SourceBase::OnConnectHook onConnect, SourceBase::OnDisconnectHook onDisconnect, SourceBase::OnLedgerClosedHook onLedgerClosed)
 Create a source.

Detailed Description

This namespace contains everything to do with the ETL and ETL sources.

Typedef Documentation

◆ InitialLedgerLoadResult

using etl::InitialLedgerLoadResult = std::expected<std::vector<std::string>, InitialLedgerLoadError>

The result type of the initial ledger load.

Note
The successful value represents edge keys

◆ SourceFactory

Initial value:
std::function<SourcePtr(
util::config::ObjectView const& config,
boost::asio::io_context& ioc,
std::shared_ptr<feed::SubscriptionManagerInterface> subscriptions,
std::shared_ptr<NetworkValidatedLedgersInterface> validatedLedgers,
std::chrono::steady_clock::duration forwardingTimeout,
)>
std::function< void()> OnLedgerClosedHook
Callback invoked when a forwarding source sees a ledger close.
Definition Source.hpp:46
std::function< void()> OnConnectHook
Callback invoked when the source connects.
Definition Source.hpp:38
std::function< void(bool)> OnDisconnectHook
Callback invoked on disconnect; receives whether the source was forwarding.
Definition Source.hpp:42
Provides a view into a subset of configuration data defined by a prefix.
Definition ObjectView.hpp:21
std::unique_ptr< SourceBase > SourcePtr
Owning pointer to an ETL source.
Definition Source.hpp:155

Factory function creating an ETL source from its configuration and hooks.

Enumeration Type Documentation

◆ InitialLedgerLoadError

enum class etl::InitialLedgerLoadError
strong

Represents possible errors for initial ledger load.

Enumerator
Cancelled 

Indicating the initial load got cancelled by user.

Errored 

Indicating some error happened during initial ledger load.

◆ LoaderError

enum class etl::LoaderError
strong

Enumeration of possible errors that can occur during loading operations.

Enumerator
AmendmentBlocked 

Error indicating that an operation is blocked by an amendment.

WriteConflict 

Error indicating that a write operation resulted in a conflict.

Function Documentation

◆ getMarkers()

std::vector< xrpl::uint256 > etl::getMarkers ( size_t numMarkers)

Partitions the uint256 keyspace into numMarkers partitions, each of equal size.

Parameters
numMarkersTotal markers to partition for
Returns
The markers

◆ getMPTHolderFromObj()

std::optional< MPTHolderData > etl::getMPTHolderFromObj ( std::string const & key,
std::string const & blob )

Pull MPT data from ledger object via loadInitialLedger.

Parameters
keyThe owner key
blobObject data as blob
Returns
The MPTIssuanceID and holder pair as a optional

◆ getMPTHolderFromTx()

std::vector< MPTHolderData > etl::getMPTHolderFromTx ( xrpl::TxMeta const & txMeta,
xrpl::STTx const & sttx )

Pull MPT data from TX via ETLService.

Parameters
txMetaTransaction metadata
sttxThe transaction (unused in current implementation)
Returns
The MPTIssuanceID and holder pairs created by the transaction; empty if the transaction failed or created no MPToken.

◆ getMPTokenIssuanceTxsFromTx()

std::vector< MPTokenIssuanceTransactionsData > etl::getMPTokenIssuanceTxsFromTx ( xrpl::TxMeta const & txMeta,
xrpl::STTx const & sttx )

Pull MPT issuance transaction index data from a transaction.

Note
This scans the transaction's metadata for affected MPTokenIssuance/MPToken ledger objects and transaction fields for attached MPTokenIssuanceID/MPT issue references. It produces one record per distinct issuance, each carrying the full set of affected accounts. Transaction fields are scanned so failed transactions that carry an issuance reference are indexed even when metadata has no affected MPT objects. Used by live ETL and reused by the historical backfill migrator.
Parameters
txMetaTransaction metadata.
sttxThe transaction.
Returns
One record per distinct MPT issuance referenced by metadata or transaction fields; empty if no MPT issuance reference is found.

◆ getNFTDataFromObj()

std::vector< NFTsData > etl::getNFTDataFromObj ( std::uint32_t seq,
std::string const & key,
std::string const & blob )

Pull NFT data from ledger object via loadInitialLedger.

Parameters
seqThe ledger sequence to pull for
keyThe owner key
blobObject data as blob
Returns
The NFT data as a vector

◆ getNFTDataFromTx()

std::pair< std::vector< NFTTransactionsData >, std::optional< NFTsData > > etl::getNFTDataFromTx ( xrpl::TxMeta const & txMeta,
xrpl::STTx const & sttx )

Pull NFT data from TX via ETLService.

Parameters
txMetaTransaction metadata
sttxThe transaction
Returns
NFT transactions data as a pair of transactions and optional NFTsData

◆ getNFTokenAcceptOfferData()

std::pair< std::vector< NFTTransactionsData >, std::optional< NFTsData > > etl::getNFTokenAcceptOfferData ( xrpl::TxMeta const & txMeta,
xrpl::STTx const & sttx )

Get the NFT Token accept offer data from a transaction.

Parameters
txMetaTransaction metadata
sttxThe transaction
Returns
NFT Token accept offer data as a pair of transactions and optional NFTsData

◆ getNFTokenBurnData()

std::pair< std::vector< NFTTransactionsData >, std::optional< NFTsData > > etl::getNFTokenBurnData ( xrpl::TxMeta const & txMeta,
xrpl::STTx const & sttx )

Get the NFT Token burn data from a transaction.

Parameters
txMetaTransaction metadata
sttxThe transaction
Returns
NFT Token burn data as a pair of transactions and optional NFTsData

◆ getNFTokenCancelOfferData()

std::pair< std::vector< NFTTransactionsData >, std::optional< NFTsData > > etl::getNFTokenCancelOfferData ( xrpl::TxMeta const & txMeta,
xrpl::STTx const & sttx )

Get the NFT Token cancel offer data from a transaction.

Parameters
txMetaTransaction metadata
sttxThe transaction
Returns
NFT Token cancel offer data as a pair of transactions and optional NFTsData

◆ getNFTokenCreateOfferData()

std::pair< std::vector< NFTTransactionsData >, std::optional< NFTsData > > etl::getNFTokenCreateOfferData ( xrpl::TxMeta const & txMeta,
xrpl::STTx const & sttx )

Get the NFT Token create offer data from a transaction.

Parameters
txMetaTransaction metadata
sttxThe transaction
Returns
NFT Token create offer data as a pair of transactions and optional NFTsData

◆ getNFTokenMintData()

std::pair< std::vector< NFTTransactionsData >, std::optional< NFTsData > > etl::getNFTokenMintData ( xrpl::TxMeta const & txMeta,
xrpl::STTx const & sttx )

Get the NFT Token mint data from a transaction.

Parameters
txMetaTransaction metadata
sttxThe transaction
Returns
NFT Token mint data as a pair of transactions and optional NFTsData

◆ getNftokenModifyData()

std::pair< std::vector< NFTTransactionsData >, std::optional< NFTsData > > etl::getNftokenModifyData ( xrpl::TxMeta const & txMeta,
xrpl::STTx const & sttx )

Get the NFT URI change data from a NFToken Modify transaction.

Parameters
txMetaTransaction metadata
sttxThe transaction
Returns
NFT URI change data as a pair of transactions and optional NFTsData

◆ getUniqueNFTsDatas()

std::vector< NFTsData > etl::getUniqueNFTsDatas ( std::vector< NFTsData > const & nfts)

Get the unique NFTs data from a vector of NFTsData happening in the same ledger. For example, if a NFT has both accept offer and burn happening in the same ledger,we only keep the final state of the NFT.

Parameters
nftsThe NFTs data to filter, happening in the same ledger
Returns
The unique NFTs data

◆ makeCacheLoaderSettings()

CacheLoaderSettings etl::makeCacheLoaderSettings ( util::config::ClioConfigDefinition const & config)
nodiscard

Create a CacheLoaderSettings object from a Config object.

Parameters
configThe configuration object
Returns
The CacheLoaderSettings object

◆ makeSource()

SourcePtr etl::makeSource ( util::config::ObjectView const & config,
boost::asio::io_context & ioc,
std::shared_ptr< feed::SubscriptionManagerInterface > subscriptions,
std::shared_ptr< NetworkValidatedLedgersInterface > validatedLedgers,
std::chrono::steady_clock::duration forwardingTimeout,
SourceBase::OnConnectHook onConnect,
SourceBase::OnDisconnectHook onDisconnect,
SourceBase::OnLedgerClosedHook onLedgerClosed )
nodiscard

Create a source.

Parameters
configThe configuration to use
iocThe io_context to run on
subscriptionsSubscription manager
validatedLedgersThe network validated ledgers data structure
forwardingTimeoutThe timeout for forwarding to rippled
onConnectThe hook to call on connect
onDisconnectThe hook to call on disconnect
onLedgerClosedThe hook to call on ledger closed. This is called when a ledger is closed and the source is set as forwarding.
Returns
The created source

◆ tag_invoke()

ETLState etl::tag_invoke ( boost::json::value_to_tag< ETLState > ,
boost::json::value const & jv )

Parse a boost::json::value into a ETLState.

Parameters
jvThe json value to convert
Returns
The ETLState