Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType > Class Template Reference

Implements BackendInterface for Cassandra/ScyllaDB. More...

#include <CassandraBackend.hpp>

Inheritance diagram for data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >:
Collaboration diagram for data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >:

Public Member Functions

 BasicCassandraBackend (SettingsProviderType settingsProvider, bool readOnly)
 Create a new cassandra/scylla backend instance.
 
TransactionsAndCursor fetchAccountTransactions (ripple::AccountID const &account, std::uint32_t const limit, bool forward, std::optional< TransactionsCursor > const &cursorIn, boost::asio::yield_context yield) const override
 Fetches all transactions for a specific account.
 
void waitForWritesToFinish () override
 Wait for all pending writes to finish.
 
bool doFinishWrites () override
 The implementation should wait for all pending writes to finish.
 
void writeLedger (ripple::LedgerHeader const &ledgerHeader, std::string &&blob) override
 Writes to a specific ledger.
 
std::optional< std::uint32_t > fetchLatestLedgerSequence (boost::asio::yield_context yield) const override
 Fetches the latest ledger sequence.
 
std::optional< ripple::LedgerHeader > fetchLedgerBySequence (std::uint32_t const sequence, boost::asio::yield_context yield) const override
 Fetches a specific ledger by sequence number.
 
std::optional< ripple::LedgerHeader > fetchLedgerByHash (ripple::uint256 const &hash, boost::asio::yield_context yield) const override
 Fetches a specific ledger by hash.
 
std::optional< LedgerRangehardFetchLedgerRange (boost::asio::yield_context yield) const override
 Fetches the ledger range from DB.
 
std::vector< TransactionAndMetadatafetchAllTransactionsInLedger (std::uint32_t const ledgerSequence, boost::asio::yield_context yield) const override
 Fetches all transactions from a specific ledger.
 
std::vector< ripple::uint256 > fetchAllTransactionHashesInLedger (std::uint32_t const ledgerSequence, boost::asio::yield_context yield) const override
 Fetches all transaction hashes from a specific ledger.
 
std::optional< NFTfetchNFT (ripple::uint256 const &tokenID, std::uint32_t const ledgerSequence, boost::asio::yield_context yield) const override
 Fetches a specific NFT.
 
TransactionsAndCursor fetchNFTTransactions (ripple::uint256 const &tokenID, std::uint32_t const limit, bool const forward, std::optional< TransactionsCursor > const &cursorIn, boost::asio::yield_context yield) const override
 Fetches all transactions for a specific NFT.
 
NFTsAndCursor fetchNFTsByIssuer (ripple::AccountID const &issuer, std::optional< std::uint32_t > const &taxon, std::uint32_t const ledgerSequence, std::uint32_t const limit, std::optional< ripple::uint256 > const &cursorIn, boost::asio::yield_context yield) const override
 Fetches all NFTs issued by a given address.
 
MPTHoldersAndCursor fetchMPTHolders (ripple::uint192 const &mptID, std::uint32_t const limit, std::optional< ripple::AccountID > const &cursorIn, std::uint32_t const ledgerSequence, boost::asio::yield_context yield) const override
 Fetches all holders' balances for a MPTIssuanceID.
 
std::optional< Blob > doFetchLedgerObject (ripple::uint256 const &key, std::uint32_t const sequence, boost::asio::yield_context yield) const override
 The database-specific implementation for fetching a ledger object.
 
std::optional< std::uint32_t > doFetchLedgerObjectSeq (ripple::uint256 const &key, std::uint32_t const sequence, boost::asio::yield_context yield) const override
 The database-specific implementation for fetching a ledger object sequence.
 
std::optional< TransactionAndMetadatafetchTransaction (ripple::uint256 const &hash, boost::asio::yield_context yield) const override
 Fetches a specific transaction.
 
std::optional< ripple::uint256 > doFetchSuccessorKey (ripple::uint256 key, std::uint32_t const ledgerSequence, boost::asio::yield_context yield) const override
 Database-specific implementation of fetching the successor key.
 
