Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/app/CliArgs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,32 @@ class CliArgs {
*/
class Action {
public:
/** @brief Run action. */
/**
* @brief Run action.
*/
struct Run {
std::string configPath; ///< Configuration file path.
bool useNgWebServer; ///< Whether to use a ng web server
};

/** @brief Exit action. */
/**
* @brief Exit action.
*/
struct Exit {
int exitCode; ///< Exit code.
};

/** @brief Migration action. */
/**
* @brief Migration action.
*/
struct Migrate {
std::string configPath;
MigrateSubCmd subCmd;
};

/** @brief Verify Config action. */
/**
* @brief Verify Config action.
*/
struct VerifyConfig {
std::string configPath;
};
Expand Down
3 changes: 2 additions & 1 deletion src/cluster/Backend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ namespace cluster {
*/
class Backend {
public:
/** @brief Type representing cluster data result - either a vector of nodes or an error message
/**
* @brief Type representing cluster data result - either a vector of nodes or an error message
*/
using ClusterData = std::expected<std::vector<ClioNode>, std::string>;

Expand Down
8 changes: 6 additions & 2 deletions src/cluster/CacheLoaderDecider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ namespace cluster {
* This ensures at most one node in the cluster loads the cache at a time.
*/
class CacheLoaderDecider {
/** @brief Thread pool for spawning asynchronous tasks */
/**
* @brief Thread pool for spawning asynchronous tasks
*/
boost::asio::thread_pool& ctx_;

/** @brief Interface for controlling cache loading permission of this node */
/**
* @brief Interface for controlling cache loading permission of this node
*/
std::unique_ptr<data::LedgerCacheLoadingStateInterface> cacheLoadingState_;

public:
Expand Down
8 changes: 6 additions & 2 deletions src/cluster/Metrics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,18 @@ namespace cluster {
* - Health status of cluster communication
*/
class Metrics {
/** @brief Gauge tracking the total number of nodes visible in the cluster */
/**
* @brief Gauge tracking the total number of nodes visible in the cluster
*/
util::prometheus::GaugeInt& nodesInClusterMetric_ = PrometheusService::gaugeInt(
"cluster_nodes_total_number",
{},
"Total number of nodes this node can detect in the cluster."
);

/** @brief Boolean metric indicating whether cluster communication is healthy */
/**
* @brief Boolean metric indicating whether cluster communication is healthy
*/
util::prometheus::Bool isHealthy_ = PrometheusService::boolMetric(
"cluster_communication_is_healthy",
{},
Expand Down
8 changes: 6 additions & 2 deletions src/cluster/WriterDecider.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,14 @@ class WriterDecider {
static constexpr std::chrono::steady_clock::duration kRecoveryTime = std::chrono::hours{1};

private:
/** @brief Thread pool for spawning asynchronous tasks */
/**
* @brief Thread pool for spawning asynchronous tasks
*/
boost::asio::thread_pool& ctx_;

/** @brief Interface for controlling the writer state of this node */
/**
* @brief Interface for controlling the writer state of this node
*/
std::unique_ptr<etl::WriterStateInterface> writerState_;

/**
Expand Down
4 changes: 3 additions & 1 deletion src/data/BackendInterface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,9 @@ class BackendInterface {
boost::asio::yield_context yield
) const = 0;

/** @brief Return type for fetchClioNodesData() method */
/**
* @brief Return type for fetchClioNodesData() method
*/
using ClioNodesDataFetchResult =
std::expected<std::vector<std::pair<boost::uuids::uuid, std::string>>, std::string>;

Expand Down
2 changes: 1 addition & 1 deletion src/data/CassandraBackend.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class BasicCassandraBackend : public CassandraBackendFamily<
*/
using DefaultCassandraFamily::DefaultCassandraFamily;

/*
/**
* @brief Move constructor is deleted because handle_ is shared by reference with executor
*/
BasicCassandraBackend(BasicCassandraBackend&&) = delete;
Expand Down
4 changes: 3 additions & 1 deletion src/data/DBHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,5 +286,7 @@ uint256ToString(xrpl::uint256 const& input)
return {reinterpret_cast<char const*>(input.data()), xrpl::uint256::size()};
}

/** @brief The ripple epoch start timestamp. Midnight on 1st January 2000. */
/**
* @brief The ripple epoch start timestamp. Midnight on 1st January 2000.
*/
static constexpr std::uint32_t kRippleEpochStart = 946684800;
4 changes: 3 additions & 1 deletion src/data/LedgerCache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ namespace data {
*/
class LedgerCache : public LedgerCacheInterface {
public:
/** @brief An entry of the cache */
/**
* @brief An entry of the cache
*/
struct CacheEntry {
uint32_t seq = 0;
Blob blob;
Expand Down
20 changes: 15 additions & 5 deletions src/data/LedgerCacheLoadingState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,23 +73,33 @@ class LedgerCacheLoadingState : public LedgerCacheLoadingStateInterface {
*/
explicit LedgerCacheLoadingState(LedgerCacheInterface const& cache);

/** @copydoc LedgerCacheLoadingStateInterface::allowLoading() */
/**
* @copydoc LedgerCacheLoadingStateInterface::allowLoading()
*/
void
allowLoading() override;

/** @copydoc LedgerCacheLoadingStateInterface::isLoadingAllowed() */
/**
* @copydoc LedgerCacheLoadingStateInterface::isLoadingAllowed()
*/
[[nodiscard]] bool
isLoadingAllowed() const override;

/** @copydoc LedgerCacheLoadingStateInterface::waitForLoadingAllowed() */
/**
* @copydoc LedgerCacheLoadingStateInterface::waitForLoadingAllowed()
*/
void
waitForLoadingAllowed() const override;

/** @copydoc LedgerCacheLoadingStateInterface::isCurrentlyLoading() */
/**
* @copydoc LedgerCacheLoadingStateInterface::isCurrentlyLoading()
*/
[[nodiscard]] bool
isCurrentlyLoading() const override;

/** @copydoc LedgerCacheLoadingStateInterface::clone() */
/**
* @copydoc LedgerCacheLoadingStateInterface::clone()
*/
[[nodiscard]] std::unique_ptr<LedgerCacheLoadingStateInterface>
clone() const override;
};
Expand Down
12 changes: 9 additions & 3 deletions src/data/Types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,19 @@ struct AmendmentKey {
{
}

/** @brief Conversion to string */
/**
* @brief Conversion to string
*/
operator std::string const&() const;

/** @brief Conversion to string_view */
/**
* @brief Conversion to string_view
*/
operator std::string_view() const;

/** @brief Conversion to uint256 */
/**
* @brief Conversion to uint256
*/
operator xrpl::uint256() const;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/data/cassandra/CassandraBackendFamily.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class CassandraBackendFamily : public BackendInterface {
LOG(log_.info()) << "Created (revamped) CassandraBackend";
}

/*
/**
* @brief Move constructor is deleted because handle_ is shared by reference with executor
*/
CassandraBackendFamily(CassandraBackendFamily&&) = delete;
Expand Down
56 changes: 42 additions & 14 deletions src/data/cassandra/impl/Cluster.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,50 +56,78 @@ struct Settings {
std::string bundle; // no meaningful default
};

/** @brief Enables or disables cassandra driver logger */
/**
* @brief Enables or disables cassandra driver logger
*/
bool enableLog = false;

/** @brief Connect timeout specified in milliseconds */
/**
* @brief Connect timeout specified in milliseconds
*/
std::chrono::milliseconds connectionTimeout =
std::chrono::milliseconds{kDefaultConnectionTimeout};

/** @brief Request timeout specified in milliseconds */
/**
* @brief Request timeout specified in milliseconds
*/
std::chrono::milliseconds requestTimeout = std::chrono::milliseconds{0}; // no timeout at all

/** @brief Connection information; either ContactPoints or SecureConnectionBundle */
/**
* @brief Connection information; either ContactPoints or SecureConnectionBundle
*/
std::variant<ContactPoints, SecureConnectionBundle> connectionInfo = ContactPoints{};

/** @brief The number of threads for the driver to pool */
/**
* @brief The number of threads for the driver to pool
*/
uint32_t threads = std::thread::hardware_concurrency();

/** @brief The maximum number of outstanding write requests at any given moment */
/**
* @brief The maximum number of outstanding write requests at any given moment
*/
uint32_t maxWriteRequestsOutstanding = kDefaultMaxWriteRequestsOutstanding;

/** @brief The maximum number of outstanding read requests at any given moment */
/**
* @brief The maximum number of outstanding read requests at any given moment
*/
uint32_t maxReadRequestsOutstanding = kDefaultMaxReadRequestsOutstanding;

/** @brief The number of connection per host to always have active */
/**
* @brief The number of connection per host to always have active
*/
uint32_t coreConnectionsPerHost = 3u;

/** @brief Size of batches when writing */
/**
* @brief Size of batches when writing
*/
std::size_t writeBatchSize = kDefaultBatchSize;

/** @brief Provider to know if we are using scylladb or keyspace */
/**
* @brief Provider to know if we are using scylladb or keyspace
*/
Provider provider = kDefaultProvider;

/** @brief Size of the IO queue */
/**
* @brief Size of the IO queue
*/
std::optional<uint32_t> queueSizeIO =
std::nullopt; // NOLINT(readability-redundant-member-init)

/** @brief SSL certificate */
/**
* @brief SSL certificate
*/
std::optional<std::string> certificate =
std::nullopt; // NOLINT(readability-redundant-member-init)

/** @brief Username/login */
/**
* @brief Username/login
*/
std::optional<std::string> username =
std::nullopt; // NOLINT(readability-redundant-member-init)

/** @brief Password to match the `username` */
/**
* @brief Password to match the `username`
*/
std::optional<std::string> password =
std::nullopt; // NOLINT(readability-redundant-member-init)

Expand Down
16 changes: 8 additions & 8 deletions src/data/cassandra/impl/ExecutionStrategy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class DefaultExecutionStrategy {
*
* @param preparedStatement Statement to prepare and execute
* @param args Args to bind to the prepared statement
* @throw DatabaseTimeout on timeout
* @throws DatabaseTimeout on timeout
*/
template <typename... Args>
void
Expand All @@ -185,7 +185,7 @@ class DefaultExecutionStrategy {
* Retries forever with retry policy specified by @ref AsyncExecutor
*
* @param statement Statement to execute
* @throw DatabaseTimeout on timeout
* @throws DatabaseTimeout on timeout
*/
void
write(StatementType&& statement)
Expand Down Expand Up @@ -215,7 +215,7 @@ class DefaultExecutionStrategy {
* Retries forever with retry policy specified by @ref AsyncExecutor.
*
* @param statements Vector of statements to execute as a batch
* @throw DatabaseTimeout on timeout
* @throws DatabaseTimeout on timeout
*/
void
write(std::vector<StatementType>&& statements)
Expand Down Expand Up @@ -254,7 +254,7 @@ class DefaultExecutionStrategy {
* Retries forever with retry policy specified by @ref AsyncExecutor.
*
* @param statements Vector of statements to execute
* @throw DatabaseTimeout on timeout
* @throws DatabaseTimeout on timeout
*/
void
writeEach(std::vector<StatementType>&& statements)
Expand All @@ -272,7 +272,7 @@ class DefaultExecutionStrategy {
* @param token Completion token (yield_context)
* @param preparedStatement Statement to prepare and execute
* @param args Args to bind to the prepared statement
* @throw DatabaseTimeout on timeout
* @throws DatabaseTimeout on timeout
* @return ResultType or error wrapped in Expected
*/
template <typename... Args>
Expand All @@ -289,7 +289,7 @@ class DefaultExecutionStrategy {
*
* @param token Completion token (yield_context)
* @param statements Statements to execute in a batch
* @throw DatabaseTimeout on timeout
* @throws DatabaseTimeout on timeout
* @return ResultType or error wrapped in Expected
*/
[[maybe_unused]] ResultOrErrorType
Expand Down Expand Up @@ -346,7 +346,7 @@ class DefaultExecutionStrategy {
*
* @param token Completion token (yield_context)
* @param statement Statement to execute
* @throw DatabaseTimeout on timeout
* @throws DatabaseTimeout on timeout
* @return ResultType or error wrapped in Expected
*/
[[maybe_unused]] ResultOrErrorType
Expand Down Expand Up @@ -402,7 +402,7 @@ class DefaultExecutionStrategy {
*
* @param token Completion token (yield_context)
* @param statements Statements to execute
* @throw DatabaseTimeout on db error
* @throws DatabaseTimeout on db error
* @return Vector of results
*/
std::vector<ResultType>
Expand Down
4 changes: 3 additions & 1 deletion src/data/cassandra/impl/Future.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ class FutureWithCallback : public Future {
FutureWithCallback(FutureWithCallback&&) = default;

private:
/** Wrapped in a unique_ptr so it can survive std::move :/ */
/**
* Wrapped in a unique_ptr so it can survive std::move :/
*/
FnPtrType cb_;
};

Expand Down
Loading
Loading