diff options
author | Antonin Kral <a.kral@bobek.cz> | 2011-03-17 00:05:43 +0100 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2011-03-17 00:05:43 +0100 |
commit | 582fc32574a3b158c81e49cb00e6ae59205e66ba (patch) | |
tree | ac64a3243e0d2121709f685695247052858115c8 /s/request.h | |
parent | 2761bffa96595ac1698d86bbc2e95ebb0d4d6e93 (diff) | |
download | mongodb-582fc32574a3b158c81e49cb00e6ae59205e66ba.tar.gz |
Imported Upstream version 1.8.0
Diffstat (limited to 's/request.h')
-rw-r--r-- | s/request.h | 63 |
1 files changed, 12 insertions, 51 deletions
diff --git a/s/request.h b/s/request.h index f063d0c..5b4c228 100644 --- a/s/request.h +++ b/s/request.h @@ -26,16 +26,16 @@ namespace mongo { - + class OpCounters; class ClientInfo; - + class Request : boost::noncopyable { public: Request( Message& m, AbstractMessagingPort* p ); // ---- message info ----- - + const char * getns() const { return _d.getns(); @@ -60,12 +60,12 @@ namespace mongo { assert( _didInit ); return _config->isShardingEnabled(); } - + ChunkManagerPtr getChunkManager() const { assert( _didInit ); return _chunkManager; } - + int getClientId() const { return _clientId; } @@ -74,14 +74,14 @@ namespace mongo { } // ---- remote location info ----- - - + + Shard primaryShard() const ; - + // ---- low level access ---- void reply( Message & response , const string& fromServer ); - + Message& m() { return _m; } DbMessage& d() { return _d; } AbstractMessagingPort* p() const { return _p; } @@ -93,16 +93,16 @@ namespace mongo { void init(); void reset( bool reload=false ); - + private: Message& _m; DbMessage _d; AbstractMessagingPort* _p; - + MSGID _id; DBConfigPtr _config; ChunkManagerPtr _chunkManager; - + int _clientId; ClientInfo * _clientInfo; @@ -111,45 +111,6 @@ namespace mongo { bool _didInit; }; - typedef map<int,ClientInfo*> ClientCache; - - class ClientInfo { - public: - ClientInfo( int clientId ); - ~ClientInfo(); - - string getRemote() const { return _remote; } - - void addShard( const string& shard ); - set<string> * getPrev() const { return _prev; }; - - void newRequest( AbstractMessagingPort* p = 0 ); - void disconnect(); - - static ClientInfo * get( int clientId = 0 , bool create = true ); - static void disconnect( int clientId ); - - const set<string>& sinceLastGetError() const { return _sinceLastGetError; } - void clearSinceLastGetError(){ - _sinceLastGetError.clear(); - } - - private: - int _id; - string _remote; - - set<string> _a; - set<string> _b; - set<string> * _cur; - set<string> * _prev; - int _lastAccess; - - set<string> _sinceLastGetError; - - static mongo::mutex _clientsLock; - static ClientCache& _clients; - static boost::thread_specific_ptr<ClientInfo> _tlInfo; - }; } #include "strategy.h" |