CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
27 namespace cache {
class ImportanceView; }
28 namespace ionet {
class NodeContainerView; }
31 namespace catapult {
namespace timesync {
Importance CumulativeImportance
Definition: ImportanceAwareNodeSelector.cpp:37
std::function< ionet::NodeSet(extensions::WeightedCandidates &, uint64_t, size_t)> NodeSelector
Definition: ImportanceAwareNodeSelector.h:36
const Key & identityKey() const
Gets the unique identifier (a public key).
Definition: Node.cpp:60
uint8_t m_maxNodes
Definition: ImportanceAwareNodeSelector.h:67
std::vector< WeightedCandidate > WeightedCandidates
Definition: NodeSelector.h:60
ionet::Node Local
Definition: tools/network/main.cpp:42
ionet::NodeSet selectNodes(const cache::ImportanceView &importanceView, const ionet::NodeContainerView &nodeContainerView, Height height) const
Selects nodes from nodeContainerView that have a minimum importance at height according to importance...
Definition: ImportanceAwareNodeSelector.cpp:73
Information about a node and its interactions.
Definition: NodeInfo.h:82
ionet::NodeSet SelectCandidatesBasedOnWeight(const WeightedCandidates &candidates, uint64_t totalCandidateWeight, size_t maxCandidates)
Definition: NodeSelector.cpp:143
NodeSource source() const
Gets the node source.
Definition: NodeInfo.cpp:47
A read only view on top of node container.
Definition: NodeContainer.h:39
const ConnectionState * getConnectionState(ServiceIdentifier serviceId) const
Gets connection state for the service identified by serviceId or nullptr if no state exists.
Definition: NodeInfo.cpp:73
std::unordered_set< Node, NodeHasher > NodeSet
A set of nodes.
Definition: Node.h:128
A node selector that selects nodes according to the importance of the account used to boot the node.
Definition: ImportanceAwareNodeSelector.h:34
ImportanceAwareNodeSelector(ionet::ServiceIdentifier serviceId, uint8_t maxNodes, Importance minImportance)
Definition: ImportanceAwareNodeSelector.cpp:55
NodeSelector m_selector
Definition: ImportanceAwareNodeSelector.h:69
std::pair< bool, Importance > isCandidate(const cache::ImportanceView &importanceView, const ionet::Node &node, const ionet::NodeInfo &nodeInfo, Height height) const
Definition: ImportanceAwareNodeSelector.cpp:84
Definition: AddressExtractionExtension.cpp:28
ionet::ServiceIdentifier m_serviceId
Definition: ImportanceAwareNodeSelector.h:66
A node in the catapult network.
Definition: Node.h:82
A view on top of an account state cache for retrieving importances.
Definition: ImportanceView.h:29
Importance m_minImportance
Definition: ImportanceAwareNodeSelector.h:68
Importance getAccountImportanceOrDefault(const Key &publicKey, Height height) const
Gets the importance for publicKey at height or a default importance if no importance is set.
Definition: ImportanceView.cpp:76
extensions::WeightedCandidates WeightedCandidates
Definition: ImportanceAwareNodeSelector.cpp:36