Clio  develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
CacheLoaderSettings.hpp
1#pragma once
2
3#include "util/config/ConfigDefinition.hpp"
4
5#include <cstddef>
6#include <cstdint>
7#include <optional>
8#include <string>
9
10namespace etl {
11
19 enum class LoadStyle {
23 };
24
29 std::string
31 uint32_t maxAge = 5000;
32
33 auto
34 operator<=>(CacheFileSettings const&) const = default;
35 };
36
37 size_t numCacheDiffs = 32;
38 size_t numCacheMarkers = 48;
39 size_t cachePageFetchSize = 512;
40 size_t numThreads = 2;
43
45 std::optional<CacheFileSettings>
47
48 auto
49 operator<=>(CacheLoaderSettings const&) const = default;
50
54 [[nodiscard]] bool
55 isSync() const;
56
60 [[nodiscard]] bool
61 isAsync() const;
62
66 [[nodiscard]] bool
67 isDisabled() const;
68};
69
76[[nodiscard]] CacheLoaderSettings
78
79} // namespace etl
All the config data will be stored and extracted from this class.
Definition ConfigDefinition.hpp:31
This namespace contains everything to do with the ETL and ETL sources.
Definition AmendmentBlockHandlerInterface.hpp:6
CacheLoaderSettings makeCacheLoaderSettings(util::config::ClioConfigDefinition const &config)
Create a CacheLoaderSettings object from a Config object.
Definition CacheLoaderSettings.cpp:33
Settings for cache file operations.
Definition CacheLoaderSettings.hpp:28
std::string path
path to the file to load cache from on start and save cache to on shutdown
Definition CacheLoaderSettings.hpp:30
uint32_t maxAge
max difference between latest sequence in cache file and DB
Definition CacheLoaderSettings.hpp:31
Settings for the cache loader.
Definition CacheLoaderSettings.hpp:15
bool isDisabled() const
Definition CacheLoaderSettings.cpp:27
bool isSync() const
Definition CacheLoaderSettings.cpp:15
size_t numCacheMarkers
number of markers to use at one time to traverse the ledger
Definition CacheLoaderSettings.hpp:38
std::optional< CacheFileSettings > cacheFileSettings
optional settings for cache file operations
Definition CacheLoaderSettings.hpp:46
size_t numCacheCursorsFromAccount
number of cursors to fetch from account_tx
Definition CacheLoaderSettings.hpp:42
LoadStyle loadStyle
how to load the cache
Definition CacheLoaderSettings.hpp:44
LoadStyle
Ways to load the cache.
Definition CacheLoaderSettings.hpp:19
@ SYNC
Block startup until the cache is fully loaded.
Definition CacheLoaderSettings.hpp:21
@ NONE
Do not load the cache; the cache is disabled.
Definition CacheLoaderSettings.hpp:22
@ ASYNC
Load the cache in the background without blocking startup.
Definition CacheLoaderSettings.hpp:20
size_t numThreads
number of threads to use for loading cache
Definition CacheLoaderSettings.hpp:40
size_t cachePageFetchSize
number of ledger objects to fetch concurrently per marker
Definition CacheLoaderSettings.hpp:39
size_t numCacheDiffs
number of diffs to use to generate cursors
Definition CacheLoaderSettings.hpp:37
bool isAsync() const
Definition CacheLoaderSettings.cpp:21
size_t numCacheCursorsFromDiff
number of cursors to fetch from diff
Definition CacheLoaderSettings.hpp:41