std::vector< TransactionAndMetadatafetchTransactions (std::vector< ripple::uint256 > const &hashes, boost::asio::yield_context yield) const override
 Fetches multiple transactions.
 
std::vector< Blob > doFetchLedgerObjects (std::vector< ripple::uint256 > const &keys, std::uint32_t const sequence, boost::asio::yield_context yield) const override
 The database-specific implementation for fetching ledger objects.
 
std::vector< ripple::uint256 > fetchAccountRoots (std::uint32_t number, std::uint32_t pageSize, std::uint32_t seq, boost::asio::yield_context yield) const override
 Fetch the specified number of account root object indexes by page, the accounts need to exist for seq.
 
std::vector< LedgerObjectfetchLedgerDiff (std::uint32_t const ledgerSequence, boost::asio::yield_context yield) const override
 Returns the difference between ledgers.
 
std::optional< std::string > fetchMigratorStatus (std::string const &migratorName, boost::asio::yield_context yield) const override
 Fetches the status of migrator by name.
 
void doWriteLedgerObject (std::string &&key, std::uint32_t const seq, std::string &&blob) override
 Writes a ledger object to the database.
 
void writeSuccessor (std::string &&key, std::uint32_t const seq, std::string &&successor) override
 Write a new successor.
 
void writeAccountTransactions (std::vector< AccountTransactionsData > data) override
 Write a new set of account transactions.
 
void writeNFTTransactions (std::vector< NFTTransactionsData > const &data) override
 Write NFTs transactions.
 
void writeTransaction (std::string &&hash, std::uint32_t const seq, std::uint32_t const date, std::string &&transaction, std::string &&metadata) override
 Writes a new transaction.
 
void writeNFTs (std::vector< NFTsData > const &data) override
 Writes NFTs to the database.
 
void writeMPTHolders (std::vector< MPTHolderData > const &data) override
 Write accounts that started holding onto a MPT.
 
void startWrites () const override
 Starts a write transaction with the DB. No-op for cassandra.
 
void writeMigratorStatus (std::string const &migratorName, std::string const &status) override
 Mark the migration status of a migrator as Migrated in the database.
 
bool isTooBusy () const override
 
boost::json::object stats () const override
 
- Public Member Functions inherited from data::BackendInterface
LedgerCache const & cache () const
 
LedgerCachecache ()
 
void setCorruptionDetector (etl::CorruptionDetector< LedgerCache > detector)
 Sets the corruption detector.
 
std::optional< LedgerRangefetchLedgerRange () const
 Fetch the current ledger range.
 
void updateRange (uint32_t newMax)
 Updates the range of sequences that are stored in the DB.
 
void setRange (uint32_t min, uint32_t max, bool force=false)
 Sets the range of sequences that are stored in the DB.
 
std::optional< ripple::Fees > fetchFees (std::uint32_t seq, boost::asio::yield_context yield) const
 Fetch the fees from a specific ledger sequence.
 
std::optional< Blob > fetchLedgerObject (ripple::uint256 const &key, std::uint32_t sequence, boost::asio::yield_context yield) const
 Fetches a specific ledger object.
 
std::optional< std::uint32_t > fetchLedgerObjectSeq (ripple::uint256 const &key, std::uint32_t sequence, boost::asio::yield_context yield) const
 Fetches a specific ledger object sequence.
 
std::vector< Blob > fetchLedgerObjects (std::vector< ripple::uint256 > const &keys, std::uint32_t sequence, boost::asio::yield_context yield) const
 Fetches all ledger objects by their keys.
 
LedgerPage fetchLedgerPage (std::optional< ripple::uint256 > const &cursor, std::uint32_t ledgerSequence, std::uint32_t limit, bool outOfOrder, boost::asio::yield_context yield)
 Fetches a page of ledger objects, ordered by key/index.
 
std::optional< LedgerObjectfetchSuccessorObject (ripple::uint256 key, std::uint32_t ledgerSequence, boost::asio::yield_context yield) const
 Fetches the successor object.
 
