diff options
Diffstat (limited to 'src/mongo')
-rw-r--r-- | src/mongo/SConscript | 57 | ||||
-rw-r--r-- | src/mongo/base/SConscript | 87 | ||||
-rw-r--r-- | src/mongo/client/connpool.cpp | 1 | ||||
-rw-r--r-- | src/mongo/client/connpool.h | 12 | ||||
-rw-r--r-- | src/mongo/client/parallel.h | 3 | ||||
-rw-r--r-- | src/mongo/client/syncclusterconnection.h | 4 | ||||
-rw-r--r-- | src/mongo/db/commands/mr.cpp | 1 | ||||
-rw-r--r-- | src/mongo/s/cursors.cpp | 14 | ||||
-rw-r--r-- | src/mongo/s/cursors.h | 23 | ||||
-rw-r--r-- | src/mongo/s/s_only.cpp | 5 | ||||
-rw-r--r-- | src/mongo/s/strategy.cpp | 4 | ||||
-rw-r--r-- | src/mongo/scripting/v8-3.25_db.cpp | 1 | ||||
-rw-r--r-- | src/mongo/scripting/v8_db.cpp | 1 |
13 files changed, 75 insertions, 138 deletions
diff --git a/src/mongo/SConscript b/src/mongo/SConscript index d267690f09e..f4c1e0e8161 100644 --- a/src/mongo/SConscript +++ b/src/mongo/SConscript @@ -803,36 +803,33 @@ env.Library('coreshard', [# This is only here temporarily for auto-split logic i LIBDEPS=['s/base', 's/cluster_ops_impl']); -mongosLibraryFiles = [ - "s/strategy.cpp", - "s/commands_admin.cpp", - "s/commands_public.cpp", - "s/commands/auth_schema_upgrade_s.cpp", - "s/commands/cluster_explain_cmd.cpp", - "s/commands/cluster_find_cmd.cpp", - "s/commands/cluster_index_filter_cmd.cpp", - "s/commands/cluster_merge_chunks_cmd.cpp", - "s/commands/cluster_plan_cache_cmd.cpp", - "s/commands/cluster_write_cmd.cpp", - "s/request.cpp", - "s/client_info.cpp", - "s/cursors.cpp", - "s/s_only.cpp", - "s/balance.cpp", - "s/version_manager.cpp", - "s/version_mongos.cpp", - ] - -env.Library( "mongoscore", - mongosLibraryFiles, - LIBDEPS=['db/auth/authmongos', - 'db/fts/ftsmongos', - 'db/query/explain_common', - 'db/query/lite_parsed_query', - 's/cluster_ops', - 's/cluster_write_op_conversion', - 's/upgrade', - ] ) +env.Library('mongoscore', + ['s/strategy.cpp', + 's/commands_admin.cpp', + 's/commands_public.cpp', + 's/commands/auth_schema_upgrade_s.cpp', + 's/commands/cluster_explain_cmd.cpp', + 's/commands/cluster_find_cmd.cpp', + 's/commands/cluster_index_filter_cmd.cpp', + 's/commands/cluster_merge_chunks_cmd.cpp', + 's/commands/cluster_plan_cache_cmd.cpp', + 's/commands/cluster_write_cmd.cpp', + 's/request.cpp', + 's/client_info.cpp', + 's/cursors.cpp', + 's/s_only.cpp', + 's/balance.cpp', + 's/version_manager.cpp', + 's/version_mongos.cpp', + ], + LIBDEPS=['db/auth/authmongos', + 'db/fts/ftsmongos', + 'db/query/explain_common', + 'db/query/lite_parsed_query', + 's/cluster_ops', + 's/cluster_write_op_conversion', + 's/upgrade', + ]) env.CppUnitTest("shard_key_pattern_test", [ "s/shard_key_pattern_test.cpp" ], LIBDEPS=["mongoscore", diff --git a/src/mongo/base/SConscript b/src/mongo/base/SConscript index 8b4ce87fb7b..3507a5c576b 100644 --- a/src/mongo/base/SConscript +++ b/src/mongo/base/SConscript @@ -5,61 +5,34 @@ Import("env") env.Command(['error_codes.h', 'error_codes.cpp'], ['generate_error_codes.py', 'error_codes.err'], '$PYTHON $SOURCES $TARGETS') -env.Library('base', ['error_codes.cpp', - 'global_initializer.cpp', - 'global_initializer_registerer.cpp', - 'init.cpp', - 'initializer.cpp', - 'initializer_context.cpp', - 'initializer_dependency_graph.cpp', - 'validate_locale.cpp', - 'make_string_vector.cpp', - 'parse_number.cpp', - 'status.cpp', - 'string_data.cpp', - ], - LIBDEPS=[ - '$BUILD_DIR/mongo/quick_exit', +env.Library('base', + ['error_codes.cpp', + 'global_initializer.cpp', + 'global_initializer_registerer.cpp', + 'init.cpp', + 'initializer.cpp', + 'initializer_context.cpp', + 'initializer_dependency_graph.cpp', + 'validate_locale.cpp', + 'make_string_vector.cpp', + 'parse_number.cpp', + 'status.cpp', + 'string_data.cpp', + ], + LIBDEPS=['$BUILD_DIR/mongo/quick_exit', '$BUILD_DIR/third_party/murmurhash3/murmurhash3', - ]) - -env.CppUnitTest('initializer_dependency_graph_test', - ['initializer_dependency_graph_test.cpp'], - LIBDEPS=['base']) - -env.CppUnitTest('initializer_test', - ['initializer_test.cpp'], - LIBDEPS=['base']) - -env.CppUnitTest('owned_pointer_vector_test', - ['owned_pointer_vector_test.cpp'], - LIBDEPS=['base']) - -env.CppUnitTest('owned_pointer_map_test', - ['owned_pointer_map_test.cpp'], - LIBDEPS=['base']) - -env.CppUnitTest('parse_number_test', - ['parse_number_test.cpp'], - LIBDEPS=['base']) - -env.CppUnitTest('status_test', - 'status_test.cpp', - LIBDEPS=['base']) - -env.CppUnitTest('encoded_value_storage_test', - 'encoded_value_storage_test.cpp') - -env.CppUnitTest('data_view_test', - 'data_view_test.cpp') - -env.CppUnitTest('data_cursor_test', - 'data_cursor_test.cpp') - -env.CppUnitTest('counter_test', - 'counter_test.cpp', - LIBDEPS=['base']) - -env.CppUnitTest('string_data_test', - 'string_data_test.cpp', - LIBDEPS=['$BUILD_DIR/mongo/unittest/unittest']) + ]) + +env.CppUnitTest('base_test', + ['initializer_dependency_graph_test.cpp', + 'initializer_test.cpp', + 'owned_pointer_vector_test.cpp', + 'owned_pointer_map_test.cpp', + 'parse_number_test.cpp', + 'status_test.cpp', + 'encoded_value_storage_test.cpp', + 'data_view_test.cpp', + 'data_cursor_test.cpp', + 'counter_test.cpp', + 'string_data_test.cpp' + ]) diff --git a/src/mongo/client/connpool.cpp b/src/mongo/client/connpool.cpp index e4f61bde781..5cd702beaff 100644 --- a/src/mongo/client/connpool.cpp +++ b/src/mongo/client/connpool.cpp @@ -39,7 +39,6 @@ #include "mongo/client/syncclusterconnection.h" #include "mongo/util/exit.h" #include "mongo/util/log.h" -#include "mongo/s/shard.h" namespace mongo { diff --git a/src/mongo/client/connpool.h b/src/mongo/client/connpool.h index 97fb445e336..e027f182301 100644 --- a/src/mongo/client/connpool.h +++ b/src/mongo/client/connpool.h @@ -40,14 +40,13 @@ namespace mongo { - class Shard; class DBConnectionPool; /** * not thread safe * thread safety is handled by DBConnectionPool */ - class MONGO_CLIENT_API PoolForHost { + class PoolForHost { public: // Sentinel value indicating pool has no cleanup limit @@ -165,8 +164,7 @@ namespace mongo { c.conn()... } */ - class MONGO_CLIENT_API DBConnectionPool : public PeriodicTask { - + class DBConnectionPool : public PeriodicTask { public: DBConnectionPool(); @@ -268,9 +266,9 @@ namespace mongo { }; - extern MONGO_CLIENT_API DBConnectionPool pool; + extern DBConnectionPool pool; - class MONGO_CLIENT_API AScopedConnection : boost::noncopyable { + class AScopedConnection : boost::noncopyable { public: AScopedConnection() { _numConnections.fetchAndAdd(1); } virtual ~AScopedConnection() { _numConnections.fetchAndAdd(-1); } @@ -297,7 +295,7 @@ namespace mongo { clean up nicely (i.e. the socket gets closed automatically when the scopeddbconnection goes out of scope). */ - class MONGO_CLIENT_API ScopedDbConnection : public AScopedConnection { + class ScopedDbConnection : public AScopedConnection { public: /** the main constructor you want to use throws UserException if can't connect diff --git a/src/mongo/client/parallel.h b/src/mongo/client/parallel.h index 6820edf10a6..8a7fbf047da 100644 --- a/src/mongo/client/parallel.h +++ b/src/mongo/client/parallel.h @@ -37,7 +37,6 @@ #include <boost/shared_ptr.hpp> #include "mongo/client/export_macros.h" -#include "mongo/db/dbmessage.h" #include "mongo/db/matcher/matcher.h" #include "mongo/db/namespace_string.h" #include "mongo/s/shard.h" @@ -180,7 +179,7 @@ namespace mongo { * There is a deprecated legacy mode as well which effectively does a merge-sort across a number * of servers, but does not correctly enforce versioning (used only in mapreduce). */ - class MONGO_CLIENT_API ParallelSortClusteredCursor { + class ParallelSortClusteredCursor { public: ParallelSortClusteredCursor( const QuerySpec& qSpec, const CommandInfo& cInfo = CommandInfo() ); diff --git a/src/mongo/client/syncclusterconnection.h b/src/mongo/client/syncclusterconnection.h index 30790440478..d9f5ab3f2c8 100644 --- a/src/mongo/client/syncclusterconnection.h +++ b/src/mongo/client/syncclusterconnection.h @@ -53,7 +53,7 @@ namespace mongo { * The class checks if a command is read or write style, and sends to a single * node if a read lock command and to all in two phases with a write style command. */ - class MONGO_CLIENT_API SyncClusterConnection : public DBClientBase { + class SyncClusterConnection : public DBClientBase { public: using DBClientBase::query; @@ -195,7 +195,7 @@ namespace mongo { int batchSize ) = 0; }; - class MONGO_CLIENT_API UpdateNotTheSame : public UserException { + class UpdateNotTheSame : public UserException { public: UpdateNotTheSame( int code , const std::string& msg , const std::vector<std::string>& addrs , const std::vector<BSONObj>& lastErrors ) : UserException( code , msg ) , _addrs( addrs ) , _lastErrors( lastErrors ) { diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp index cae4ca7b97b..d8e15b96dad 100644 --- a/src/mongo/db/commands/mr.cpp +++ b/src/mongo/db/commands/mr.cpp @@ -1577,7 +1577,6 @@ namespace mongo { while ( i.more() ) { BSONElement e = i.next(); string shard = e.fieldName(); -// BSONObj res = e.embeddedObjectUserCheck(); servers.insert( shard ); } } diff --git a/src/mongo/s/cursors.cpp b/src/mongo/s/cursors.cpp index 4a74d05ac4d..19371affc8a 100644 --- a/src/mongo/s/cursors.cpp +++ b/src/mongo/s/cursors.cpp @@ -44,7 +44,6 @@ #include "mongo/db/auth/authorization_manager.h" #include "mongo/db/auth/authorization_session.h" #include "mongo/db/auth/privilege.h" -#include "mongo/client/connpool.h" #include "mongo/db/commands.h" #include "mongo/db/jsobj.h" #include "mongo/db/max_time.h" @@ -140,18 +139,7 @@ namespace mongo { return now - _lastAccessMillis; } - bool ShardedClientCursor::sendNextBatchAndReply( Request& r ){ - BufBuilder buffer( INIT_REPLY_BUFFER_SIZE ); - int docCount = 0; - bool hasMore = sendNextBatch( r, _ntoreturn, buffer, docCount ); - replyToQuery( 0, r.p(), r.m(), buffer.buf(), buffer.len(), docCount, - _totalSent, hasMore ? getId() : 0 ); - - return hasMore; - } - - bool ShardedClientCursor::sendNextBatch( Request& r , int ntoreturn , - BufBuilder& buffer, int& docCount ) { + bool ShardedClientCursor::sendNextBatch(int ntoreturn, BufBuilder& buffer, int& docCount) { uassert( 10191 , "cursor already done" , ! _done ); int maxSize = 1024 * 1024; diff --git a/src/mongo/s/cursors.h b/src/mongo/s/cursors.h index 43e7908103b..7b909e44e10 100644 --- a/src/mongo/s/cursors.h +++ b/src/mongo/s/cursors.h @@ -30,21 +30,20 @@ #pragma once -#include "mongo/platform/basic.h" - -#include <boost/noncopyable.hpp> #include <boost/shared_ptr.hpp> #include <string> +#include "mongo/base/disallow_copying.h" #include "mongo/client/parallel.h" -#include "mongo/db/dbmessage.h" -#include "mongo/db/jsobj.h" #include "mongo/platform/random.h" -#include "mongo/s/request.h" namespace mongo { - class ShardedClientCursor : boost::noncopyable { + class QueryMessage; + + + class ShardedClientCursor { + MONGO_DISALLOW_COPYING(ShardedClientCursor); public: ShardedClientCursor( QueryMessage& q , ParallelSortClusteredCursor * cursor ); virtual ~ShardedClientCursor(); @@ -57,14 +56,6 @@ namespace mongo { int getTotalSent() const; /** - * Sends queries to the shards, gather the result for this batch and sends the response - * to the socket. - * - * @return whether there is more data left - */ - bool sendNextBatchAndReply( Request& r ); - - /** * Sends queries to the shards and gather the result for this batch. * * @param r The request object from the client @@ -75,7 +66,7 @@ namespace mongo { * * @return true if this is not the final batch. */ - bool sendNextBatch( Request& r, int ntoreturn, BufBuilder& buffer, int& docCount ); + bool sendNextBatch(int ntoreturn, BufBuilder& buffer, int& docCount); void accessed(); /** @return idle time in ms */ diff --git a/src/mongo/s/s_only.cpp b/src/mongo/s/s_only.cpp index fcd923c964b..b4e3b2112a9 100644 --- a/src/mongo/s/s_only.cpp +++ b/src/mongo/s/s_only.cpp @@ -55,11 +55,6 @@ namespace mongo { using std::string; using std::stringstream; - void* remapPrivateView(void *oldPrivateAddr) { - log() << "remapPrivateView called in mongos, aborting" << endl; - fassertFailed(16462); - } - /** When this callback is run, we record a shard that we've used for useful work * in an operation to be read later by getLastError() */ diff --git a/src/mongo/s/strategy.cpp b/src/mongo/s/strategy.cpp index 8b80c304c76..90c29a897d0 100644 --- a/src/mongo/s/strategy.cpp +++ b/src/mongo/s/strategy.cpp @@ -213,7 +213,7 @@ namespace mongo { BufBuilder buffer( ShardedClientCursor::INIT_REPLY_BUFFER_SIZE ); int docCount = 0; const int startFrom = cc->getTotalSent(); - bool hasMore = cc->sendNextBatch( r, q.ntoreturn, buffer, docCount ); + bool hasMore = cc->sendNextBatch(q.ntoreturn, buffer, docCount); if ( hasMore ) { LOG(5) << "storing cursor : " << cc->getId() << endl; @@ -661,7 +661,7 @@ namespace mongo { BufBuilder buffer( ShardedClientCursor::INIT_REPLY_BUFFER_SIZE ); int docCount = 0; const int startFrom = cursor->getTotalSent(); - bool hasMore = cursor->sendNextBatch( r, ntoreturn, buffer, docCount ); + bool hasMore = cursor->sendNextBatch(ntoreturn, buffer, docCount); if ( hasMore ) { // still more data diff --git a/src/mongo/scripting/v8-3.25_db.cpp b/src/mongo/scripting/v8-3.25_db.cpp index 58ffc3a5fe2..8c04e39bc21 100644 --- a/src/mongo/scripting/v8-3.25_db.cpp +++ b/src/mongo/scripting/v8-3.25_db.cpp @@ -36,7 +36,6 @@ #include "mongo/base/init.h" #include "mongo/client/sasl_client_authenticate.h" -#include "mongo/client/syncclusterconnection.h" #include "mongo/db/namespace_string.h" #include "mongo/s/d_state.h" #include "mongo/scripting/engine_v8-3.25.h" diff --git a/src/mongo/scripting/v8_db.cpp b/src/mongo/scripting/v8_db.cpp index 1f784c24b0c..4c734115f94 100644 --- a/src/mongo/scripting/v8_db.cpp +++ b/src/mongo/scripting/v8_db.cpp @@ -38,7 +38,6 @@ #include "mongo/client/sasl_client_authenticate.h" #include "mongo/client/native_sasl_client_session.h" #include "mongo/client/sasl_scramsha1_client_conversation.h" -#include "mongo/client/syncclusterconnection.h" #include "mongo/db/namespace_string.h" #include "mongo/s/d_state.h" #include "mongo/scripting/engine_v8.h" |