7#ifndef MINHTON_ALGORITHMS_LEAVE_ALGORITHM_GENERAL_H_
8#define MINHTON_ALGORITHMS_LEAVE_ALGORITHM_GENERAL_H_
13#include "minhton/algorithms/leave/interface_leave_algorithm.h"
14#include "minhton/message/find_replacement.h"
15#include "minhton/message/lock_neighbor_request.h"
16#include "minhton/message/lock_neighbor_response.h"
17#include "minhton/message/message.h"
18#include "minhton/message/remove_neighbor.h"
19#include "minhton/message/remove_neighbor_ack.h"
20#include "minhton/message/replacement_ack.h"
21#include "minhton/message/replacement_nack.h"
22#include "minhton/message/replacement_offer.h"
23#include "minhton/message/replacement_update.h"
24#include "minhton/message/signoff_parent_answer.h"
25#include "minhton/message/signoff_parent_request.h"
26#include "minhton/message/unlock_neighbor.h"
27#include "minhton/message/update_neighbors.h"
38 void process(
const MessageVariant &msg)
override;
197 std::vector<minhton::NodeInfo> neighbors_of_leaving_node,
198 bool leaving_node_was_locked,
bool leaving_node_locked_right,
199 bool leaving_node_locked_left);
257 std::vector<minhton::NodeInfo> neighbors_of_node_to_replace)
override;
291 uint64_t leaving_event_id_ = 0;
292 bool in_leave_progress_ =
false;
293 bool locked_right_neighbor_ =
false;
294 bool locked_left_neighbor_ =
false;
295 uint32_t remaining_lock_neighbor_response_ = 0;
296 std::shared_ptr<minhton::MessageSignoffParentRequest> current_signoff_request_ =
nullptr;
298 std::shared_ptr<minhton::MessageReplacementUpdate> last_replacement_update_ =
nullptr;
317 std::vector<minhton::NodeInfo> neighbors);
335 std::vector<minhton::NodeInfo> neighbors);
Definition leave_algorithm_general.h:31
void sendNackToReplacement(uint64_t ref_event_id)
Definition leave_algorithm_general.cpp:602
void processReceiveSignoffNeighborAdjacentsAck()
Definition leave_algorithm_general.cpp:565
void prepareLeavingAsSuccessor(const minhton::NodeInfo &node_to_replace)
Definition leave_algorithm_general.cpp:360
void processLockNeighborRequest(const minhton::MessageLockNeighborRequest &message)
Definition leave_algorithm_general.cpp:442
void replaceMyself(const minhton::NodeInfo &node_to_replace, std::vector< minhton::NodeInfo > neighbors_of_node_to_replace) override
Definition leave_algorithm_general.cpp:618
void processUpdateForwardAck()
Definition leave_algorithm_general.cpp:530
void processLockNeighborResponse(const minhton::MessageLockNeighborResponse &message)
Definition leave_algorithm_general.cpp:458
void sendReplacementOffer()
Definition leave_algorithm_general.cpp:608
void initiateSelfDeparture() override=0
void processUnlockNeighbor(const MessageUnlockNeighbor &msg)
Definition leave_algorithm_general.cpp:47
uint32_t signOffFromNeighborsAndAdjacents()
Definition leave_algorithm_general.cpp:273
void processReplacementAck(const minhton::MessageReplacementAck &message)
Definition leave_algorithm_general.cpp:173
static minhton::NodeInfo getAdjacentLeftFromVector(const minhton::NodeInfo &considered_node, std::vector< minhton::NodeInfo > neighbors)
Definition leave_algorithm_general_helper.cpp:12
void processSignOffParentAnswer(const minhton::MessageSignoffParentAnswer &message)
Definition leave_algorithm_general.cpp:547
void processReplacementUpdate(const minhton::MessageReplacementUpdate &message)
Definition leave_algorithm_general.cpp:129
virtual void processFindReplacement(const minhton::MessageFindReplacement &message)=0
static minhton::NodeInfo getAdjacentRightFromVector(const minhton::NodeInfo &considered_node, std::vector< minhton::NodeInfo > neighbors)
Definition leave_algorithm_general_helper.cpp:33
void performLeaveWithoutReplacement()
Definition leave_algorithm_general.cpp:182
void processReceiveReplacementUpdateAck()
Definition leave_algorithm_general.cpp:588
void processRemoveNeighborAck()
Definition leave_algorithm_general.cpp:539
void performLeaveWithReplacement(minhton::NodeInfo leaving_node, std::vector< minhton::NodeInfo > neighbors_of_leaving_node, bool leaving_node_was_locked, bool leaving_node_locked_right, bool leaving_node_locked_left)
Definition leave_algorithm_general.cpp:195
void processSignOffParentRequest(const minhton::MessageSignoffParentRequest &message)
Definition leave_algorithm_general.cpp:393
void signOffFromParent()
Definition leave_algorithm_general.cpp:381
void processReplacementOffer(const minhton::MessageReplacementOffer &message)
Definition leave_algorithm_general.cpp:99
Definition interface_leave_algorithm.h:18
Usage: A node wants to leave the network, but cannot leave the position directly because it would vio...
Definition find_replacement.h:21
Usage: The parent of a successor node sends a Lock Neighbor Request to its right and left neighbor....
Definition lock_neighbor_request.h:18
Usage: The answer to a MessageLockNeighborRequest, received by the parent of a successor node.
Definition lock_neighbor_response.h:17
Usage: The node that wants to leave the network receives a MessageReplacementOffer from a node that i...
Definition replacement_ack.h:19
Usage: A MessageFindReplacement reached a node that can replace the leaving node. The node sends a Me...
Definition replacement_offer.h:18
Usage: During the replacement process, the neighbor nodes of the leaving node / the replaced position...
Definition replacement_update.h:20
Usage: The successor node waits for the MessageSignoffParentAnswer from its parent after sending a Me...
Definition signoff_parent_answer.h:17
Usage: The last node of the network, the chosen successor, sends a MessageSignoffParentRequest to its...
Definition signoff_parent_request.h:18
Usage: Used for unlocking nodes after they were locked during a concurrent operation like leave.
Definition unlock_neighbor.h:17
Definition node_info.h:24
Definition minhton_watchdog_ns3.cpp:24