std::optional< ripple::uint256 > fetchSuccessorKey (ripple::uint256 key, std::uint32_t ledgerSequence, boost::asio::yield_context yield) const
 Fetches the successor key.
 
BookOffersPage fetchBookOffers (ripple::uint256 const &book, std::uint32_t ledgerSequence, std::uint32_t limit, boost::asio::yield_context yield) const
 Fetches book offers.
 
std::optional< LedgerRangehardFetchLedgerRange () const
 Synchronously fetches the ledger range from DB.
 
std::optional< LedgerRangehardFetchLedgerRangeNoThrow () const
 Fetches the ledger range from DB retrying until no DatabaseTimeout is thrown.
 
virtual void writeLedgerObject (std::string &&key, std::uint32_t seq, std::string &&blob)
 Writes a new ledger object.
 
bool finishWrites (std::uint32_t ledgerSequence)
 Tells database we finished writing all data for a specific ledger.
 

Protected Attributes

Handle handle_
 
ExecutionStrategyType executor_
 
- Protected Attributes inherited from data::BackendInterface
std::shared_mutex rngMtx_
 
std::optional< LedgerRangerange_
 
LedgerCache cache_
 
std::optional< etl::CorruptionDetector< LedgerCache > > corruptionDetector_
 

Detailed Description

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
class data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >

Implements BackendInterface for Cassandra/ScyllaDB.

Note: This is a safer and more correct rewrite of the original implementation of the backend.

Template Parameters
SettingsProviderTypeThe settings provider type to use
ExecutionStrategyTypeThe execution strategy type to use

Constructor & Destructor Documentation

◆ BasicCassandraBackend()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::BasicCassandraBackend ( SettingsProviderType settingsProvider,
bool readOnly )
inline

Create a new cassandra/scylla backend instance.

Parameters
settingsProviderThe settings provider to use
readOnlyWhether the database should be in readonly mode

Member Function Documentation

◆ doFetchLedgerObject()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
std::optional< Blob > data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::doFetchLedgerObject ( ripple::uint256 const & key,
std::uint32_t const sequence,
boost::asio::yield_context yield ) const
inlineoverridevirtual

The database-specific implementation for fetching a ledger object.

Parameters
keyThe key to fetch for
sequenceThe ledger sequence to fetch for
yieldThe coroutine context
Returns
The object as a Blob on success; nullopt otherwise

Implements data::BackendInterface.

◆ doFetchLedgerObjects()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
std::vector< Blob > data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::doFetchLedgerObjects ( std::vector< ripple::uint256 > const & keys,
std::uint32_t const sequence,
boost::asio::yield_context yield ) const
inlineoverridevirtual

The database-specific implementation for fetching ledger objects.

Parameters
keysThe keys to fetch for
sequenceThe ledger sequence to fetch for
yieldThe coroutine context
Returns
A vector of Blobs representing each fetched object

Implements data::BackendInterface.

◆ doFetchLedgerObjectSeq()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
std::optional< std::uint32_t > data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::doFetchLedgerObjectSeq ( ripple::uint256 const & key,
std::uint32_t const sequence,
boost::asio::yield_context yield ) const
inlineoverridevirtual

The database-specific implementation for fetching a ledger object sequence.

Parameters
keyThe key to fetch for
sequenceThe ledger sequence to fetch for
yieldThe coroutine context
Returns
The sequence in unit32_t on success; nullopt otherwise

Implements data::BackendInterface.

◆ doFetchSuccessorKey()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
std::optional< ripple::uint256 > data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::doFetchSuccessorKey ( ripple::uint256 key,
std::uint32_t const ledgerSequence,
boost::asio::yield_context yield ) const
inlineoverridevirtual

Database-specific implementation of fetching the successor key.

Parameters
keyThe key to fetch for
ledgerSequenceThe ledger sequence to fetch for
yieldThe coroutine context
Returns
The sucessor on success; nullopt otherwise

Implements data::BackendInterface.

◆ doFinishWrites()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
bool data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::doFinishWrites ( )
inlineoverridevirtual

The implementation should wait for all pending writes to finish.

