CatapultServer
v0.5.0.1 (Elephant)
|
A write only view on top of node container. More...
Public Member Functions | |
NodeContainerModifier (NodeContainerData &nodeContainerData, utils::SpinReaderWriterLock::ReaderLockGuard &&readLock) | |
Creates a view around nodeContainerData with lock context readLock. More... | |
bool | add (const Node &node, NodeSource source) |
void | addConnectionStates (ServiceIdentifier serviceId, ionet::NodeRoles role) |
Adds connection states for the service identified by serviceId to all nodes with role. More... | |
ConnectionState & | provisionConnectionState (ServiceIdentifier serviceId, const Key &identityKey) |
Gets connection state for the service identified by serviceId and the node with identityKey. More... | |
void | ageConnections (ServiceIdentifier serviceId, const utils::KeySet &identities) |
Ages all connections for the service identified by serviceId for nodes with identities. More... | |
void | ageConnectionBans (ServiceIdentifier serviceId, uint32_t maxConnectionBanAge, uint32_t numConsecutiveFailuresBeforeBanning) |
void | incrementSuccesses (const Key &identityKey) |
Increments the number of successful interactions for the node identified by identityKey. More... | |
void | incrementFailures (const Key &identityKey) |
Increments the number of failed interactions for the node identified by identityKey. More... | |
Private Member Functions | |
void | autoProvisionConnectionStates (NodeData &nodeData) |
bool | ensureAtLeastOneEmptySlot () |
void | incrementInteraction (const Key &identityKey, const consumer< NodeInfo & > &incrementer) |
Private Member Functions inherited from catapult::utils::MoveOnly | |
constexpr | MoveOnly ()=default |
Default constructor. More... | |
~MoveOnly ()=default | |
Default destructor. More... | |
MoveOnly (const NonCopyable &)=delete | |
Disabled copy constructor. More... | |
MoveOnly (MoveOnly &&)=default | |
Default move constructor. More... | |
MoveOnly & | operator= (const MoveOnly &)=delete |
Disabled assignment operator. More... | |
MoveOnly & | operator= (MoveOnly &&)=default |
Default move assignment operator. More... | |
Private Attributes | |
NodeContainerData & | m_nodeContainerData |
utils::SpinReaderWriterLock::ReaderLockGuard | m_readLock |
utils::SpinReaderWriterLock::WriterLockGuard | m_writeLock |
A write only view on top of node container.
catapult::ionet::NodeContainerModifier::NodeContainerModifier | ( | NodeContainerData & | nodeContainerData, |
utils::SpinReaderWriterLock::ReaderLockGuard && | readLock | ||
) |
Creates a view around nodeContainerData with lock context readLock.
bool catapult::ionet::NodeContainerModifier::add | ( | const Node & | node, |
NodeSource | source | ||
) |
Adds a node to the collection with source.
void catapult::ionet::NodeContainerModifier::addConnectionStates | ( | ServiceIdentifier | serviceId, |
ionet::NodeRoles | role | ||
) |
Adds connection states for the service identified by serviceId to all nodes with role.
void catapult::ionet::NodeContainerModifier::ageConnectionBans | ( | ServiceIdentifier | serviceId, |
uint32_t | maxConnectionBanAge, | ||
uint32_t | numConsecutiveFailuresBeforeBanning | ||
) |
Ages all connection bans for the service identified by serviceId given maxConnectionBanAge and numConsecutiveFailuresBeforeBanning.
void catapult::ionet::NodeContainerModifier::ageConnections | ( | ServiceIdentifier | serviceId, |
const utils::KeySet & | identities | ||
) |
Ages all connections for the service identified by serviceId for nodes with identities.
|
private |
|
private |
void catapult::ionet::NodeContainerModifier::incrementFailures | ( | const Key & | identityKey | ) |
Increments the number of failed interactions for the node identified by identityKey.
|
private |
void catapult::ionet::NodeContainerModifier::incrementSuccesses | ( | const Key & | identityKey | ) |
Increments the number of successful interactions for the node identified by identityKey.
ConnectionState & catapult::ionet::NodeContainerModifier::provisionConnectionState | ( | ServiceIdentifier | serviceId, |
const Key & | identityKey | ||
) |
Gets connection state for the service identified by serviceId and the node with identityKey.
|
private |
|
private |
|
private |