|
MongoDB
2.1.1-pre-
|
manages state about a replica set for client keeps tabs on whose master and what slaves are up can hand a slave to someone for SLAVE_OK one instace per process per replica set TODO: we might be able to use a regular Node * to avoid _lock More...
#include <dbclient_rs.h>
Classes | |
| struct | Node |
Public Types | |
|
typedef boost::function1< void, const ReplicaSetMonitor * > | ConfigChangeHook |
Public Member Functions | |
| HostAndPort | getMaster () |
| void | notifyFailure (const HostAndPort &server) |
| notify the monitor that server has faild | |
| HostAndPort | getSlave (const HostAndPort &prev) |
| HostAndPort | getSlave () |
| void | notifySlaveFailure (const HostAndPort &server) |
| notify the monitor that server has faild | |
| void | check (bool checkAllSecondaries) |
| checks for current master and new secondaries | |
| string | getName () const |
| string | getServerAddress () const |
| bool | contains (const string &server) const |
| void | appendInfo (BSONObjBuilder &b) const |
Static Public Member Functions | |
| static ReplicaSetMonitorPtr | get (const string &name, const vector< HostAndPort > &servers) |
| gets a cached Monitor per name or will create if doesn't exist | |
| static ReplicaSetMonitorPtr | get (const string &name) |
| gets a cached Monitor per name or will return none if it doesn't exist | |
| static void | checkAll (bool checkAllSecondaries) |
| checks all sets for current master and new secondaries usually only called from a BackgroundJob | |
| static void | setConfigChangeHook (ConfigChangeHook hook) |
| this is called whenever the config of any repclia set changes currently only 1 globally asserts if one already exists ownership passes to ReplicaSetMonitor and the hook will actually never be deleted | |
manages state about a replica set for client keeps tabs on whose master and what slaves are up can hand a slave to someone for SLAVE_OK one instace per process per replica set TODO: we might be able to use a regular Node * to avoid _lock
| HostAndPort mongo::ReplicaSetMonitor::getSlave | ( | const HostAndPort & | prev | ) |
1.8.0