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 { ASYNC, SYNC, NONE };
20
25 std::string
27 uint32_t maxAge = 5000;
28
29 auto
30 operator<=>(CacheFileSettings const&) const = default;
31 };
32
33 size_t numCacheDiffs = 32;
34 size_t numCacheMarkers = 48;
35 size_t cachePageFetchSize = 512;
36 size_t numThreads = 2;
39
40 LoadStyle loadStyle = LoadStyle::ASYNC;
41 std::optional<CacheFileSettings>
43
44 auto
45 operator<=>(CacheLoaderSettings const&) const = default;
46
50 [[nodiscard]] bool
51 isSync() const;
52
56 [[nodiscard]] bool
57 isAsync() const;
58
62 [[nodiscard]] bool
63 isDisabled() const;
64};
65
72[[nodiscard]] CacheLoaderSettings
73makeCacheLoaderSettings(util::config::ClioConfigDefinition const& config);
74
75} // namespace etl
All the config data will be stored and extracted from this class.
Definition ConfigDefinition.hpp:31
Settings for cache file operations.
Definition CacheLoaderSettings.hpp:24
std::string path
path to the file to load cache from on start and save cache to on shutdown
Definition CacheLoaderSettings.hpp:26
uint32_t maxAge
max difference between latest sequence in cache file and DB
Definition CacheLoaderSettings.hpp:27
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:34
std::optional< CacheFileSettings > cacheFileSettings
optional settings for cache file operations
Definition CacheLoaderSettings.hpp:42
size_t numCacheCursorsFromAccount
number of cursors to fetch from account_tx
Definition CacheLoaderSettings.hpp:38
LoadStyle loadStyle
how to load the cache
Definition CacheLoaderSettings.hpp:40
LoadStyle
Ways to load the cache.
Definition CacheLoaderSettings.hpp:19
size_t numThreads
number of threads to use for loading cache
Definition CacheLoaderSettings.hpp:36
size_t cachePageFetchSize
number of ledger objects to fetch concurrently per marker
Definition CacheLoaderSettings.hpp:35
size_t numCacheDiffs
number of diffs to use to generate cursors
Definition CacheLoaderSettings.hpp:33
bool isAsync() const
Definition CacheLoaderSettings.cpp:21
size_t numCacheCursorsFromDiff
number of cursors to fetch from diff
Definition CacheLoaderSettings.hpp:37