rippled
Loading...
Searching...
No Matches
NodeFamily.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2020 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or 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#ifndef RIPPLE_SHAMAP_NODEFAMILY_H_INCLUDED
21#define RIPPLE_SHAMAP_NODEFAMILY_H_INCLUDED
22
23#include <xrpld/app/main/CollectorManager.h>
24#include <xrpld/shamap/Family.h>
25
26namespace ripple {
27
28class Application;
29
30class NodeFamily : public Family
31{
32public:
33 NodeFamily() = delete;
34 NodeFamily(NodeFamily const&) = delete;
36
38 operator=(NodeFamily const&) = delete;
39
41 operator=(NodeFamily&&) = delete;
42
44
46 db() override
47 {
48 return db_;
49 }
50
52 db() const override
53 {
54 return db_;
55 }
56
57 beast::Journal const&
58 journal() override
59 {
60 return j_;
61 }
62
65 {
66 return fbCache_;
67 }
68
71 {
72 return tnCache_;
73 }
74
75 void
76 sweep() override;
77
78 void
79 reset() override;
80
81 void
82 missingNodeAcquireBySeq(std::uint32_t seq, uint256 const& hash) override;
83
84 void
86 {
87 acquire(hash, seq);
88 }
89
90private:
94
97
98 // Missing node handler
101
102 void
103 acquire(uint256 const& hash, std::uint32_t seq);
104};
105
106} // namespace ripple
107
108#endif
A generic endpoint for log messages.
Definition: Journal.h:60
Provides the beast::insight::Collector service.
LedgerIndex maxSeq_
Definition: NodeFamily.h:99
NodeFamily & operator=(NodeFamily &&)=delete
std::shared_ptr< TreeNodeCache > getTreeNodeCache() override
Return a pointer to the Family Tree Node Cache.
Definition: NodeFamily.h:70
NodeStore::Database & db_
Definition: NodeFamily.h:92
std::shared_ptr< TreeNodeCache > tnCache_
Definition: NodeFamily.h:96
void sweep() override
Definition: NodeFamily.cpp:51
NodeFamily(NodeFamily &&)=delete
void acquire(uint256 const &hash, std::uint32_t seq)
Definition: NodeFamily.cpp:99
std::shared_ptr< FullBelowCache > fbCache_
Definition: NodeFamily.h:95
NodeStore::Database & db() override
Definition: NodeFamily.h:46
beast::Journal const & journal() override
Definition: NodeFamily.h:58
beast::Journal const j_
Definition: NodeFamily.h:93
NodeFamily & operator=(NodeFamily const &)=delete
void missingNodeAcquireByHash(uint256 const &hash, std::uint32_t seq) override
Acquire ledger that has a missing node by ledger hash.
Definition: NodeFamily.h:85
Application & app_
Definition: NodeFamily.h:91
std::mutex maxSeqMutex_
Definition: NodeFamily.h:100
void reset() override
Definition: NodeFamily.cpp:58
NodeStore::Database const & db() const override
Definition: NodeFamily.h:52
std::shared_ptr< FullBelowCache > getFullBelowCache() override
Return a pointer to the Family Full Below Cache.
Definition: NodeFamily.h:64
void missingNodeAcquireBySeq(std::uint32_t seq, uint256 const &hash) override
Acquire ledger that has a missing node by ledger sequence.
Definition: NodeFamily.cpp:70
NodeFamily(NodeFamily const &)=delete
Persistency layer for NodeObject.
Definition: Database.h:52
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:25