CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
27 namespace catapult {
namespace ionet {
class NodeContainer; } }
29 namespace catapult {
namespace extensions {
137 uint64_t totalCandidateWeight,
138 size_t maxCandidates);
uint32_t MaxConnections
Maximum number of connections (per service).
Definition: NodeSelector.h:77
const ionet::Node & Node
Node.
Definition: NodeSelector.h:54
uint32_t CalculateWeight(const ionet::NodeInteractions &interactions, WeightPolicy weightPolicy, const supplier< ImportanceDescriptor > &importanceSupplier)
Calculates the weight from interactions or importanceSupplier depending on weightPolicy.
Definition: NodeSelector.cpp:123
catapult::Importance Importance
Associated importance.
Definition: NodeSelector.h:34
uint64_t TotalCandidateWeight
Definition: NodeSelector.cpp:45
ionet::NodeSet AddCandidates
Nodes that should be activatated.
Definition: NodeSelector.h:65
utils::BaseValue< uint32_t, ServiceIdentifier_tag > ServiceIdentifier
Definition: NodeInfo.h:56
uint32_t MaxConnectionAge
Maximum connection age.
Definition: NodeSelector.h:80
NodeSelectionResult SelectNodes(const ionet::NodeContainer &nodes, const NodeSelectionConfiguration &config, const ImportanceRetriever &importanceRetriever)
Definition: NodeSelector.cpp:175
Weight is calculated using the interaction statistics.
Node selection configuration.
Definition: NodeSelector.h:84
std::vector< WeightedCandidate > WeightedCandidates
Definition: NodeSelector.h:60
A weighted candidate.
Definition: NodeSelector.h:44
WeightPolicy operator()()
Generates the next weight policy.
Definition: NodeSelector.h:118
Node aging configuration.
Definition: NodeSelector.h:72
Result of a node selection.
Definition: NodeSelector.h:63
uint32_t MaxConnections
Maximum number of connections (per service).
Definition: NodeSelector.h:92
Weight policy generator.
Definition: NodeSelector.h:108
std::function< T()> supplier
A (stateless) supplier function.
Definition: functions.h:39
utils::KeySet SelectNodesForRemoval(const ionet::NodeContainer &nodes, const NodeAgingConfiguration &config, const ImportanceRetriever &importanceRetriever)
Definition: NodeSelector.cpp:198
A collection of nodes.
Definition: NodeContainer.h:109
WeightPolicy
Weight calculation policies.
Definition: NodeSelector.h:99
ionet::NodeSet SelectCandidatesBasedOnWeight(const WeightedCandidates &candidates, uint64_t totalCandidateWeight, size_t maxCandidates)
Definition: NodeSelector.cpp:143
uint32_t MaxConnectionAge
Maximum connection age.
Definition: NodeSelector.h:95
std::function< ImportanceDescriptor(const Key &)> ImportanceRetriever
Retrieves an importance descriptor given a specified public key.
Definition: NodeSelector.h:41
catapult::Importance TotalChainImportance
Total chain importance.
Definition: NodeSelector.h:37
WeightedCandidate(const ionet::Node &node, uint64_t weight)
Creates a weighted candidate around node and weight.
Definition: NodeSelector.h:47
uint64_t Weight
Weight of the node.
Definition: NodeSelector.h:57
std::uniform_int_distribution m_distr
Definition: NodeSelector.h:124
std::unordered_set< Node, NodeHasher > NodeSet
A set of nodes.
Definition: Node.h:128
NodeRoles
A node's role.
Definition: NodeRoles.h:28
ionet::ServiceIdentifier ServiceId
Identity of the service for which nodes should be selected.
Definition: NodeSelector.h:86
Weight is calculated using importance.
ArraySet< Key > KeySet
A key set.
Definition: ArraySet.h:64
std::mt19937 m_generator
Definition: NodeSelector.h:123
Describes an importance value.
Definition: NodeSelector.h:32
uint32_t NumSuccesses
Number of successful interactions.
Definition: NodeInteractionsContainer.h:43
NodeSource
Definition: NodeInfo.h:47
Node interactions.
Definition: NodeInteractionsContainer.h:29
utils::KeySet RemoveCandidates
Identities of the nodes that should be deactivated.
Definition: NodeSelector.h:68
WeightPolicyGenerator()
Creates a default weight policy generator.
Definition: NodeSelector.h:111
WeightedCandidates Candidates
Definition: NodeSelector.cpp:44
ionet::NodeRoles RequiredRole
Required node role.
Definition: NodeSelector.h:89
Definition: AddressExtractionExtension.cpp:28
NodeScorePairs Actives
Definition: NodeSelector.cpp:43
A node in the catapult network.
Definition: Node.h:82
ionet::ServiceIdentifier ServiceId
Identity of the service for which nodes should be selected.
Definition: NodeSelector.h:74