Returns
true on success; false otherwise

Implements data::BackendInterface.

◆ doWriteLedgerObject()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
void data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::doWriteLedgerObject ( std::string && key,
std::uint32_t const seq,
std::string && blob )
inlineoverridevirtual

Writes a ledger object to the database.

Parameters
keyThe key of the object
seqThe sequence of the ledger
blobThe data

Implements data::BackendInterface.

◆ fetchAccountRoots()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
std::vector< ripple::uint256 > data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::fetchAccountRoots ( std::uint32_t number,
std::uint32_t pageSize,
std::uint32_t seq,
boost::asio::yield_context yield ) const
inlineoverridevirtual

Fetch the specified number of account root object indexes by page, the accounts need to exist for seq.

Parameters
numberThe number of accounts to fetch
pageSizeThe maximum number of accounts per page
seqThe accounts need to exist for this sequence
yieldThe coroutine context
Returns
A vector of ripple::uint256 representing the account roots

Implements data::BackendInterface.

◆ fetchAccountTransactions()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
TransactionsAndCursor data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::fetchAccountTransactions ( ripple::AccountID const & account,
std::uint32_t const limit,
bool forward,
std::optional< TransactionsCursor > const & cursor,
boost::asio::yield_context yield ) const
inlineoverridevirtual

Fetches all transactions for a specific account.

Parameters
accountThe account to fetch transactions for
limitThe maximum number of transactions per result page
forwardWhether to fetch the page forwards or backwards from the given cursor
cursorThe cursor to resume fetching from
yieldThe coroutine context
Returns
Results and a cursor to resume from

Implements data::BackendInterface.

◆ fetchAllTransactionHashesInLedger()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
std::vector< ripple::uint256 > data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::fetchAllTransactionHashesInLedger ( std::uint32_t const ledgerSequence,
boost::asio::yield_context yield ) const
inlineoverridevirtual

Fetches all transaction hashes from a specific ledger.

Parameters
ledgerSequenceThe ledger sequence to fetch for
yieldThe coroutine context
Returns
Hashes as ripple::uint256 in a vector

Implements data::BackendInterface.

◆ fetchAllTransactionsInLedger()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
std::vector< TransactionAndMetadata > data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::fetchAllTransactionsInLedger ( std::uint32_t const ledgerSequence,
boost::asio::yield_context yield ) const
inlineoverridevirtual

Fetches all transactions from a specific ledger.

Parameters
ledgerSequenceThe ledger sequence to fetch for
yieldThe coroutine context
Returns
Results as a vector of TransactionAndMetadata

Implements data::BackendInterface.

◆ fetchLatestLedgerSequence()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
std::optional< std::uint32_t > data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::fetchLatestLedgerSequence ( boost::asio::yield_context yield) const
inlineoverridevirtual

Fetches the latest ledger sequence.

Parameters
yieldThe coroutine context
Returns
Latest sequence wrapped in an optional if found; nullopt otherwise

Implements data::BackendInterface.

◆ fetchLedgerByHash()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
std::optional< ripple::LedgerHeader > data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::fetchLedgerByHash ( ripple::uint256 const & hash,
boost::asio::yield_context yield ) const
inlineoverridevirtual

Fetches a specific ledger by hash.

Parameters
hashThe hash to fetch for
yieldThe coroutine context
Returns
The ripple::LedgerHeader if found; nullopt otherwise

Implements data::BackendInterface.

◆ fetchLedgerBySequence()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
std::optional< ripple::LedgerHeader > data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::fetchLedgerBySequence ( std::uint32_t const sequence,
boost::asio::yield_context yield ) const
inlineoverridevirtual

Fetches a specific ledger by sequence number.

Parameters
sequenceThe sequence number to fetch for
yieldThe coroutine context
Returns
The ripple::LedgerHeader if found; nullopt otherwise

Implements data::BackendInterface.

◆ fetchLedgerDiff()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
std::vector< LedgerObject > data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::fetchLedgerDiff ( std::uint32_t const ledgerSequence,
boost::asio::yield_context yield ) const
inlineoverridevirtual

