SOLA
|
Public Member Functions | |
MinhtonLeaveAlgorithm (std::shared_ptr< AccessContainer > access) | |
bool | canLeaveWithoutReplacement () override |
void | initiateSelfDeparture () override |
Public Member Functions inherited from minhton::LeaveAlgorithmGeneral | |
LeaveAlgorithmGeneral (std::shared_ptr< AccessContainer > access) | |
void | process (const MessageVariant &msg) override |
Public Member Functions inherited from minhton::LeaveAlgorithmInterface | |
LeaveAlgorithmInterface (std::shared_ptr< AccessContainer > access) | |
virtual void | replaceMyself (const NodeInfo &node_to_replace, std::vector< NodeInfo > neighbors_of_node_to_replace)=0 |
Public Member Functions inherited from minhton::AlgorithmInterface | |
AlgorithmInterface (std::shared_ptr< AccessContainer > access) | |
Additional Inherited Members | |
Static Public Member Functions inherited from minhton::LeaveAlgorithmInterface | |
static std::vector< MessageType > | getSupportedMessageTypes () |
Static Protected Member Functions inherited from minhton::LeaveAlgorithmGeneral | |
static minhton::NodeInfo | getAdjacentLeftFromVector (const minhton::NodeInfo &considered_node, std::vector< minhton::NodeInfo > neighbors) |
static minhton::NodeInfo | getAdjacentRightFromVector (const minhton::NodeInfo &considered_node, std::vector< minhton::NodeInfo > neighbors) |
Protected Attributes inherited from minhton::LeaveAlgorithmGeneral | |
minhton::NodeInfo | replacing_node_ |
uint64_t | leaving_event_id_ = 0 |
bool | in_leave_progress_ = false |
bool | locked_right_neighbor_ = false |
bool | locked_left_neighbor_ = false |
uint32_t | remaining_lock_neighbor_response_ = 0 |
std::shared_ptr< minhton::MessageSignoffParentRequest > | current_signoff_request_ = nullptr |
std::shared_ptr< minhton::MessageReplacementUpdate > | last_replacement_update_ = nullptr |
NodeInfo | old_parent_ |
Protected Attributes inherited from minhton::AlgorithmInterface | |
std::shared_ptr< AccessContainer > | access_ |
|
overridevirtual |
Helper method to quickly check if we will do a leave without replacement for the FSM. This must be done in accordance with the actual Leave implementation.
This method checks the routing tables to say whether the current node is the last one of the network or it (maybe) is not.
Only works for complete trees (nodes are added from left to right without gaps).
Implements minhton::LeaveAlgorithmInterface.
|
overridevirtual |
We decide ourselves that we want to leave the network and initiate the leave procedure.
This method gets called when we receive a leave signal.
Typical Usage:
Implements minhton::LeaveAlgorithmGeneral.
|
protected |
Implementation of the FindReplacement algorithm.
This variant of the method is called only once from the node which wants to leave. The method initiates the main logic for the leave process by calling the methods responsible for redirecting the request of finding a replacement node.
In case the current node (that wants to leave) is also the parent of the last node in the network, we send a message to the last node in this method.
|
protected |
Implementation of the FindReplacement algorithm.
This variant of the method may be called multiple times during the redirection of the request for finding a replacement.
But it is only called once per reached node, since the logic in this method is responsible for calling other methods based on the SearchProgress of the msg. And those other methods redirect accordingly to another node, ideally coming closer to the last node of the network or gathering information to make it possible to find it.
msg | the message we received and read to proceed with the initiated leave procedure |
|
overrideprotectedvirtual |
This method will be called when we receive a FIND_REPLACEMENT message.
Typical Usage:
message | the message we received and want to process |
Implements minhton::LeaveAlgorithmGeneral.