rippled
Loading...
Searching...
No Matches
InboundLedgers.h
1#ifndef XRPL_APP_LEDGER_INBOUNDLEDGERS_H_INCLUDED
2#define XRPL_APP_LEDGER_INBOUNDLEDGERS_H_INCLUDED
3
4#include <xrpld/app/ledger/InboundLedger.h>
5
6#include <xrpl/protocol/RippleLedgerHash.h>
7
8namespace ripple {
9
15{
16public:
18
19 virtual ~InboundLedgers() = default;
20
21 // Callers should use this if they possibly need an authoritative
22 // response immediately.
25
26 // Callers should use this if they are known to be executing on the Job
27 // Queue. TODO review whether all callers of acquire() can use this
28 // instead. Inbound ledger acquisition is asynchronous anyway.
29 virtual void
31 uint256 const& hash,
32 std::uint32_t seq,
33 InboundLedger::Reason reason) = 0;
34
36 find(LedgerHash const& hash) = 0;
37
38 // VFALCO TODO Remove the dependency on the Peer object.
39 //
40 virtual bool
42 LedgerHash const& ledgerHash,
45
46 virtual void
48
49 virtual void
50 logFailure(uint256 const& h, std::uint32_t seq) = 0;
51
52 virtual bool
53 isFailure(uint256 const& h) = 0;
54
55 virtual void
57
58 virtual Json::Value
59 getInfo() = 0;
60
62 virtual std::size_t
63 fetchRate() = 0;
64
66 virtual void
68
69 virtual void
71 virtual void
72 sweep() = 0;
73
74 virtual void
75 stop() = 0;
76
77 virtual std::size_t
78 cacheSize() = 0;
79};
80
83 Application& app,
85 beast::insight::Collector::ptr const& collector);
86
87} // namespace ripple
88
89#endif
Represents a JSON value.
Definition json_value.h:130
Manages the lifetime of inbound ledgers.
virtual void clearFailures()=0
virtual void sweep()=0
virtual void acquireAsync(uint256 const &hash, std::uint32_t seq, InboundLedger::Reason reason)=0
virtual std::shared_ptr< Ledger const > acquire(uint256 const &hash, std::uint32_t seq, InboundLedger::Reason)=0
virtual Json::Value getInfo()=0
virtual void stop()=0
virtual void logFailure(uint256 const &h, std::uint32_t seq)=0
virtual bool gotLedgerData(LedgerHash const &ledgerHash, std::shared_ptr< Peer >, std::shared_ptr< protocol::TMLedgerData >)=0
virtual std::size_t cacheSize()=0
virtual ~InboundLedgers()=default
virtual std::shared_ptr< InboundLedger > find(LedgerHash const &hash)=0
virtual std::size_t fetchRate()=0
Returns the rate of historical ledger fetches per minute.
virtual bool isFailure(uint256 const &h)=0
virtual void gotFetchPack()=0
virtual void gotStaleData(std::shared_ptr< protocol::TMLedgerData > packet)=0
virtual void onLedgerFetched()=0
Called when a complete ledger is obtained.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
std::unique_ptr< InboundLedgers > make_InboundLedgers(Application &app, InboundLedgers::clock_type &clock, beast::insight::Collector::ptr const &collector)