diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-07-21 14:12:32 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-07-21 14:12:32 -0400 |
commit | 6048738ac9fc63eeff318ab10f7fcf40758e555b (patch) | |
tree | e8b0114ee5dfa7188b10bcbb17888aa0062ca274 /client/dbclient.h | |
parent | db31e7bf5060b5c4abcb0c34a52aff83146816b3 (diff) | |
download | mongo-6048738ac9fc63eeff318ab10f7fcf40758e555b.tar.gz |
raw methods for talking to db
fix sync cluster connection getMore
Diffstat (limited to 'client/dbclient.h')
-rw-r--r-- | client/dbclient.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/client/dbclient.h b/client/dbclient.h index 7b78cfc90e4..39a2753e0e1 100644 --- a/client/dbclient.h +++ b/client/dbclient.h @@ -726,6 +726,11 @@ namespace mongo { n++; return n; } + + virtual bool callRead( Message& toSend , Message& response ) = 0; + // virtual bool callWrite( Message& toSend , Message& response ) = 0; // TODO: add this if needed + virtual void say( Message& toSend ) = 0; + }; // DBClientBase class DBClientPaired; @@ -831,15 +836,20 @@ namespace mongo { virtual void killCursor( long long cursorID ); + virtual bool callRead( Message& toSend , Message& response ){ + return call( toSend , response ); + } + + virtual void say( Message &toSend ); + protected: friend class SyncClusterConnection; virtual void recv( Message& m ); virtual bool call( Message &toSend, Message &response, bool assertOk = true ); - virtual void say( Message &toSend ); virtual void sayPiggyBack( Message &toSend ); virtual void checkResponse( const char *data, int nReturned ); }; - + /** Use this class to connect to a replica pair of servers. The class will manage checking for which server in a replica pair is master, and do failover automatically. @@ -926,13 +936,17 @@ namespace mongo { DBClientConnection& masterConn(); 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); } virtual void sayPiggyBack( Message &toSend ) { assert(false); } virtual void checkResponse( const char *data, int nReturned ) { assert(false); } + virtual bool callRead( Message& toSend , Message& response ){ + return call( toSend , response ); + } + bool isFailed() const { // TODO: this really should check isFailed on current master as well return master < Left; |