Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
CacheLoaderSettings.hpp
1//------------------------------------------------------------------------------
2/*
3 This file is part of clio: https://github.com/XRPLF/clio
4 Copyright (c) 2024, the clio developers.
5
6 Permission to use, copy, modify, and distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#pragma once
21
22#include "util/newconfig/ConfigDefinition.hpp"
23
24#include <cstddef>
25
26namespace etl {
27
33 enum class LoadStyle { ASYNC, SYNC, NONE };
34
35 size_t numCacheDiffs = 32;
36 size_t numCacheMarkers = 48;
37 size_t cachePageFetchSize = 512;
38 size_t numThreads = 2;
42 LoadStyle loadStyle = LoadStyle::ASYNC;
44 auto
45 operator<=>(CacheLoaderSettings const&) const = default;
46
48 [[nodiscard]] bool
49 isSync() const;
50
52 [[nodiscard]] bool
53 isAsync() const;
54
56 [[nodiscard]] bool
57 isDisabled() const;
58};
59
66[[nodiscard]] CacheLoaderSettings
68
69} // namespace etl
All the config data will be stored and extracted from this class.
Definition ConfigDefinition.hpp:54
This namespace contains everything to do with the ETL and ETL sources.
Definition CacheLoader.hpp:36
CacheLoaderSettings makeCacheLoaderSettings(util::config::ClioConfigDefinition const &config)
Create a CacheLoaderSettings object from a Config object.
Definition CacheLoaderSettings.cpp:51
Settings for the cache loader.
Definition CacheLoaderSettings.hpp:31
bool isDisabled() const
Definition CacheLoaderSettings.cpp:45
bool isSync() const
Definition CacheLoaderSettings.cpp:33
size_t numCacheMarkers
Definition CacheLoaderSettings.hpp:36
size_t numCacheCursorsFromAccount
Definition CacheLoaderSettings.hpp:40
LoadStyle loadStyle
Definition CacheLoaderSettings.hpp:42
LoadStyle
Ways to load the cache.
Definition CacheLoaderSettings.hpp:33
size_t numThreads
Definition CacheLoaderSettings.hpp:38
size_t cachePageFetchSize
Definition CacheLoaderSettings.hpp:37
size_t numCacheDiffs
Definition CacheLoaderSettings.hpp:35
bool isAsync() const
Definition CacheLoaderSettings.cpp:39
size_t numCacheCursorsFromDiff
Definition CacheLoaderSettings.hpp:39