diff options
author | gregs <greg@10gen.com> | 2011-07-19 09:53:36 -0400 |
---|---|---|
committer | gregs <greg@10gen.com> | 2011-07-27 15:59:27 -0400 |
commit | d42d4c2a0c95bb62f203fc0269b343c318d2020d (patch) | |
tree | 2a7c3a3bd6e5e19a72a7e14844988c46ce805837 /client | |
parent | a6f8968570f2d8b47c406473d32d2a7fd9b3614d (diff) | |
download | mongo-d42d4c2a0c95bb62f203fc0269b343c318d2020d.tar.gz |
add options to Futures SERVER-3405
Diffstat (limited to 'client')
-rw-r--r-- | client/parallel.cpp | 11 | ||||
-rw-r--r-- | client/parallel.h | 5 |
2 files changed, 9 insertions, 7 deletions
diff --git a/client/parallel.cpp b/client/parallel.cpp index f157927703f..c758b99ac50 100644 --- a/client/parallel.cpp +++ b/client/parallel.cpp @@ -410,6 +410,7 @@ namespace mongo { } } + // TODO: Merge with futures API? We do a lot of error checking here that would be useful elsewhere. void ParallelSortClusteredCursor::_init() { // log() << "Starting parallel search..." << endl; @@ -720,8 +721,8 @@ namespace mongo { // ---- Future ----- // ----------------- - Future::CommandResult::CommandResult( const string& server , const string& db , const BSONObj& cmd , DBClientBase * conn ) - :_server(server) ,_db(db) ,_cmd(cmd) ,_conn(conn) ,_done(false) + Future::CommandResult::CommandResult( const string& server , const string& db , const BSONObj& cmd , int options , DBClientBase * conn ) + :_server(server) ,_db(db) , _options(options), _cmd(cmd) ,_conn(conn) ,_done(false) { try { if ( ! _conn ){ @@ -729,7 +730,7 @@ namespace mongo { _conn = _connHolder->get(); } - _cursor.reset( new DBClientCursor(_conn, _db + ".$cmd", _cmd, -1/*limit*/, 0, NULL, 0, 0)); + _cursor.reset( new DBClientCursor(_conn, _db + ".$cmd", _cmd, -1/*limit*/, 0, NULL, _options, 0)); _cursor->initLazy(); } catch ( std::exception& e ) { @@ -768,8 +769,8 @@ namespace mongo { return _ok; } - shared_ptr<Future::CommandResult> Future::spawnCommand( const string& server , const string& db , const BSONObj& cmd , DBClientBase * conn ) { - shared_ptr<Future::CommandResult> res (new Future::CommandResult( server , db , cmd , conn )); + shared_ptr<Future::CommandResult> Future::spawnCommand( const string& server , const string& db , const BSONObj& cmd , int options , DBClientBase * conn ) { + shared_ptr<Future::CommandResult> res (new Future::CommandResult( server , db , cmd , options , conn )); return res; } diff --git a/client/parallel.h b/client/parallel.h index 332840edea1..869bff95a4a 100644 --- a/client/parallel.h +++ b/client/parallel.h @@ -280,10 +280,11 @@ namespace mongo { private: - CommandResult( const string& server , const string& db , const BSONObj& cmd , DBClientBase * conn ); + CommandResult( const string& server , const string& db , const BSONObj& cmd , int options , DBClientBase * conn ); string _server; string _db; + int _options; BSONObj _cmd; DBClientBase * _conn; scoped_ptr<ScopedDbConnection> _connHolder; // used if not provided a connection @@ -304,7 +305,7 @@ namespace mongo { * @param cmd cmd to exec * @param conn optional connection to use. will use standard pooled if non-specified */ - static shared_ptr<CommandResult> spawnCommand( const string& server , const string& db , const BSONObj& cmd , DBClientBase * conn = 0 ); + static shared_ptr<CommandResult> spawnCommand( const string& server , const string& db , const BSONObj& cmd , int options , DBClientBase * conn = 0 ); }; |