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

Classes

struct  Node
 

Public Types

typedef std::vector< NodeNodes
 

Public Member Functions

 MONGO_DISALLOW_COPYING (SetState)
 
 SetState (StringData name, const std::set< HostAndPort > &seedNodes)
 seedNodes must not be empty
 
HostAndPort getMatchingHost (const ReadPreferenceSetting &criteria) const
 Returns a host matching criteria or an empty host if no known host matches. More...
 
NodefindNode (const HostAndPort &host)
 Returns the Node with the given host, or NULL if no Node has that host.
 
NodefindOrCreateNode (const HostAndPort &host)
 Returns the Node with the given host, or creates one if no Node has that host. More...
 
void updateNodeIfInNodes (const IsMasterReply &reply)
 
std::string getServerAddress () const
 
void checkInvariants () const
 Before unlocking, do DEV checkInvariants();.
 

Public Attributes

boost::mutex mutex
 
boost::condition_variable cv
 
const std::string name
 
int consecutiveFailedScans
 
std::set< HostAndPortseedNodes
 
HostAndPort lastSeenMaster
 
Nodes nodes
 
ScanStatePtr currentScan
 
int64_t latencyThresholdMicros
 
PseudoRandom rand
 
int roundRobin
 

Static Public Attributes

static ConfigChangeHook configChangeHook
 

Member Function Documentation

Node * mongo::SetState::findOrCreateNode ( const HostAndPort host)

Returns the Node with the given host, or creates one if no Node has that host.

Maintains the sorted order of nodes.

HostAndPort mongo::SetState::getMatchingHost ( const ReadPreferenceSetting criteria) const

Returns a host matching criteria or an empty host if no known host matches.

Note: Uses only local data and does not go over the network.


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