diff options
Diffstat (limited to 'src/mongo/client/parallel.h')
-rw-r--r-- | src/mongo/client/parallel.h | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/src/mongo/client/parallel.h b/src/mongo/client/parallel.h index f90e29c0a26..1f9e88f3eb4 100644 --- a/src/mongo/client/parallel.h +++ b/src/mongo/client/parallel.h @@ -48,7 +48,7 @@ namespace mongo { */ class MONGO_CLIENT_API ServerAndQuery { public: - ServerAndQuery( const string& server , BSONObj extra = BSONObj() , BSONObj orderObject = BSONObj() ) : + ServerAndQuery( const std::string& server , BSONObj extra = BSONObj() , BSONObj orderObject = BSONObj() ) : _server( server ) , _extra( extra.getOwned() ) , _orderObject( orderObject.getOwned() ) { } @@ -63,17 +63,17 @@ namespace mongo { return _extra.woCompare( other._extra ) < 0; } - string toString() const { + std::string toString() const { StringBuilder ss; ss << "server:" << _server << " _extra:" << _extra.toString() << " _orderObject:" << _orderObject.toString(); return ss.str(); } - operator string() const { + operator std::string() const { return toString(); } - string _server; + std::string _server; BSONObj _extra; BSONObj _orderObject; }; @@ -83,17 +83,17 @@ namespace mongo { class MONGO_CLIENT_API CommandInfo { public: - string versionedNS; + std::string versionedNS; BSONObj cmdFilter; CommandInfo() {} - CommandInfo( const string& vns, const BSONObj& filter ) : versionedNS( vns ), cmdFilter( filter ) {} + CommandInfo( const std::string& vns, const BSONObj& filter ) : versionedNS( vns ), cmdFilter( filter ) {} bool isEmpty(){ return versionedNS.size() == 0; } - string toString() const { + std::string toString() const { return str::stream() << "CInfo " << BSON( "v_ns" << versionedNS << "filter" << cmdFilter ); } }; @@ -122,7 +122,7 @@ namespace mongo { BSONObj toBSON() const; - string toString() const { + std::string toString() const { return str::stream() << "PCState : " << toBSON(); } }; @@ -154,7 +154,7 @@ namespace mongo { BSONObj toBSON() const; - string toString() const { + std::string toString() const { return str::stream() << "PCMData : " << toBSON(); } }; @@ -180,7 +180,7 @@ namespace mongo { ParallelSortClusteredCursor( const QuerySpec& qSpec, const CommandInfo& cInfo = CommandInfo() ); // DEPRECATED legacy constructor for pure mergesort functionality - do not use - ParallelSortClusteredCursor( const set<ServerAndQuery>& servers , const string& ns , + ParallelSortClusteredCursor( const std::set<ServerAndQuery>& servers , const std::string& ns , const Query& q , int options=0, const BSONObj& fields=BSONObj() ); ~ParallelSortClusteredCursor(); @@ -192,7 +192,7 @@ namespace mongo { bool more(); BSONObj next(); - string type() const { return "ParallelSort"; } + std::string type() const { return "ParallelSort"; } void fullInit(); void startInit(); @@ -204,19 +204,19 @@ namespace mongo { bool isSharded(); ShardPtr getPrimary(); - void getQueryShards( set<Shard>& shards ); + void getQueryShards( std::set<Shard>& shards ); ChunkManagerPtr getChunkManager( const Shard& shard ); DBClientCursorPtr getShardCursor( const Shard& shard ); BSONObj toBSON() const; - string toString() const; + std::string toString() const; void explain(BSONObjBuilder& b); private: void _finishCons(); - void _explain( map< string,list<BSONObj> >& out ); + void _explain( std::map< std::string,std::list<BSONObj> >& out ); void _markStaleNS( const NamespaceString& staleNS, const StaleConfigException& e, bool& forceReload, bool& fullReload ); void _handleStaleNS( const NamespaceString& staleNS, bool forceReload, bool fullReload ); @@ -224,20 +224,20 @@ namespace mongo { bool _didInit; bool _done; - set<Shard> _qShards; + std::set<Shard> _qShards; QuerySpec _qSpec; CommandInfo _cInfo; // Count round-trips req'd for namespaces and total - map<string,int> _staleNSMap; + std::map<std::string,int> _staleNSMap; int _totalTries; - map<Shard,PCMData> _cursorMap; + std::map<Shard,PCMData> _cursorMap; // LEGACY BELOW int _numServers; int _lastFrom; - set<ServerAndQuery> _servers; + std::set<ServerAndQuery> _servers; BSONObj _sortKey; FilteringClientCursor * _cursors; @@ -259,7 +259,7 @@ namespace mongo { void _oldInit(); // LEGACY - Needed ONLY for _oldInit - string _ns; + std::string _ns; BSONObj _query; int _options; BSONObj _fields; @@ -273,7 +273,7 @@ namespace mongo { FilteringClientCursor(); ~FilteringClientCursor(); - void reset( auto_ptr<DBClientCursor> cursor ); + void reset( std::auto_ptr<DBClientCursor> cursor ); void reset( DBClientCursor* cursor, ParallelConnectionMetadata* _pcmData = NULL ); bool more(); @@ -293,7 +293,7 @@ namespace mongo { private: void _advance(); - auto_ptr<DBClientCursor> _cursor; + std::auto_ptr<DBClientCursor> _cursor; ParallelConnectionMetadata* _pcmData; BSONObj _next; @@ -313,7 +313,7 @@ namespace mongo { class CommandResult { public: - string getServer() const { return _server; } + std::string getServer() const { return _server; } bool isDone() const { return _done; } @@ -335,16 +335,16 @@ namespace mongo { private: - CommandResult( const string& server, - const string& db, + CommandResult( const std::string& server, + const std::string& db, const BSONObj& cmd, int options, DBClientBase * conn, bool useShardedConn ); void init(); - string _server; - string _db; + std::string _server; + std::string _db; int _options; BSONObj _cmd; DBClientBase * _conn; @@ -368,8 +368,8 @@ namespace mongo { * @param conn optional connection to use. will use standard pooled if non-specified * @param useShardConn use ShardConnection */ - static shared_ptr<CommandResult> spawnCommand( const string& server, - const string& db, + static shared_ptr<CommandResult> spawnCommand( const std::string& server, + const std::string& db, const BSONObj& cmd, int options, DBClientBase * conn = 0, |