From: An efficient selection algorithm for building a super-peer overlay
Operation | Description |
---|---|
AddClientnodes(n i ) | Node n i adds client nodes until n i is full-loaded or no more client nodes can be found. Specifically, n i first searches its neighbors to find and add nodes. After that, if n i is still under-loaded, n i searches its neighbors’ neighbors to find and add client nodes. |
ChangeRole(n i ) | Node n i changes its role. |
ExistBiggerSPCandidate(n i ) | n i sends messages to its neighbors to check whether its neighbors’ super-peer candidates have higher capacity than CanSP(n i ). If that is the case, true is returned. Otherwise, false is returned. |
NotifyNewSPcandidates (n i ) | n i notifies its neighbors to update their sets of super-peer candidates to be CanSP(n i ). |
RetriveUpdateSPc(n i ) | Node n i checks whether there is a message about new super-peer candidates UpdSP. If such a message exists, UpdSP is returned. Otherwise, null is returned. |
RetriveNewSPCandidates(n i ) | Node n i computes its new set of super-peer candidates CanSP(n i ) according to its retrieved set of super-peer candidates through communication with its neighbors. |
RemoveFailedSPIfExist(n i ). | Node n i checks whether there is a message about super-peer failure. If such a message exists, the failed super-peer contained in the message is removed from the super-peer candidates of n i . |
Search&JoinUnderLoadedSP(n i ) | Node n i sends query messages to super-peers contained in its super-peer candidates to check these nodes’ workloads. If a super-peer that is under-loaded is found, n i joins this super-peer. |
SPFailureHander(n i ) | When the super-peer of n i (i.e., SP(n i )) fails, n i removes SP(n i ) from its set of super-peer candidates and empties its super-peer. n i also notifies its neighbors of the failure of SP(n i ). |
TransferClients(n i ) | When a super-peer n i has to change its role to be a client peer, n i transfers its client peers (if any) to super-peers that are randomly selected from its set of CanSP(n i ). |
UpdateSPCandidates(n i ,UpdSP) | Node n i updates its set of super-peer candidates to be UpdSP, which is an ordinary set to store updated super-peer candidates. |