Distributed Cache
Public Member Functions | Private Attributes | List of all members
MemberNode Class Reference

#include <member_node.h>

Collaboration diagram for MemberNode:
Collaboration graph

Public Member Functions

MembershipList getList ()
 
void addIntroducer (std::string ip, int port)
 
 MemberNode (Address myAddress, int startRange=-1)
 
void registerArtifact (GossipArtifact &artifact)
 
Buffer generateGossipPayload ()
 
int heartbeat ()
 
void loop ()
 
int sendMemberList (Member &member, Buffer &data)
 
void receiveGossip (int connection)
 
std::vector< int > selectKItems (int n, int k)
 
Address getNearestNode (int key)
 
Address getAddress ()
 
void threadLoop ()
 

Private Attributes

Member myMember
 
MembershipList memberList
 
std::thread tid
 
std::unordered_map< std::string, GossipArtifact * > gossipArtifacts
 
std::mutex lock
 

Constructor & Destructor Documentation

◆ MemberNode()

MemberNode::MemberNode ( Address  myAddress,
int  startRange = -1 
)
Here is the call graph for this function:

Member Function Documentation

◆ addIntroducer()

void MemberNode::addIntroducer ( std::string  ip,
int  port 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ generateGossipPayload()

Buffer MemberNode::generateGossipPayload ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAddress()

Address MemberNode::getAddress ( )
inline
Here is the caller graph for this function:

◆ getList()

MembershipList MemberNode::getList ( )

◆ getNearestNode()

Address MemberNode::getNearestNode ( int  key)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ heartbeat()

int MemberNode::heartbeat ( )
Here is the caller graph for this function:

◆ loop()

void MemberNode::loop ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ receiveGossip()

void MemberNode::receiveGossip ( int  connection)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerArtifact()

void MemberNode::registerArtifact ( GossipArtifact &  artifact)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectKItems()

std::vector< int > MemberNode::selectKItems ( int  n,
int  k 
)
Here is the caller graph for this function:

◆ sendMemberList()

int MemberNode::sendMemberList ( Member &  member,
Buffer &  data 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ threadLoop()

void MemberNode::threadLoop ( )
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ gossipArtifacts

std::unordered_map<std::string, GossipArtifact*> MemberNode::gossipArtifacts
private

◆ lock

std::mutex MemberNode::lock
private

◆ memberList

MembershipList MemberNode::memberList
private

◆ myMember

Member MemberNode::myMember
private

◆ tid

std::thread MemberNode::tid
private

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