22#include "data/BackendInterface.hpp"
23#include "etl/SystemState.hpp"
24#include "etl/impl/LedgerLoader.hpp"
25#include "etlng/AmendmentBlockHandlerInterface.hpp"
26#include "etlng/InitialLoadObserverInterface.hpp"
27#include "etlng/LoaderInterface.hpp"
28#include "etlng/Models.hpp"
29#include "etlng/RegistryInterface.hpp"
30#include "util/log/Logger.hpp"
32#include <org/xrpl/rpc/v1/ledger.pb.h>
33#include <xrpl/basics/Slice.h>
34#include <xrpl/basics/base_uint.h>
35#include <xrpl/basics/strHex.h>
36#include <xrpl/proto/org/xrpl/rpc/v1/get_ledger.pb.h>
37#include <xrpl/protocol/LedgerHeader.h>
38#include <xrpl/protocol/STTx.h>
39#include <xrpl/protocol/Serializer.h>
40#include <xrpl/protocol/TxMeta.h>
49namespace etlng::impl {
52 std::shared_ptr<BackendInterface> backend_;
53 std::shared_ptr<RegistryInterface> registry_;
54 std::shared_ptr<AmendmentBlockHandlerInterface> amendmentBlockHandler_;
55 std::shared_ptr<etl::SystemState> state_;
57 std::size_t initialLoadWrittenObjects_{0u};
58 std::size_t initialLoadWrites_{0u};
62 using RawLedgerObjectType = org::xrpl::rpc::v1::RawLedgerObject;
63 using GetLedgerResponseType = org::xrpl::rpc::v1::GetLedgerResponse;
64 using OptionalGetLedgerResponseType = std::optional<GetLedgerResponseType>;
67 std::shared_ptr<BackendInterface> backend,
68 std::shared_ptr<RegistryInterface> registry,
69 std::shared_ptr<AmendmentBlockHandlerInterface> amendmentBlockHandler,
70 std::shared_ptr<etl::SystemState> state
76 operator=(
Loader const&) =
delete;
78 operator=(
Loader&&) =
delete;
80 std::expected<void, Error>
86 std::vector<model::Object>
const&
data,
87 std::optional<std::string> lastKey
90 std::optional<ripple::LedgerHeader>
Definition Loading.hpp:51
std::expected< void, Error > load(model::LedgerData const &data) override
Load ledger data.
Definition Loading.cpp:63
void onInitialLoadGotMoreObjects(uint32_t seq, std::vector< model::Object > const &data, std::optional< std::string > lastKey) override
Callback for each incoming batch of objects during initial ledger load.
Definition Loading.cpp:94
std::optional< ripple::LedgerHeader > loadInitialLedger(model::LedgerData const &data) override
Load the initial ledger.
Definition Loading.cpp:133
A simple thread-safe logger for the channel specified in the constructor.
Definition Logger.hpp:111
This namespace implements the data access layer and related components.
Definition AmendmentCenter.cpp:70
The interface for observing the initial ledger load.
Definition InitialLoadObserverInterface.hpp:36
An interface for a ETL Loader.
Definition LoaderInterface.hpp:37
Represents an entire ledger diff worth of transactions and objects.
Definition Models.hpp:143