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

This namespace implements the data access layer and related components. More...

Namespaces

namespace  cassandra
 This namespace implements a wrapper for the Cassandra C++ driver.
 

Classes

struct  Amendment
 Represents an amendment in the XRPL. More...
 
class  AmendmentCenter
 Knowledge center for amendments within XRPL. More...
 
class  AmendmentCenterInterface
 The interface of an amendment center. More...
 
struct  AmendmentKey
 A helper for amendment name to feature conversions. More...
 
struct  Amendments
 List of supported amendments. More...
 
class  BackendCounters
 Holds statistics about the backend. More...
 
class  BackendInterface
 The interface to the database used by Clio. More...
 
struct  BookOffersPage
 Represents a page of book offer objects. More...
 
class  DatabaseTimeout
 Represents a database timeout error. More...
 
class  LedgerCache
 Cache for an entire ledger. More...
 
struct  LedgerObject
 Represents an object in the ledger. More...
 
struct  LedgerPage
 Represents a page of LedgerObjects. More...
 
struct  LedgerRange
 Stores a range of sequences as a min and max pair. More...
 
struct  MPTHoldersAndCursor
 Represents an array of MPTokens. More...
 
struct  NFT
 Represents a NFToken. More...
 
struct  NFTsAndCursor
 Represents a bundle of NFTs with a cursor to the next page. More...
 
struct  TransactionAndMetadata
 Represents a transaction and its metadata bundled together. More...
 
struct  TransactionsAndCursor
 Represests a bundle of transactions with metadata and a cursor to the next page. More...
 
struct  TransactionsCursor
 Represents a cursor into the transactions table. More...
 

Concepts

concept  SomeBackendCounters
 A concept for a class that can be used to count backend operations.
 

Typedefs

using Blob = std::vector<unsigned char>
 

Functions

std::shared_ptr< BackendInterfacemakeBackend (util::config::ClioConfigDefinition const &config)
 A factory function that creates the backend based on a config.
 
template<typename FnType >
auto retryOnTimeout (FnType func, size_t waitMs=kDEFAULT_WAIT_BETWEEN_RETRY)
 A helper function that catches DatabaseTimout exceptions and retries indefinitely.
 
template<typename FnType >
auto synchronous (FnType &&func)
 Synchronously executes the given function object inside a coroutine.
 
template<typename FnType >
auto synchronousAndRetryOnTimeout (FnType &&func)
 Synchronously execute the given function object and retry until no DatabaseTimeout is thrown.
 

Variables

static constexpr std::size_t kDEFAULT_WAIT_BETWEEN_RETRY = 500
 
constexpr ripple::uint256 kFIRST_KEY {"0000000000000000000000000000000000000000000000000000000000000000"}
 
constexpr ripple::uint256 kLAST_KEY {"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"}
 
constexpr ripple::uint256 kHI192 {"0000000000000000000000000000000000000000000000001111111111111111"}
 

Detailed Description

This namespace implements the data access layer and related components.

The data layer is responsible for fetching and storing data from the database. Cassandra and ScyllaDB are currently supported via the CassandraBackend implementation.

Function Documentation

◆ makeBackend()

std::shared_ptr< BackendInterface > data::makeBackend ( util::config::ClioConfigDefinition const & config)
inline

A factory function that creates the backend based on a config.

Parameters
configThe clio config to use
Returns
A shared_ptr<BackendInterface> with the selected implementation

◆ retryOnTimeout()

template<typename FnType >
auto data::retryOnTimeout ( FnType func,
size_t waitMs = kDEFAULT_WAIT_BETWEEN_RETRY )

A helper function that catches DatabaseTimout exceptions and retries indefinitely.

Template Parameters
FnTypeThe type of function object to execute
Parameters
funcThe function object to execute
waitMsDelay between retry attempts
Returns
The same as the return type of func

◆ synchronous()

template<typename FnType >
auto data::synchronous ( FnType && func)

Synchronously executes the given function object inside a coroutine.

Template Parameters
FnTypeThe type of function object to execute
Parameters
funcThe function object to execute
Returns
The same as the return type of func

◆ synchronousAndRetryOnTimeout()

template<typename FnType >
auto data::synchronousAndRetryOnTimeout ( FnType && func)

Synchronously execute the given function object and retry until no DatabaseTimeout is thrown.

Template Parameters
FnTypeThe type of function object to execute
Parameters
funcThe function object to execute
Returns
The same as the return type of func