CatapultServer  v0.5.0.1 (Elephant)
catapult::timesync::ImportanceAwareNodeSelector Class Reference

A node selector that selects nodes according to the importance of the account used to boot the node. More...

Collaboration diagram for catapult::timesync::ImportanceAwareNodeSelector:

Public Types

using NodeSelector = std::function< ionet::NodeSet(extensions::WeightedCandidates &, uint64_t, size_t)>
 

Public Member Functions

 ImportanceAwareNodeSelector (ionet::ServiceIdentifier serviceId, uint8_t maxNodes, Importance minImportance)
 
 ImportanceAwareNodeSelector (ionet::ServiceIdentifier serviceId, uint8_t maxNodes, Importance minImportance, const NodeSelector &selector)
 
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 importanceView. More...
 

Private Member Functions

std::pair< bool, ImportanceisCandidate (const cache::ImportanceView &importanceView, const ionet::Node &node, const ionet::NodeInfo &nodeInfo, Height height) const
 

Private Attributes

ionet::ServiceIdentifier m_serviceId
 
uint8_t m_maxNodes
 
Importance m_minImportance
 
NodeSelector m_selector
 

Detailed Description

A node selector that selects nodes according to the importance of the account used to boot the node.

Member Typedef Documentation

◆ NodeSelector

Constructor & Destructor Documentation

◆ ImportanceAwareNodeSelector() [1/2]

catapult::timesync::ImportanceAwareNodeSelector::ImportanceAwareNodeSelector ( ionet::ServiceIdentifier  serviceId,
uint8_t  maxNodes,
Importance  minImportance 
)
explicit

Creates a selector that can pick up to maxNodes nodes with a minimum importance of minImportance that have active connections with service id serviceId.

◆ ImportanceAwareNodeSelector() [2/2]

catapult::timesync::ImportanceAwareNodeSelector::ImportanceAwareNodeSelector ( ionet::ServiceIdentifier  serviceId,
uint8_t  maxNodes,
Importance  minImportance,
const NodeSelector selector 
)
explicit

Creates a selector around a custom selector that can pick up to maxNodes nodes with a minimum importance of minImportance that have active connections with service id serviceId.

Member Function Documentation

◆ isCandidate()

std::pair< bool, Importance > catapult::timesync::ImportanceAwareNodeSelector::isCandidate ( const cache::ImportanceView importanceView,
const ionet::Node node,
const ionet::NodeInfo nodeInfo,
Height  height 
) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectNodes()

ionet::NodeSet catapult::timesync::ImportanceAwareNodeSelector::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 importanceView.

Here is the call graph for this function:

Member Data Documentation

◆ m_maxNodes

uint8_t catapult::timesync::ImportanceAwareNodeSelector::m_maxNodes
private

◆ m_minImportance

Importance catapult::timesync::ImportanceAwareNodeSelector::m_minImportance
private

◆ m_selector

NodeSelector catapult::timesync::ImportanceAwareNodeSelector::m_selector
private

◆ m_serviceId

ionet::ServiceIdentifier catapult::timesync::ImportanceAwareNodeSelector::m_serviceId
private

The documentation for this class was generated from the following files: