|
rippled
|
Stores IP addresses useful for gaining initial connections. More...
#include <Bootcache.h>

Classes | |
| class | Entry |
| struct | Transform |
Public Types | |
| using | iterator = boost::transform_iterator< Transform, map_type::right_map::const_iterator > |
| using | const_iterator = iterator |
Public Member Functions | |
| Bootcache (Store &store, clock_type &clock, beast::Journal journal) | |
| ~Bootcache () | |
| bool | empty () const |
Returns true if the cache is empty. | |
| map_type::size_type | size () const |
| Returns the number of entries in the cache. | |
| void | load () |
| Load the persisted data from the Store into the container. | |
| bool | insert (beast::IP::Endpoint const &endpoint) |
| Add a newly-learned address to the cache. | |
| bool | insertStatic (beast::IP::Endpoint const &endpoint) |
| Add a staticallyconfigured address to the cache. | |
| void | on_success (beast::IP::Endpoint const &endpoint) |
| Called when an outbound connection handshake completes. | |
| void | on_failure (beast::IP::Endpoint const &endpoint) |
| Called when an outbound connection attempt fails to handshake. | |
| void | periodicActivity () |
| Stores the cache in the persistent database on a timer. | |
| void | onWrite (beast::PropertyStream::Map &map) |
| Write the cache state to the property stream. | |
| const_iterator | begin () const |
| IP::Endpoint iterators that traverse in decreasing valence. | |
| const_iterator | cbegin () const |
| const_iterator | end () const |
| const_iterator | cend () const |
| void | clear () |
Static Public Attributes | |
| static constexpr int | staticValence = 32 |
Private Types | |
| using | left_t = boost::bimaps::unordered_set_of< beast::IP::Endpoint, boost::hash< beast::IP::Endpoint >, xrpl::equal_to< beast::IP::Endpoint > > |
| using | right_t = boost::bimaps::multiset_of< Entry, xrpl::less< Entry > > |
| using | map_type = boost::bimap< left_t, right_t > |
| using | value_type = map_type::value_type |
Private Member Functions | |
| void | prune () |
| void | update () |
| void | checkUpdate () |
| void | flagForUpdate () |
Private Attributes | |
| map_type | m_map |
| Store & | m_store |
| clock_type & | m_clock |
| beast::Journal | m_journal |
| clock_type::time_point | m_whenUpdate |
| bool | m_needsUpdate {false} |
Stores IP addresses useful for gaining initial connections.
This is one of the caches that is consulted when additional outgoing connections are needed. Along with the address, each entry has this additional metadata:
Valence A signed integer which represents the number of successful consecutive connection attempts when positive, and the number of failed consecutive connection attempts when negative.
When choosing addresses from the boot cache for the purpose of establishing outgoing connections, addresses are ranked in decreasing order of high uptime, with valence as the tie breaker.
Definition at line 33 of file Bootcache.h.
|
private |
Definition at line 67 of file Bootcache.h.
|
private |
Definition at line 71 of file Bootcache.h.
|
private |
Definition at line 72 of file Bootcache.h.
|
private |
Definition at line 73 of file Bootcache.h.
| using xrpl::PeerFinder::Bootcache::iterator = boost::transform_iterator<Transform, map_type::right_map::const_iterator> |
Definition at line 105 of file Bootcache.h.
Definition at line 107 of file Bootcache.h.
| xrpl::PeerFinder::Bootcache::Bootcache | ( | Store & | store, |
| clock_type & | clock, | ||
| beast::Journal | journal | ||
| ) |
Definition at line 12 of file Bootcache.cpp.
| xrpl::PeerFinder::Bootcache::~Bootcache | ( | ) |
Definition at line 18 of file Bootcache.cpp.
| bool xrpl::PeerFinder::Bootcache::empty | ( | ) | const |
Returns true if the cache is empty.
Definition at line 24 of file Bootcache.cpp.
| Bootcache::map_type::size_type xrpl::PeerFinder::Bootcache::size | ( | ) | const |
Returns the number of entries in the cache.
Definition at line 30 of file Bootcache.cpp.
| Bootcache::const_iterator xrpl::PeerFinder::Bootcache::begin | ( | ) | const |
IP::Endpoint iterators that traverse in decreasing valence.
Definition at line 36 of file Bootcache.cpp.
| Bootcache::const_iterator xrpl::PeerFinder::Bootcache::cbegin | ( | ) | const |
Definition at line 42 of file Bootcache.cpp.
| Bootcache::const_iterator xrpl::PeerFinder::Bootcache::end | ( | ) | const |
Definition at line 48 of file Bootcache.cpp.
| Bootcache::const_iterator xrpl::PeerFinder::Bootcache::cend | ( | ) | const |
Definition at line 54 of file Bootcache.cpp.
| void xrpl::PeerFinder::Bootcache::clear | ( | ) |
Definition at line 60 of file Bootcache.cpp.
| void xrpl::PeerFinder::Bootcache::load | ( | ) |
Load the persisted data from the Store into the container.
Definition at line 69 of file Bootcache.cpp.
| bool xrpl::PeerFinder::Bootcache::insert | ( | beast::IP::Endpoint const & | endpoint | ) |
Add a newly-learned address to the cache.
Definition at line 89 of file Bootcache.cpp.
| bool xrpl::PeerFinder::Bootcache::insertStatic | ( | beast::IP::Endpoint const & | endpoint | ) |
Add a staticallyconfigured address to the cache.
Definition at line 102 of file Bootcache.cpp.
| void xrpl::PeerFinder::Bootcache::on_success | ( | beast::IP::Endpoint const & | endpoint | ) |
Called when an outbound connection handshake completes.
Definition at line 123 of file Bootcache.cpp.
| void xrpl::PeerFinder::Bootcache::on_failure | ( | beast::IP::Endpoint const & | endpoint | ) |
Called when an outbound connection attempt fails to handshake.
Definition at line 147 of file Bootcache.cpp.
| void xrpl::PeerFinder::Bootcache::periodicActivity | ( | ) |
Stores the cache in the persistent database on a timer.
Definition at line 171 of file Bootcache.cpp.
| void xrpl::PeerFinder::Bootcache::onWrite | ( | beast::PropertyStream::Map & | map | ) |
Write the cache state to the property stream.
Definition at line 179 of file Bootcache.cpp.
|
private |
Definition at line 192 of file Bootcache.cpp.
|
private |
Definition at line 220 of file Bootcache.cpp.
|
private |
Definition at line 241 of file Bootcache.cpp.
|
private |
Definition at line 249 of file Bootcache.cpp.
|
private |
Definition at line 90 of file Bootcache.h.
|
private |
Definition at line 92 of file Bootcache.h.
|
private |
Definition at line 93 of file Bootcache.h.
|
private |
Definition at line 94 of file Bootcache.h.
|
private |
Definition at line 97 of file Bootcache.h.
|
private |
Definition at line 100 of file Bootcache.h.
|
staticconstexpr |
Definition at line 103 of file Bootcache.h.