MongoDB  2.7.0
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
mongo::ReplicaSetMonitor::SetState::Node Struct Reference

Public Member Functions

 Node (const HostAndPort &host)
 
void markFailed ()
 
bool matches (const ReadPreference &pref) const
 
bool matches (const BSONObj &tag) const
 Checks if the given tag matches the tag attached to this node. More...
 
void update (const IsMasterReply &reply)
 Updates this Node based on information in reply. More...
 

Public Attributes

HostAndPort host
 
bool isUp
 
bool isMaster
 
int64_t latencyMicros
 
BSONObj tags
 

Static Public Attributes

static const int64_t unknownLatency = numeric_limits<int64_t>::max()
 

Member Function Documentation

bool mongo::ReplicaSetMonitor::SetState::Node::matches ( const BSONObj tag) const

Checks if the given tag matches the tag attached to this node.

Example:

Tag of this node: { "dc": "nyc", "region": "na", "rack": "4" }

match: {} match: { "dc": "nyc", "rack": 4 } match: { "region": "na", "dc": "nyc" } not match: { "dc": "nyc", "rack": 2 } not match: { "dc": "sf" }

void mongo::Node::update ( const IsMasterReply reply)

Updates this Node based on information in reply.

The reply must be from this host.


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