From 582fc32574a3b158c81e49cb00e6ae59205e66ba Mon Sep 17 00:00:00 2001 From: Antonin Kral Date: Thu, 17 Mar 2011 00:05:43 +0100 Subject: Imported Upstream version 1.8.0 --- s/request.h | 63 ++++++++++++------------------------------------------------- 1 file changed, 12 insertions(+), 51 deletions(-) (limited to 's/request.h') 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 ClientCache; - - class ClientInfo { - public: - ClientInfo( int clientId ); - ~ClientInfo(); - - string getRemote() const { return _remote; } - - void addShard( const string& shard ); - set * 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& sinceLastGetError() const { return _sinceLastGetError; } - void clearSinceLastGetError(){ - _sinceLastGetError.clear(); - } - - private: - int _id; - string _remote; - - set _a; - set _b; - set * _cur; - set * _prev; - int _lastAccess; - - set _sinceLastGetError; - - static mongo::mutex _clientsLock; - static ClientCache& _clients; - static boost::thread_specific_ptr _tlInfo; - }; } #include "strategy.h" -- cgit v1.2.3