xrpld
Loading...
Searching...
No Matches
NodeFamily.h
1#pragma once
2
3#include <xrpld/app/main/CollectorManager.h>
4
5#include <xrpl/basics/base_uint.h>
6#include <xrpl/beast/utility/Journal.h>
7#include <xrpl/nodestore/Database.h>
8#include <xrpl/protocol/Protocol.h>
9#include <xrpl/shamap/Family.h>
10#include <xrpl/shamap/FullBelowCache.h>
11#include <xrpl/shamap/TreeNodeCache.h>
12
13#include <cstdint>
14#include <memory>
15#include <mutex>
16
17namespace xrpl {
18
19class Application;
20
21class NodeFamily : public Family
22{
23public:
24 NodeFamily() = delete;
25 NodeFamily(NodeFamily const&) = delete;
27
29 operator=(NodeFamily const&) = delete;
30
32 operator=(NodeFamily&&) = delete;
33
35
37 db() override
38 {
39 return db_;
40 }
41
42 [[nodiscard]] node_store::Database const&
43 db() const override
44 {
45 return db_;
46 }
47
48 beast::Journal const&
49 journal() override
50 {
51 return j_;
52 }
53
56 {
57 return fbCache_;
58 }
59
62 {
63 return tnCache_;
64 }
65
66 void
67 sweep() override;
68
69 void
70 reset() override;
71
72 void
73 missingNodeAcquireBySeq(std::uint32_t seq, uint256 const& hash) override;
74
75 void
77 {
78 acquire(hash, seq);
79 }
80
81private:
85
88
89 // Missing node handler
92
93 void
94 acquire(uint256 const& hash, std::uint32_t seq);
95};
96
97} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:44
Provides the beast::insight::Collector service.
Family(Family const &)=delete
beast::Journal const & journal() override
Definition NodeFamily.h:49
std::shared_ptr< FullBelowCache > getFullBelowCache() override
Return a pointer to the Family Full Below Cache.
Definition NodeFamily.h:55
NodeFamily & operator=(NodeFamily &&)=delete
void reset() override
std::shared_ptr< TreeNodeCache > tnCache_
Definition NodeFamily.h:87
Application & app_
Definition NodeFamily.h:82
NodeFamily(NodeFamily const &)=delete
NodeFamily(NodeFamily &&)=delete
std::shared_ptr< TreeNodeCache > getTreeNodeCache() override
Return a pointer to the Family Tree Node Cache.
Definition NodeFamily.h:61
node_store::Database & db() override
Definition NodeFamily.h:37
void acquire(uint256 const &hash, std::uint32_t seq)
NodeFamily & operator=(NodeFamily const &)=delete
node_store::Database const & db() const override
Definition NodeFamily.h:43
void sweep() override
void missingNodeAcquireByHash(uint256 const &hash, std::uint32_t seq) override
Acquire ledger that has a missing node by ledger hash.
Definition NodeFamily.h:76
std::mutex maxSeqMutex_
Definition NodeFamily.h:91
NodeFamily()=delete
std::shared_ptr< FullBelowCache > fbCache_
Definition NodeFamily.h:86
node_store::Database & db_
Definition NodeFamily.h:83
beast::Journal const j_
Definition NodeFamily.h:84
LedgerIndex maxSeq_
Definition NodeFamily.h:90
void missingNodeAcquireBySeq(std::uint32_t seq, uint256 const &hash) override
Acquire ledger that has a missing node by ledger sequence.
Persistency layer for NodeObject.
Definition Database.h:45
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::uint32_t LedgerIndex
A ledger index.
Definition Protocol.h:370
BaseUInt< 256 > uint256
Definition base_uint.h:580