Returns the difference between ledgers.

Parameters
ledgerSequenceThe ledger sequence to fetch for
yieldThe coroutine context
Returns
A vector of LedgerObject representing the diff

Implements data::BackendInterface.

◆ fetchMigratorStatus()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
std::optional< std::string > data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::fetchMigratorStatus ( std::string const & migratorName,
boost::asio::yield_context yield ) const
inlineoverridevirtual

Fetches the status of migrator by name.

Parameters
migratorNameThe name of the migrator
yieldThe coroutine context
Returns
The status of the migrator if found; nullopt otherwise

Implements data::BackendInterface.

◆ fetchMPTHolders()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
MPTHoldersAndCursor data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::fetchMPTHolders ( ripple::uint192 const & mptID,
std::uint32_t const limit,
std::optional< ripple::AccountID > const & cursorIn,
std::uint32_t const ledgerSequence,
boost::asio::yield_context yield ) const
inlineoverridevirtual

Fetches all holders' balances for a MPTIssuanceID.

Parameters
mptIDMPTIssuanceID you wish you query.
limitPaging limit.
cursorInOptional cursor to allow us to pick up from where we last left off.
ledgerSequenceThe ledger sequence to fetch for
yieldCurrently executing coroutine.
Returns
std::vector<Blob> of MPToken balances and an optional marker

Implements data::BackendInterface.

◆ fetchNFT()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
std::optional< NFT > data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::fetchNFT ( ripple::uint256 const & tokenID,
std::uint32_t const ledgerSequence,
boost::asio::yield_context yield ) const
inlineoverridevirtual

Fetches a specific NFT.

Parameters
tokenIDThe ID of the NFT
ledgerSequenceThe ledger sequence to fetch for
yieldThe coroutine context
Returns
NFT object on success; nullopt otherwise

Implements data::BackendInterface.

◆ fetchNFTsByIssuer()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
NFTsAndCursor data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::fetchNFTsByIssuer ( ripple::AccountID const & issuer,
std::optional< std::uint32_t > const & taxon,
std::uint32_t const ledgerSequence,
std::uint32_t const limit,
std::optional< ripple::uint256 > const & cursorIn,
boost::asio::yield_context yield ) const
inlineoverridevirtual

Fetches all NFTs issued by a given address.

Parameters
issuerAccountID of issuer you wish you query.
taxonOptional taxon of NFTs by which you wish to filter.
ledgerSequenceThe ledger sequence to fetch for
limitPaging limit.
cursorInOptional cursor to allow us to pick up from where we last left off.
yieldCurrently executing coroutine.
Returns
NFTs issued by this account, or this issuer/taxon combination if taxon is passed and an optional marker

Implements data::BackendInterface.

◆ fetchNFTTransactions()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
TransactionsAndCursor data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::fetchNFTTransactions ( ripple::uint256 const & tokenID,
std::uint32_t const limit,
bool const forward,
std::optional< TransactionsCursor > const & cursorIn,
boost::asio::yield_context yield ) const
inlineoverridevirtual

Fetches all transactions for a specific NFT.

Parameters
tokenIDThe ID of the NFT
limitThe maximum number of transactions per result page
forwardWhether to fetch the page forwards or backwards from the given cursor
cursorInThe cursor to resume fetching from
yieldThe coroutine context
Returns
Results and a cursor to resume from

Implements data::BackendInterface.

◆ fetchTransaction()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
std::optional< TransactionAndMetadata > data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::fetchTransaction ( ripple::uint256 const & hash,
boost::asio::yield_context yield ) const
inlineoverridevirtual

Fetches a specific transaction.

Parameters
hashThe hash of the transaction to fetch
yieldThe coroutine context
Returns
TransactionAndMetadata if transaction is found; nullopt otherwise

Implements data::BackendInterface.

◆ fetchTransactions()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
std::vector< TransactionAndMetadata > data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::fetchTransactions ( std::vector< ripple::uint256 > const & hashes,
boost::asio::yield_context yield ) const
inlineoverridevirtual

