Clio develop
The XRP Ledger API server.
|
Implements async and sync querying against the cassandra DB with support for throttling. More...
#include <ExecutionStrategy.hpp>
Public Member Functions | |
DefaultExecutionStrategy (Settings const &settings, HandleType const &handle, typename BackendCountersType::PtrType counters=BackendCountersType::make()) | |
void | sync () |
Wait for all async writes to finish before unblocking. | |
bool | isTooBusy () const |
ResultOrErrorType | writeSync (StatementType const &statement) |
Blocking query execution used for writing data. | |
template<typename... Args> | |
ResultOrErrorType | writeSync (PreparedStatementType const &preparedStatement, Args &&... args) |
Blocking query execution used for writing data. | |
template<typename... Args> | |
void | write (PreparedStatementType const &preparedStatement, Args &&... args) |
Non-blocking query execution used for writing data. | |
void | write (StatementType &&statement) |
Non-blocking query execution used for writing data. | |
void | write (std::vector< StatementType > &&statements) |
Non-blocking batched query execution used for writing data. | |
void | writeEach (std::vector< StatementType > &&statements) |
Non-blocking query execution used for writing data. Constrast with write, this method does not execute the statements in a batch. | |
template<typename... Args> | |
ResultOrErrorType | read (CompletionTokenType token, PreparedStatementType const &preparedStatement, Args &&... args) |
Coroutine-based query execution used for reading data. | |
ResultOrErrorType | read (CompletionTokenType token, std::vector< StatementType > const &statements) |
Coroutine-based query execution used for reading data. | |
ResultOrErrorType | read (CompletionTokenType token, StatementType const &statement) |
Coroutine-based query execution used for reading data. | |
std::vector< ResultType > | readEach (CompletionTokenType token, std::vector< StatementType > const &statements) |
Coroutine-based query execution used for reading data. | |
boost::json::object | stats () const |
Get statistics about the backend. | |
Implements async and sync querying against the cassandra DB with support for throttling.
Note: A lot of the code that uses yield is repeated below. This is ok for now because we are hopefully going to be getting rid of it entirely later on.
|
inline |
settings | The settings to use |
handle | A handle to the cassandra database |
|
inline |
|
inline |
Coroutine-based query execution used for reading data.
Retries forever until successful or throws an exception on timeout.
token | Completion token (yield_context) |
preparedStatement | Statement to prepare and execute |
args | Args to bind to the prepared statement |
DatabaseTimeout | on timeout |
|
inline |
Coroutine-based query execution used for reading data.
Retries forever until successful or throws an exception on timeout.
token | Completion token (yield_context) |
statement | Statement to execute |
DatabaseTimeout | on timeout |
|
inline |
Coroutine-based query execution used for reading data.
Retries forever until successful or throws an exception on timeout.
token | Completion token (yield_context) |
statements | Statements to execute in a batch |
DatabaseTimeout | on timeout |
|
inline |
Coroutine-based query execution used for reading data.
Attempts to execute each statement. On any error the whole vector will be discarded and exception will be thrown.
token | Completion token (yield_context) |
statements | Statements to execute |
DatabaseTimeout | on db error |
|
inline |
Non-blocking query execution used for writing data.
Retries forever with retry policy specified by AsyncExecutor
preparedStatement | Statement to prepare and execute |
args | Args to bind to the prepared statement |
DatabaseTimeout | on timeout |
|
inline |
Non-blocking query execution used for writing data.
Retries forever with retry policy specified by AsyncExecutor
statement | Statement to execute |
DatabaseTimeout | on timeout |
|
inline |
Non-blocking batched query execution used for writing data.
Retries forever with retry policy specified by AsyncExecutor.
statements | Vector of statements to execute as a batch |
DatabaseTimeout | on timeout |
|
inline |
Non-blocking query execution used for writing data. Constrast with write, this method does not execute the statements in a batch.
Retries forever with retry policy specified by AsyncExecutor.
statements | Vector of statements to execute |
DatabaseTimeout | on timeout |
|
inline |
Blocking query execution used for writing data.
Retries forever sleeping for 5 milliseconds between attempts.
|
inline |
Blocking query execution used for writing data.
Retries forever sleeping for 5 milliseconds between attempts.