diff options
-rw-r--r-- | client/dbclient.cpp | 5 | ||||
-rw-r--r-- | client/dbclient.h | 4 |
2 files changed, 8 insertions, 1 deletions
diff --git a/client/dbclient.cpp b/client/dbclient.cpp index 6f10b8338c9..2ecfcc750f8 100644 --- a/client/dbclient.cpp +++ b/client/dbclient.cpp @@ -817,6 +817,11 @@ namespace mongo { return master == Left ? left : right; } + DBClientConnection& DBClientPaired::slaveConn(){ + DBClientConnection& m = checkMaster(); + return master == Left ? right : left; + } + bool DBClientPaired::connect(const string &serverHostname1, const string &serverHostname2) { string errmsg; bool l = left.connect(serverHostname1, errmsg); diff --git a/client/dbclient.h b/client/dbclient.h index 8f520ee8f2d..9a65f643e5e 100644 --- a/client/dbclient.h +++ b/client/dbclient.h @@ -789,11 +789,13 @@ namespace mongo { void isntMaster() { master = ( ( master == Left ) ? NotSetR : NotSetL ); } - + string getServerAddress() const { return left.getServerAddress() + "," + right.getServerAddress(); } + DBClientConnection& slaveConn(); + /* TODO - not yet implemented. mongos may need these. */ virtual bool call( Message &toSend, Message &response, bool assertOk=true ) { assert(false); return false; } virtual void say( Message &toSend ) { assert(false); } |