Fetches multiple transactions.

Parameters
hashesA vector of hashes to fetch transactions for
yieldThe coroutine context
Returns
A vector of TransactionAndMetadata matching the given hashes

Implements data::BackendInterface.

◆ hardFetchLedgerRange()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
std::optional< LedgerRange > data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::hardFetchLedgerRange ( boost::asio::yield_context yield) const
inlineoverridevirtual

Fetches the ledger range from DB.

Parameters
yieldThe coroutine context
Returns
The ledger range if available; nullopt otherwise

Implements data::BackendInterface.

◆ isTooBusy()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
bool data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::isTooBusy ( ) const
inlineoverridevirtual
Returns
true if database is overwhelmed; false otherwise

Implements data::BackendInterface.

◆ startWrites()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
void data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::startWrites ( ) const
inlineoverridevirtual

Starts a write transaction with the DB. No-op for cassandra.

Note: Can potentially be deprecated and removed.

Implements data::BackendInterface.

◆ stats()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
boost::json::object data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::stats ( ) const
inlineoverridevirtual
Returns
A JSON object containing backend usage statistics

Implements data::BackendInterface.

◆ waitForWritesToFinish()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
void data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::waitForWritesToFinish ( )
inlineoverridevirtual

Wait for all pending writes to finish.

Implements data::BackendInterface.

◆ writeAccountTransactions()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
void data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::writeAccountTransactions ( std::vector< AccountTransactionsData > data)
inlineoverridevirtual

Write a new set of account transactions.

Parameters
dataA vector of AccountTransactionsData objects representing the account transactions

Implements data::BackendInterface.

◆ writeLedger()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
void data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::writeLedger ( ripple::LedgerHeader const & ledgerHeader,
std::string && blob )
inlineoverridevirtual

Writes to a specific ledger.

Parameters
ledgerHeaderLedger header.
blobr-value string serialization of ledger header.

Implements data::BackendInterface.

◆ writeMigratorStatus()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
void data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::writeMigratorStatus ( std::string const & migratorName,
std::string const & status )
inlineoverridevirtual

Mark the migration status of a migrator as Migrated in the database.

Parameters
migratorNameThe name of the migrator
statusThe status to set

Implements data::BackendInterface.

◆ writeMPTHolders()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
void data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::writeMPTHolders ( std::vector< MPTHolderData > const & data)
inlineoverridevirtual

Write accounts that started holding onto a MPT.

Parameters
dataA vector of MPT ID and account pairs

Implements data::BackendInterface.

◆ writeNFTs()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
void data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::writeNFTs ( std::vector< NFTsData > const & data)
inlineoverridevirtual

Writes NFTs to the database.

Parameters
dataA vector of NFTsData objects representing the NFTs

Implements data::BackendInterface.

◆ writeNFTTransactions()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
void data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::writeNFTTransactions ( std::vector< NFTTransactionsData > const & data)
inlineoverridevirtual

Write NFTs transactions.

Parameters
dataA vector of NFTTransactionsData objects

Implements data::BackendInterface.

◆ writeSuccessor()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
void data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::writeSuccessor ( std::string && key,
std::uint32_t const seq,
std::string && successor )
inlineoverridevirtual

Write a new successor.

Parameters
keyKey of the object that the passed successor will be the successor for
seqThe ledger sequence to write for
successorThe successor data to write

Implements data::BackendInterface.

◆ writeTransaction()

template<SomeSettingsProvider SettingsProviderType, SomeExecutionStrategy ExecutionStrategyType>
void data::cassandra::BasicCassandraBackend< SettingsProviderType, ExecutionStrategyType >::writeTransaction ( std::string && hash,
std::uint32_t const seq,
std::uint32_t const date,
std::string && transaction,
std::string && metadata )
inlineoverridevirtual

Writes a new transaction.

Parameters
hashThe hash of the transaction
seqThe ledger sequence to write for
dateThe timestamp of the entry
transactionThe transaction data to write
metadataThe metadata to write

Implements data::BackendInterface.


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