diff options
Diffstat (limited to 'src/mongo/db')
320 files changed, 960 insertions, 30 deletions
diff --git a/src/mongo/db/auth/auth_index_d.cpp b/src/mongo/db/auth/auth_index_d.cpp index a2fa5cf609e..947ee0b8ebe 100644 --- a/src/mongo/db/auth/auth_index_d.cpp +++ b/src/mongo/db/auth/auth_index_d.cpp @@ -45,6 +45,9 @@ #include "mongo/util/log.h" namespace mongo { + + using std::endl; + namespace authindex { namespace { diff --git a/src/mongo/db/auth/authorization_manager.cpp b/src/mongo/db/auth/authorization_manager.cpp index 63bccaa4514..0dcc7c34568 100644 --- a/src/mongo/db/auth/authorization_manager.cpp +++ b/src/mongo/db/auth/authorization_manager.cpp @@ -65,6 +65,10 @@ namespace mongo { + using std::endl; + using std::string; + using std::vector; + AuthInfo internalSecurity; MONGO_INITIALIZER_WITH_PREREQUISITES(SetupInternalSecurityUser, MONGO_NO_PREREQUISITES)( @@ -617,7 +621,7 @@ namespace mongo { user->incrementRefCount(); // NOTE: It is not safe to throw an exception from here to the end of the method. if (guard.isSameCacheGeneration()) { - _userCache.insert(make_pair(userName, user.get())); + _userCache.insert(std::make_pair(userName, user.get())); if (_version == schemaVersionInvalid) _version = authzVersion; } diff --git a/src/mongo/db/auth/authorization_manager_test.cpp b/src/mongo/db/auth/authorization_manager_test.cpp index 4d89de6c5c0..c94c5bfb4c0 100644 --- a/src/mongo/db/auth/authorization_manager_test.cpp +++ b/src/mongo/db/auth/authorization_manager_test.cpp @@ -51,6 +51,7 @@ namespace mongo { namespace { using boost::scoped_ptr; + using std::vector; TEST(RoleParsingTest, BuildRoleBSON) { RoleGraph graph; diff --git a/src/mongo/db/auth/authorization_session.cpp b/src/mongo/db/auth/authorization_session.cpp index 5b7a7c5e459..00b3b953782 100644 --- a/src/mongo/db/auth/authorization_session.cpp +++ b/src/mongo/db/auth/authorization_session.cpp @@ -51,6 +51,8 @@ namespace mongo { + using std::vector; + namespace { const std::string ADMIN_DBNAME = "admin"; } // namespace diff --git a/src/mongo/db/auth/authz_manager_external_state.cpp b/src/mongo/db/auth/authz_manager_external_state.cpp index 0520b0df526..c23488dee04 100644 --- a/src/mongo/db/auth/authz_manager_external_state.cpp +++ b/src/mongo/db/auth/authz_manager_external_state.cpp @@ -37,6 +37,8 @@ namespace mongo { + using std::string; + AuthzManagerExternalState::AuthzManagerExternalState() {} AuthzManagerExternalState::~AuthzManagerExternalState() {} diff --git a/src/mongo/db/auth/authz_manager_external_state_d.cpp b/src/mongo/db/auth/authz_manager_external_state_d.cpp index b71789d8c8a..6ccc261e016 100644 --- a/src/mongo/db/auth/authz_manager_external_state_d.cpp +++ b/src/mongo/db/auth/authz_manager_external_state_d.cpp @@ -52,6 +52,9 @@ namespace mongo { + using std::endl; + using std::string; + AuthzManagerExternalStateMongod::AuthzManagerExternalStateMongod() {} AuthzManagerExternalStateMongod::~AuthzManagerExternalStateMongod() {} diff --git a/src/mongo/db/auth/authz_manager_external_state_local.cpp b/src/mongo/db/auth/authz_manager_external_state_local.cpp index b1a0c0a3a99..507db983a53 100644 --- a/src/mongo/db/auth/authz_manager_external_state_local.cpp +++ b/src/mongo/db/auth/authz_manager_external_state_local.cpp @@ -41,6 +41,8 @@ namespace mongo { + using std::vector; + AuthzManagerExternalStateLocal::AuthzManagerExternalStateLocal() : _roleGraphState(roleGraphStateInitial) {} AuthzManagerExternalStateLocal::~AuthzManagerExternalStateLocal() {} diff --git a/src/mongo/db/auth/authz_manager_external_state_s.cpp b/src/mongo/db/auth/authz_manager_external_state_s.cpp index d10fd8d4e2b..63f18318592 100644 --- a/src/mongo/db/auth/authz_manager_external_state_s.cpp +++ b/src/mongo/db/auth/authz_manager_external_state_s.cpp @@ -51,6 +51,8 @@ namespace mongo { using boost::scoped_ptr; + using std::endl; + using std::vector; AuthzManagerExternalStateMongos::AuthzManagerExternalStateMongos() {} diff --git a/src/mongo/db/auth/privilege_parser.cpp b/src/mongo/db/auth/privilege_parser.cpp index 88dfbf961b0..c0207a8b19c 100644 --- a/src/mongo/db/auth/privilege_parser.cpp +++ b/src/mongo/db/auth/privilege_parser.cpp @@ -37,6 +37,9 @@ namespace mongo { + using std::string; + using std::vector; + using mongoutils::str::stream; const BSONField<bool> ParsedResource::anyResource("anyResource"); diff --git a/src/mongo/db/auth/sasl_commands.cpp b/src/mongo/db/auth/sasl_commands.cpp index 1890d3ba54b..ae773dd17e3 100644 --- a/src/mongo/db/auth/sasl_commands.cpp +++ b/src/mongo/db/auth/sasl_commands.cpp @@ -57,6 +57,8 @@ namespace mongo { namespace { + using std::stringstream; + const bool autoAuthorizeDefault = true; class CmdSaslStart : public Command { diff --git a/src/mongo/db/auth/sasl_scramsha1_server_conversation.cpp b/src/mongo/db/auth/sasl_scramsha1_server_conversation.cpp index 3ec0e0f32de..385d09a42b9 100644 --- a/src/mongo/db/auth/sasl_scramsha1_server_conversation.cpp +++ b/src/mongo/db/auth/sasl_scramsha1_server_conversation.cpp @@ -50,6 +50,7 @@ namespace mongo { using boost::scoped_ptr; + using std::string; SaslSCRAMSHA1ServerConversation::SaslSCRAMSHA1ServerConversation( SaslAuthenticationSession* saslAuthSession) : diff --git a/src/mongo/db/auth/security_key.cpp b/src/mongo/db/auth/security_key.cpp index 0b70544f841..8edbc6ef140 100644 --- a/src/mongo/db/auth/security_key.cpp +++ b/src/mongo/db/auth/security_key.cpp @@ -51,6 +51,9 @@ namespace mongo { + using std::endl; + using std::string; + bool setUpSecurityKey(const string& filename) { struct stat stats; diff --git a/src/mongo/db/auth/user_management_commands_parser.cpp b/src/mongo/db/auth/user_management_commands_parser.cpp index f8226d4afcf..7f2174ee22f 100644 --- a/src/mongo/db/auth/user_management_commands_parser.cpp +++ b/src/mongo/db/auth/user_management_commands_parser.cpp @@ -48,6 +48,8 @@ namespace mongo { namespace auth { + using std::vector; + /** * Writes into *writeConcern a BSONObj describing the parameters to getLastError to use for * the write confirmation. diff --git a/src/mongo/db/catalog/collection.cpp b/src/mongo/db/catalog/collection.cpp index 642466a73e2..1b1bb6153cb 100644 --- a/src/mongo/db/catalog/collection.cpp +++ b/src/mongo/db/catalog/collection.cpp @@ -56,6 +56,10 @@ namespace mongo { using boost::scoped_ptr; + using std::endl; + using std::string; + using std::vector; + using logger::LogComponent; std::string CompactOptions::toString() const { diff --git a/src/mongo/db/catalog/collection_compact.cpp b/src/mongo/db/catalog/collection_compact.cpp index 911ef28979a..9081bff2682 100644 --- a/src/mongo/db/catalog/collection_compact.cpp +++ b/src/mongo/db/catalog/collection_compact.cpp @@ -47,6 +47,9 @@ namespace mongo { + using std::endl; + using std::vector; + namespace { BSONObj _compactAdjustIndexSpec( const BSONObj& oldSpec ) { BSONObjBuilder b; diff --git a/src/mongo/db/catalog/cursor_manager.cpp b/src/mongo/db/catalog/cursor_manager.cpp index ea03c3175e1..17c42000b31 100644 --- a/src/mongo/db/catalog/cursor_manager.cpp +++ b/src/mongo/db/catalog/cursor_manager.cpp @@ -47,6 +47,9 @@ namespace mongo { + using std::string; + using std::vector; + namespace { unsigned idFromCursorId( CursorId id ) { uint64_t x = static_cast<uint64_t>(id); diff --git a/src/mongo/db/catalog/database.cpp b/src/mongo/db/catalog/database.cpp index d2976a86668..2d7b9588ae4 100644 --- a/src/mongo/db/catalog/database.cpp +++ b/src/mongo/db/catalog/database.cpp @@ -62,6 +62,14 @@ namespace mongo { + using std::auto_ptr; + using std::endl; + using std::list; + using std::set; + using std::string; + using std::stringstream; + using std::vector; + void massertNamespaceNotIndex( const StringData& ns, const StringData& caller ) { massert( 17320, str::stream() << "cannot do " << caller diff --git a/src/mongo/db/catalog/database_holder.cpp b/src/mongo/db/catalog/database_holder.cpp index ae1a73eb27a..4a554b4089f 100644 --- a/src/mongo/db/catalog/database_holder.cpp +++ b/src/mongo/db/catalog/database_holder.cpp @@ -45,6 +45,11 @@ namespace mongo { + using std::endl; + using std::set; + using std::string; + using std::stringstream; + static DatabaseHolder _dbHolder; namespace { diff --git a/src/mongo/db/catalog/index_catalog.cpp b/src/mongo/db/catalog/index_catalog.cpp index 6462f7396ff..aff072ff221 100644 --- a/src/mongo/db/catalog/index_catalog.cpp +++ b/src/mongo/db/catalog/index_catalog.cpp @@ -64,6 +64,11 @@ namespace mongo { + using std::auto_ptr; + using std::endl; + using std::string; + using std::vector; + static const int INDEX_CATALOG_INIT = 283711; static const int INDEX_CATALOG_UNINIT = 654321; diff --git a/src/mongo/db/catalog/index_catalog_entry.cpp b/src/mongo/db/catalog/index_catalog_entry.cpp index 1260b6f14c4..ba049f6e6eb 100644 --- a/src/mongo/db/catalog/index_catalog_entry.cpp +++ b/src/mongo/db/catalog/index_catalog_entry.cpp @@ -47,6 +47,8 @@ namespace mongo { + using std::string; + class HeadManagerImpl : public HeadManager { public: HeadManagerImpl(IndexCatalogEntry* ice) : _catalogEntry(ice) { } diff --git a/src/mongo/db/catalog/index_create.cpp b/src/mongo/db/catalog/index_create.cpp index cf2e7f961e4..1fbd0f4452d 100644 --- a/src/mongo/db/catalog/index_create.cpp +++ b/src/mongo/db/catalog/index_create.cpp @@ -55,6 +55,8 @@ namespace mongo { using boost::scoped_ptr; + using std::string; + using std::endl; /** * On rollback sets MultiIndexBlock::_needToCleanup to true. diff --git a/src/mongo/db/catalog/index_key_validate.cpp b/src/mongo/db/catalog/index_key_validate.cpp index 660f74f77bb..c42c2a1921f 100644 --- a/src/mongo/db/catalog/index_key_validate.cpp +++ b/src/mongo/db/catalog/index_key_validate.cpp @@ -34,6 +34,9 @@ #include "mongo/util/mongoutils/str.h" namespace mongo { + + using std::string; + Status validateKeyPattern(const BSONObj& key) { const ErrorCodes::Error code = ErrorCodes::CannotCreateIndex; diff --git a/src/mongo/db/client.cpp b/src/mongo/db/client.cpp index 6555ebc05e9..6f12fb20be2 100644 --- a/src/mongo/db/client.cpp +++ b/src/mongo/db/client.cpp @@ -72,6 +72,9 @@ namespace mongo { + using std::string; + using std::stringstream; + using logger::LogComponent; boost::mutex Client::clientsMutex; diff --git a/src/mongo/db/clientcursor.cpp b/src/mongo/db/clientcursor.cpp index bc09cc4bc01..02e66852a27 100644 --- a/src/mongo/db/clientcursor.cpp +++ b/src/mongo/db/clientcursor.cpp @@ -52,6 +52,9 @@ namespace mongo { + using std::string; + using std::stringstream; + static Counter64 cursorStatsOpen; // gauge static Counter64 cursorStatsOpenPinned; // gauge static Counter64 cursorStatsOpenNoTimeout; // gauge diff --git a/src/mongo/db/clientlistplugin.cpp b/src/mongo/db/clientlistplugin.cpp index 9ed142ad218..cf7e359d309 100644 --- a/src/mongo/db/clientlistplugin.cpp +++ b/src/mongo/db/clientlistplugin.cpp @@ -48,6 +48,7 @@ namespace mongo { using boost::scoped_ptr; + using std::string; namespace { diff --git a/src/mongo/db/cloner.cpp b/src/mongo/db/cloner.cpp index b052a253407..d4a6d892604 100644 --- a/src/mongo/db/cloner.cpp +++ b/src/mongo/db/cloner.cpp @@ -63,6 +63,12 @@ namespace mongo { using boost::scoped_ptr; + using std::auto_ptr; + using std::list; + using std::set; + using std::endl; + using std::string; + using std::vector; MONGO_EXPORT_SERVER_PARAMETER(skipCorruptDocumentsWhenCloning, bool, false); diff --git a/src/mongo/db/commands.cpp b/src/mongo/db/commands.cpp index b136d39a434..36bb2a37da6 100644 --- a/src/mongo/db/commands.cpp +++ b/src/mongo/db/commands.cpp @@ -55,6 +55,10 @@ namespace mongo { + using std::string; + using std::stringstream; + using std::endl; + using logger::LogComponent; Command::CommandMap* Command::_commandsByBestName; diff --git a/src/mongo/db/commands/apply_ops.cpp b/src/mongo/db/commands/apply_ops.cpp index dc8c4bd601c..da11dbbcff7 100644 --- a/src/mongo/db/commands/apply_ops.cpp +++ b/src/mongo/db/commands/apply_ops.cpp @@ -45,6 +45,10 @@ #include "mongo/db/repl/oplog.h" namespace mongo { + + using std::string; + using std::stringstream; + class ApplyOpsCmd : public Command { public: virtual bool slaveOk() const { return false; } diff --git a/src/mongo/db/commands/auth_schema_upgrade_d.cpp b/src/mongo/db/commands/auth_schema_upgrade_d.cpp index b3cfba4a4ef..5980b06735e 100644 --- a/src/mongo/db/commands/auth_schema_upgrade_d.cpp +++ b/src/mongo/db/commands/auth_schema_upgrade_d.cpp @@ -44,6 +44,8 @@ namespace mongo { namespace { + using std::string; + Status checkReplicaMemberVersions() { repl::ReplicationCoordinator* replCoord = repl::getGlobalReplicationCoordinator(); diff --git a/src/mongo/db/commands/authentication_commands.cpp b/src/mongo/db/commands/authentication_commands.cpp index f62523c08da..6840b3d3497 100644 --- a/src/mongo/db/commands/authentication_commands.cpp +++ b/src/mongo/db/commands/authentication_commands.cpp @@ -63,6 +63,10 @@ namespace mongo { + using std::hex; + using std::string; + using std::stringstream; + static bool _isCRAuthDisabled; static bool _isX509AuthDisabled; static const char _nonceAuthenticationDisabledMessage[] = diff --git a/src/mongo/db/commands/cleanup_orphaned_cmd.cpp b/src/mongo/db/commands/cleanup_orphaned_cmd.cpp index 6d10d92d2ae..6245481f292 100644 --- a/src/mongo/db/commands/cleanup_orphaned_cmd.cpp +++ b/src/mongo/db/commands/cleanup_orphaned_cmd.cpp @@ -61,6 +61,9 @@ namespace { namespace mongo { + using std::endl; + using std::string; + using mongoutils::str::stream; enum CleanupResult { diff --git a/src/mongo/db/commands/clone.cpp b/src/mongo/db/commands/clone.cpp index dc51dc68d96..0aba60ba805 100644 --- a/src/mongo/db/commands/clone.cpp +++ b/src/mongo/db/commands/clone.cpp @@ -54,6 +54,10 @@ namespace mongo { + using std::set; + using std::string; + using std::stringstream; + /* Usage: mydb.$cmd.findOne( { clone: "fromhost" } ); Note: doesn't work with authentication enabled, except as internal operation or for diff --git a/src/mongo/db/commands/clone_collection.cpp b/src/mongo/db/commands/clone_collection.cpp index 411d481dad6..25f2647451f 100644 --- a/src/mongo/db/commands/clone_collection.cpp +++ b/src/mongo/db/commands/clone_collection.cpp @@ -59,6 +59,11 @@ namespace mongo { + using std::auto_ptr; + using std::string; + using std::stringstream; + using std::endl; + class CmdCloneCollection : public Command { public: CmdCloneCollection() : Command("cloneCollection") { } diff --git a/src/mongo/db/commands/collection_to_capped.cpp b/src/mongo/db/commands/collection_to_capped.cpp index 327125ea1c8..442241d6578 100644 --- a/src/mongo/db/commands/collection_to_capped.cpp +++ b/src/mongo/db/commands/collection_to_capped.cpp @@ -44,6 +44,8 @@ namespace mongo { using boost::scoped_ptr; + using std::string; + using std::stringstream; namespace { diff --git a/src/mongo/db/commands/compact.cpp b/src/mongo/db/commands/compact.cpp index e087220a3d2..ef60369eaeb 100644 --- a/src/mongo/db/commands/compact.cpp +++ b/src/mongo/db/commands/compact.cpp @@ -50,6 +50,9 @@ namespace mongo { + using std::string; + using std::stringstream; + class CompactCmd : public Command { public: virtual bool isWriteCommandForConfigServer() const { return false; } diff --git a/src/mongo/db/commands/connection_status.cpp b/src/mongo/db/commands/connection_status.cpp index abd892f2e28..b45fd97fa83 100644 --- a/src/mongo/db/commands/connection_status.cpp +++ b/src/mongo/db/commands/connection_status.cpp @@ -37,6 +37,10 @@ #include "mongo/db/commands.h" namespace mongo { + + using std::string; + using std::stringstream; + class CmdConnectionStatus : public Command { public: CmdConnectionStatus() : Command("connectionStatus") {} diff --git a/src/mongo/db/commands/copydb.cpp b/src/mongo/db/commands/copydb.cpp index 41e4f13a13b..03b4e43b1b6 100644 --- a/src/mongo/db/commands/copydb.cpp +++ b/src/mongo/db/commands/copydb.cpp @@ -58,6 +58,9 @@ namespace mongo { + using std::string; + using std::stringstream; + /* Usage: * admindb.$cmd.findOne( { copydb: 1, fromhost: <connection string>, fromdb: <db>, * todb: <db>[, username: <username>, nonce: <nonce>, key: <key>] } ); diff --git a/src/mongo/db/commands/copydb_start_commands.cpp b/src/mongo/db/commands/copydb_start_commands.cpp index 47f34c59c10..9bf95923b96 100644 --- a/src/mongo/db/commands/copydb_start_commands.cpp +++ b/src/mongo/db/commands/copydb_start_commands.cpp @@ -60,6 +60,9 @@ namespace mongo { + using std::string; + using std::stringstream; + // SERVER-4328 todo review for concurrency // :( thread_specific_ptr<DBClientBase> authConn_; diff --git a/src/mongo/db/commands/count.cpp b/src/mongo/db/commands/count.cpp index 7cd349d17d5..23ff7875eaf 100644 --- a/src/mongo/db/commands/count.cpp +++ b/src/mongo/db/commands/count.cpp @@ -47,6 +47,8 @@ namespace mongo { using boost::scoped_ptr; + using std::string; + using std::stringstream; /* select count(*) */ class CmdCount : public Command { diff --git a/src/mongo/db/commands/create_indexes.cpp b/src/mongo/db/commands/create_indexes.cpp index 33f9e7da607..e0088bec523 100644 --- a/src/mongo/db/commands/create_indexes.cpp +++ b/src/mongo/db/commands/create_indexes.cpp @@ -49,6 +49,8 @@ namespace mongo { + using std::string; + /** * { createIndexes : "bar", indexes : [ { ns : "test.bar", key : { x : 1 }, name: "x_1" } ] } */ diff --git a/src/mongo/db/commands/dbhash.cpp b/src/mongo/db/commands/dbhash.cpp index 891d19765b2..0066d700874 100644 --- a/src/mongo/db/commands/dbhash.cpp +++ b/src/mongo/db/commands/dbhash.cpp @@ -46,6 +46,12 @@ namespace mongo { using boost::scoped_ptr; + using std::auto_ptr; + using std::list; + using std::endl; + using std::set; + using std::string; + using std::vector; DBHashCmd dbhashCmd; diff --git a/src/mongo/db/commands/distinct.cpp b/src/mongo/db/commands/distinct.cpp index 2260373317a..0ccbd41909f 100644 --- a/src/mongo/db/commands/distinct.cpp +++ b/src/mongo/db/commands/distinct.cpp @@ -46,6 +46,10 @@ namespace mongo { + using std::auto_ptr; + using std::string; + using std::stringstream; + class DistinctCommand : public Command { public: DistinctCommand() : Command("distinct") {} diff --git a/src/mongo/db/commands/drop_indexes.cpp b/src/mongo/db/commands/drop_indexes.cpp index b46ab0c8f15..e43145dfb3b 100644 --- a/src/mongo/db/commands/drop_indexes.cpp +++ b/src/mongo/db/commands/drop_indexes.cpp @@ -53,6 +53,11 @@ namespace mongo { + using std::endl; + using std::string; + using std::stringstream; + using std::vector; + /* "dropIndexes" is now the preferred form - "deleteIndexes" deprecated */ class CmdDropIndexes : public Command { public: diff --git a/src/mongo/db/commands/explain_cmd.cpp b/src/mongo/db/commands/explain_cmd.cpp index 51bed5599e8..9a411c8fa26 100644 --- a/src/mongo/db/commands/explain_cmd.cpp +++ b/src/mongo/db/commands/explain_cmd.cpp @@ -40,6 +40,8 @@ namespace mongo { + using std::string; + static CmdExplain cmdExplain; Status CmdExplain::checkAuthForCommand(ClientBasic* client, diff --git a/src/mongo/db/commands/fail_point_cmd.cpp b/src/mongo/db/commands/fail_point_cmd.cpp index aa3c79c5bcb..7aca28140d9 100644 --- a/src/mongo/db/commands/fail_point_cmd.cpp +++ b/src/mongo/db/commands/fail_point_cmd.cpp @@ -36,6 +36,10 @@ #include "mongo/util/fail_point_service.h" namespace mongo { + + using std::string; + using std::stringstream; + /** * Command for modifying installed fail points. * diff --git a/src/mongo/db/commands/find_and_modify.cpp b/src/mongo/db/commands/find_and_modify.cpp index b131143f632..e8e5ad2d748 100644 --- a/src/mongo/db/commands/find_and_modify.cpp +++ b/src/mongo/db/commands/find_and_modify.cpp @@ -48,6 +48,9 @@ namespace mongo { using boost::scoped_ptr; + using std::endl; + using std::string; + using std::stringstream; /* Find and Modify an object returning either the old (default) or new value*/ class CmdFindAndModify : public Command { diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp index a0a1c21c7b7..89cc90bfc17 100644 --- a/src/mongo/db/commands/find_cmd.cpp +++ b/src/mongo/db/commands/find_cmd.cpp @@ -45,6 +45,8 @@ namespace mongo { using boost::scoped_ptr; + using std::auto_ptr; + using std::string; static FindCmd findCmd; diff --git a/src/mongo/db/commands/fsync.cpp b/src/mongo/db/commands/fsync.cpp index eaaf4beb09b..1fcfd70d4cd 100644 --- a/src/mongo/db/commands/fsync.cpp +++ b/src/mongo/db/commands/fsync.cpp @@ -50,7 +50,11 @@ namespace mongo { - + + using std::endl; + using std::string; + using std::stringstream; + class FSyncLockThread : public BackgroundJob { void doRealWork(); public: diff --git a/src/mongo/db/commands/geo_near_cmd.cpp b/src/mongo/db/commands/geo_near_cmd.cpp index cab42a0bcda..450366da759 100644 --- a/src/mongo/db/commands/geo_near_cmd.cpp +++ b/src/mongo/db/commands/geo_near_cmd.cpp @@ -54,6 +54,7 @@ namespace mongo { using boost::scoped_ptr; + using std::stringstream; class Geo2dFindNearCmd : public Command { public: diff --git a/src/mongo/db/commands/get_last_error.cpp b/src/mongo/db/commands/get_last_error.cpp index bc6959e231d..0d5d5df0675 100644 --- a/src/mongo/db/commands/get_last_error.cpp +++ b/src/mongo/db/commands/get_last_error.cpp @@ -43,6 +43,9 @@ namespace mongo { + using std::string; + using std::stringstream; + /* reset any errors so that getlasterror comes back clean. useful before performing a long series of operations where we want to diff --git a/src/mongo/db/commands/group.cpp b/src/mongo/db/commands/group.cpp index 5f5b87f5e62..2543b9b7a4b 100644 --- a/src/mongo/db/commands/group.cpp +++ b/src/mongo/db/commands/group.cpp @@ -45,6 +45,7 @@ namespace mongo { using boost::scoped_ptr; + using std::string; static GroupCommand cmdGroup; diff --git a/src/mongo/db/commands/hashcmd.cpp b/src/mongo/db/commands/hashcmd.cpp index 8af317bf0ef..94d9267ded7 100644 --- a/src/mongo/db/commands/hashcmd.cpp +++ b/src/mongo/db/commands/hashcmd.cpp @@ -46,6 +46,9 @@ namespace mongo { + using std::string; + using std::stringstream; + // Testing only, enabled via command-line. class CmdHashElt : public Command { public: diff --git a/src/mongo/db/commands/index_filter_commands_test.cpp b/src/mongo/db/commands/index_filter_commands_test.cpp index 3ca48225e28..819a93dfa0c 100644 --- a/src/mongo/db/commands/index_filter_commands_test.cpp +++ b/src/mongo/db/commands/index_filter_commands_test.cpp @@ -45,6 +45,7 @@ using namespace mongo; namespace { using boost::scoped_ptr; + using std::auto_ptr; using std::string; using std::vector; diff --git a/src/mongo/db/commands/isself.cpp b/src/mongo/db/commands/isself.cpp index 0339cfdb0e6..8b6c6fd6d9f 100644 --- a/src/mongo/db/commands/isself.cpp +++ b/src/mongo/db/commands/isself.cpp @@ -36,6 +36,9 @@ namespace mongo { + using std::string; + using std::stringstream; + class IsSelfCommand : public Command { public: IsSelfCommand() : Command("_isSelf") {} diff --git a/src/mongo/db/commands/list_collections.cpp b/src/mongo/db/commands/list_collections.cpp index d9385c62d45..8508390317b 100644 --- a/src/mongo/db/commands/list_collections.cpp +++ b/src/mongo/db/commands/list_collections.cpp @@ -49,6 +49,9 @@ namespace mongo { using boost::scoped_ptr; + using std::list; + using std::string; + using std::stringstream; class CmdListCollections : public Command { public: diff --git a/src/mongo/db/commands/list_databases.cpp b/src/mongo/db/commands/list_databases.cpp index c84f38333b9..603f340bddc 100644 --- a/src/mongo/db/commands/list_databases.cpp +++ b/src/mongo/db/commands/list_databases.cpp @@ -38,6 +38,11 @@ namespace mongo { + using std::set; + using std::string; + using std::stringstream; + using std::vector; + // XXX: remove and put into storage api intmax_t dbSize( const string& database ); diff --git a/src/mongo/db/commands/list_indexes.cpp b/src/mongo/db/commands/list_indexes.cpp index c405bbe8823..16c9678229f 100644 --- a/src/mongo/db/commands/list_indexes.cpp +++ b/src/mongo/db/commands/list_indexes.cpp @@ -45,6 +45,10 @@ namespace mongo { + using std::string; + using std::stringstream; + using std::vector; + /** * Lists the indexes for a given collection. * diff --git a/src/mongo/db/commands/merge_chunks_cmd.cpp b/src/mongo/db/commands/merge_chunks_cmd.cpp index e14a5a40564..df67acc1c8d 100644 --- a/src/mongo/db/commands/merge_chunks_cmd.cpp +++ b/src/mongo/db/commands/merge_chunks_cmd.cpp @@ -38,6 +38,10 @@ namespace mongo { + using std::string; + using std::stringstream; + using std::vector; + /** * Mongod-side command for merging chunks. */ diff --git a/src/mongo/db/commands/mr.cpp b/src/mongo/db/commands/mr.cpp index e330372778d..f6d340b97d3 100644 --- a/src/mongo/db/commands/mr.cpp +++ b/src/mongo/db/commands/mr.cpp @@ -69,6 +69,12 @@ namespace mongo { using boost::scoped_ptr; + using std::auto_ptr; + using std::endl; + using std::set; + using std::string; + using std::stringstream; + using std::vector; namespace mr { diff --git a/src/mongo/db/commands/oplog_note.cpp b/src/mongo/db/commands/oplog_note.cpp index 85789a003cf..3d75399c13d 100644 --- a/src/mongo/db/commands/oplog_note.cpp +++ b/src/mongo/db/commands/oplog_note.cpp @@ -38,6 +38,10 @@ #include "mongo/db/repl/replication_coordinator_global.h" namespace mongo { + + using std::string; + using std::stringstream; + class AppendOplogNoteCmd : public Command { public: AppendOplogNoteCmd() : Command( "appendOplogNote" ) {} diff --git a/src/mongo/db/commands/parallel_collection_scan.cpp b/src/mongo/db/commands/parallel_collection_scan.cpp index 4ac77855f0d..89c0d888361 100644 --- a/src/mongo/db/commands/parallel_collection_scan.cpp +++ b/src/mongo/db/commands/parallel_collection_scan.cpp @@ -38,6 +38,8 @@ namespace mongo { + using std::auto_ptr; + using std::string; class ParallelCollectionScanCmd : public Command { public: diff --git a/src/mongo/db/commands/parameters.cpp b/src/mongo/db/commands/parameters.cpp index 9d864b26eb4..adaa3b0bda4 100644 --- a/src/mongo/db/commands/parameters.cpp +++ b/src/mongo/db/commands/parameters.cpp @@ -46,6 +46,7 @@ #include "mongo/util/net/ssl_options.h" using std::string; +using std::stringstream; namespace mongo { diff --git a/src/mongo/db/commands/pipeline_command.cpp b/src/mongo/db/commands/pipeline_command.cpp index ad8cbb0bcb0..a01fad5f1d4 100644 --- a/src/mongo/db/commands/pipeline_command.cpp +++ b/src/mongo/db/commands/pipeline_command.cpp @@ -57,6 +57,10 @@ namespace mongo { using boost::intrusive_ptr; using boost::scoped_ptr; using boost::shared_ptr; + using std::auto_ptr; + using std::string; + using std::stringstream; + using std::endl; /** * Returns true if we need to keep a ClientCursor saved for this pipeline (for future getMore diff --git a/src/mongo/db/commands/plan_cache_commands_test.cpp b/src/mongo/db/commands/plan_cache_commands_test.cpp index e723923d185..3ed53afc8f8 100644 --- a/src/mongo/db/commands/plan_cache_commands_test.cpp +++ b/src/mongo/db/commands/plan_cache_commands_test.cpp @@ -47,6 +47,7 @@ using namespace mongo; namespace { using boost::scoped_ptr; + using std::auto_ptr; using std::string; using std::vector; diff --git a/src/mongo/db/commands/rename_collection.cpp b/src/mongo/db/commands/rename_collection.cpp index 2c87fa0d1e8..dcc1a1b68d6 100644 --- a/src/mongo/db/commands/rename_collection.cpp +++ b/src/mongo/db/commands/rename_collection.cpp @@ -49,6 +49,10 @@ namespace mongo { + using std::min; + using std::string; + using std::stringstream; + class CmdRenameCollection : public Command { public: CmdRenameCollection() : Command( "renameCollection" ) {} diff --git a/src/mongo/db/commands/repair_cursor.cpp b/src/mongo/db/commands/repair_cursor.cpp index 7aa680e115f..b521d526932 100644 --- a/src/mongo/db/commands/repair_cursor.cpp +++ b/src/mongo/db/commands/repair_cursor.cpp @@ -38,6 +38,8 @@ namespace mongo { + using std::string; + class RepairCursorCmd : public Command { public: RepairCursorCmd() : Command("repairCursor") {} diff --git a/src/mongo/db/commands/server_status.cpp b/src/mongo/db/commands/server_status.cpp index a2541ca3324..cbe61fb104f 100644 --- a/src/mongo/db/commands/server_status.cpp +++ b/src/mongo/db/commands/server_status.cpp @@ -56,6 +56,11 @@ namespace mongo { + using std::endl; + using std::map; + using std::string; + using std::stringstream; + class CmdServerStatus : public Command { public: diff --git a/src/mongo/db/commands/server_status_internal.cpp b/src/mongo/db/commands/server_status_internal.cpp index 731379a37d6..e329a3724a4 100644 --- a/src/mongo/db/commands/server_status_internal.cpp +++ b/src/mongo/db/commands/server_status_internal.cpp @@ -37,6 +37,11 @@ namespace mongo { + using std::cerr; + using std::endl; + using std::map; + using std::string; + using namespace mongoutils; MetricTree* MetricTree::theMetricTree = NULL; diff --git a/src/mongo/db/commands/server_status_metric.cpp b/src/mongo/db/commands/server_status_metric.cpp index 285ec813fcf..1e999635751 100644 --- a/src/mongo/db/commands/server_status_metric.cpp +++ b/src/mongo/db/commands/server_status_metric.cpp @@ -34,6 +34,8 @@ namespace mongo { + using std::string; + ServerStatusMetric::ServerStatusMetric(const string& nameIn) : _name( nameIn ), _leafName( _parseLeafName( nameIn ) ) { diff --git a/src/mongo/db/commands/test_commands.cpp b/src/mongo/db/commands/test_commands.cpp index 9401d555894..5bee0bf654c 100644 --- a/src/mongo/db/commands/test_commands.cpp +++ b/src/mongo/db/commands/test_commands.cpp @@ -45,6 +45,10 @@ namespace mongo { + using std::endl; + using std::string; + using std::stringstream; + /* For testing only, not for general use. Enabled via command-line */ class GodInsert : public Command { public: diff --git a/src/mongo/db/commands/touch.cpp b/src/mongo/db/commands/touch.cpp index d514a8ba69c..063d6225976 100644 --- a/src/mongo/db/commands/touch.cpp +++ b/src/mongo/db/commands/touch.cpp @@ -51,6 +51,9 @@ namespace mongo { + using std::string; + using std::stringstream; + class TouchCmd : public Command { public: virtual bool isWriteCommandForConfigServer() const { return false; } diff --git a/src/mongo/db/commands/user_management_commands.cpp b/src/mongo/db/commands/user_management_commands.cpp index d4b09c365bc..23e9ac4cedf 100644 --- a/src/mongo/db/commands/user_management_commands.cpp +++ b/src/mongo/db/commands/user_management_commands.cpp @@ -68,6 +68,11 @@ namespace mongo { namespace str = mongoutils::str; + using std::endl; + using std::string; + using std::stringstream; + using std::vector; + static void redactPasswordData(mutablebson::Element parent) { namespace mmb = mutablebson; const StringData pwdFieldName("pwd", StringData::LiteralTag()); diff --git a/src/mongo/db/commands/validate.cpp b/src/mongo/db/commands/validate.cpp index 3e6a2dd3af0..51487d34512 100644 --- a/src/mongo/db/commands/validate.cpp +++ b/src/mongo/db/commands/validate.cpp @@ -40,6 +40,10 @@ namespace mongo { + using std::endl; + using std::string; + using std::stringstream; + class ValidateCmd : public Command { public: ValidateCmd() : Command( "validate" ) {} diff --git a/src/mongo/db/commands/write_commands/batch_executor.cpp b/src/mongo/db/commands/write_commands/batch_executor.cpp index b5727d28e7e..0b36db13b54 100644 --- a/src/mongo/db/commands/write_commands/batch_executor.cpp +++ b/src/mongo/db/commands/write_commands/batch_executor.cpp @@ -75,6 +75,10 @@ namespace mongo { using boost::scoped_ptr; + using std::auto_ptr; + using std::endl; + using std::string; + using std::vector; namespace { diff --git a/src/mongo/db/commands/write_commands/write_commands.cpp b/src/mongo/db/commands/write_commands/write_commands.cpp index db3e9e0f6d8..e5b2feeaa90 100644 --- a/src/mongo/db/commands/write_commands/write_commands.cpp +++ b/src/mongo/db/commands/write_commands/write_commands.cpp @@ -51,6 +51,9 @@ namespace mongo { + using std::string; + using std::stringstream; + namespace { MONGO_INITIALIZER(RegisterWriteCommands)(InitializerContext* context) { diff --git a/src/mongo/db/commands/writeback_compatibility_shim.cpp b/src/mongo/db/commands/writeback_compatibility_shim.cpp index 48fe076974b..7441ed5d273 100644 --- a/src/mongo/db/commands/writeback_compatibility_shim.cpp +++ b/src/mongo/db/commands/writeback_compatibility_shim.cpp @@ -44,6 +44,8 @@ namespace mongo { using std::string; + using std::stringstream; + using mongoutils::str::stream; /** diff --git a/src/mongo/db/concurrency/d_concurrency_test.cpp b/src/mongo/db/concurrency/d_concurrency_test.cpp index 34a780b4afa..e449f3c88cd 100644 --- a/src/mongo/db/concurrency/d_concurrency_test.cpp +++ b/src/mongo/db/concurrency/d_concurrency_test.cpp @@ -36,6 +36,8 @@ namespace mongo { + using std::string; + TEST(DConcurrency, GlobalRead) { MMAPV1LockerImpl ls; Lock::GlobalRead globalRead(&ls); diff --git a/src/mongo/db/concurrency/lock_manager.cpp b/src/mongo/db/concurrency/lock_manager.cpp index 01fe903b6e1..b721451ba6d 100644 --- a/src/mongo/db/concurrency/lock_manager.cpp +++ b/src/mongo/db/concurrency/lock_manager.cpp @@ -41,6 +41,9 @@ #include "mongo/util/timer.h" namespace mongo { + + using std::string; + namespace { /** diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp index dc1dda73aa0..3bb42e4d1e7 100644 --- a/src/mongo/db/curop.cpp +++ b/src/mongo/db/curop.cpp @@ -43,6 +43,8 @@ namespace mongo { + using std::string; + // Enabling the maxTimeAlwaysTimeOut fail point will cause any query or command run with a valid // non-zero max time to fail immediately. Any getmore operation on a cursor already created // with a valid non-zero max time will also fail immediately. diff --git a/src/mongo/db/currentop_command.cpp b/src/mongo/db/currentop_command.cpp index 0ff88ae479c..1dd1b784201 100644 --- a/src/mongo/db/currentop_command.cpp +++ b/src/mongo/db/currentop_command.cpp @@ -46,6 +46,8 @@ namespace mongo { + using std::stringstream; + void inProgCmd(OperationContext* txn, Message &message, DbResponse &dbresponse) { DbMessage d(message); QueryMessage q(d); diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp index 10139e33a45..3911ddecbef 100644 --- a/src/mongo/db/db.cpp +++ b/src/mongo/db/db.cpp @@ -118,6 +118,15 @@ namespace mongo { + using std::auto_ptr; + using std::cout; + using std::cerr; + using std::endl; + using std::list; + using std::string; + using std::stringstream; + using std::vector; + using logger::LogComponent; void (*snmpInit)() = NULL; @@ -734,7 +743,7 @@ static void startupConfigActions(const std::vector<std::string>& args) { string procPath; if (!failed){ try { - ifstream f (name.c_str()); + std::ifstream f (name.c_str()); f >> pid; procPath = (str::stream() << "/proc/" << pid); if (!boost::filesystem::exists(procPath)) diff --git a/src/mongo/db/dbcommands.cpp b/src/mongo/db/dbcommands.cpp index fcf2acb90cf..aaf368c2729 100644 --- a/src/mongo/db/dbcommands.cpp +++ b/src/mongo/db/dbcommands.cpp @@ -88,7 +88,11 @@ namespace mongo { using boost::scoped_ptr; + using std::auto_ptr; + using std::endl; + using std::ostringstream; using std::string; + using std::stringstream; CmdShutdown cmdShutdown; diff --git a/src/mongo/db/dbcommands_generic.cpp b/src/mongo/db/dbcommands_generic.cpp index 4f2251dd061..4e3a4e0b06c 100644 --- a/src/mongo/db/dbcommands_generic.cpp +++ b/src/mongo/db/dbcommands_generic.cpp @@ -68,6 +68,11 @@ namespace mongo { + using std::endl; + using std::string; + using std::stringstream; + using std::vector; + #if 0 namespace cloud { SimpleMutex mtx("cloud"); diff --git a/src/mongo/db/dbdirectclient.cpp b/src/mongo/db/dbdirectclient.cpp index 9d683ed176e..b0d673b5de1 100644 --- a/src/mongo/db/dbdirectclient.cpp +++ b/src/mongo/db/dbdirectclient.cpp @@ -37,6 +37,10 @@ namespace mongo { + using std::auto_ptr; + using std::endl; + using std::string; + // Called from scripting/engine.cpp and scripting/v8_db.cpp. DBClientBase* createDirectClient(OperationContext* txn) { return new DBDirectClient(txn); diff --git a/src/mongo/db/dbeval.cpp b/src/mongo/db/dbeval.cpp index 711b2df7777..6aafa0f9079 100644 --- a/src/mongo/db/dbeval.cpp +++ b/src/mongo/db/dbeval.cpp @@ -49,6 +49,10 @@ namespace mongo { using boost::scoped_ptr; + using std::dec; + using std::endl; + using std::string; + using std::stringstream; const int edebug=0; diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp index 4bf272478ad..2d211d94eae 100644 --- a/src/mongo/db/dbhelpers.cpp +++ b/src/mongo/db/dbhelpers.cpp @@ -66,6 +66,14 @@ namespace mongo { + using std::auto_ptr; + using std::endl; + using std::ios_base; + using std::ofstream; + using std::set; + using std::string; + using std::stringstream; + using logger::LogComponent; const BSONObj reverseNaturalObj = BSON( "$natural" << -1 ); diff --git a/src/mongo/db/dbmessage.cpp b/src/mongo/db/dbmessage.cpp index 54c4edab7af..bf38e1a94e5 100644 --- a/src/mongo/db/dbmessage.cpp +++ b/src/mongo/db/dbmessage.cpp @@ -36,6 +36,9 @@ namespace mongo { + using std::string; + using std::stringstream; + string Message::toString() const { stringstream ss; ss << "op: " << opToString( operation() ) << " len: " << size(); diff --git a/src/mongo/db/dbwebserver.cpp b/src/mongo/db/dbwebserver.cpp index d2ce63e9c40..5f4dc6b7426 100644 --- a/src/mongo/db/dbwebserver.cpp +++ b/src/mongo/db/dbwebserver.cpp @@ -65,6 +65,10 @@ namespace mongo { + using std::map; + using std::stringstream; + using std::vector; + using namespace html; struct Timing { diff --git a/src/mongo/db/driverHelpers.cpp b/src/mongo/db/driverHelpers.cpp index 24f133686dd..9c3046a57f3 100644 --- a/src/mongo/db/driverHelpers.cpp +++ b/src/mongo/db/driverHelpers.cpp @@ -53,6 +53,8 @@ namespace mongo { + using std::string; + class BasicDriverHelper : public Command { public: BasicDriverHelper( const char * name ) : Command( name ) {} diff --git a/src/mongo/db/exec/and_hash.cpp b/src/mongo/db/exec/and_hash.cpp index 8c8ef9e2980..10271666d47 100644 --- a/src/mongo/db/exec/and_hash.cpp +++ b/src/mongo/db/exec/and_hash.cpp @@ -46,6 +46,7 @@ namespace { namespace mongo { using std::auto_ptr; + using std::vector; const size_t AndHashStage::kLookAheadWorks = 10; diff --git a/src/mongo/db/exec/and_sorted.cpp b/src/mongo/db/exec/and_sorted.cpp index 362a12fdbab..5641f52a048 100644 --- a/src/mongo/db/exec/and_sorted.cpp +++ b/src/mongo/db/exec/and_sorted.cpp @@ -36,6 +36,10 @@ namespace mongo { + using std::auto_ptr; + using std::numeric_limits; + using std::vector; + // static const char* AndSortedStage::kStageType = "AND_SORTED"; diff --git a/src/mongo/db/exec/cached_plan.cpp b/src/mongo/db/exec/cached_plan.cpp index 1996fab826a..f4e026f740c 100644 --- a/src/mongo/db/exec/cached_plan.cpp +++ b/src/mongo/db/exec/cached_plan.cpp @@ -41,6 +41,9 @@ namespace mongo { + using std::auto_ptr; + using std::vector; + // static const char* CachedPlanStage::kStageType = "CACHED_PLAN"; diff --git a/src/mongo/db/exec/collection_scan.cpp b/src/mongo/db/exec/collection_scan.cpp index 088fa9fab75..ac708ca13b7 100644 --- a/src/mongo/db/exec/collection_scan.cpp +++ b/src/mongo/db/exec/collection_scan.cpp @@ -44,6 +44,9 @@ namespace mongo { + using std::auto_ptr; + using std::vector; + // static const char* CollectionScan::kStageType = "COLLSCAN"; diff --git a/src/mongo/db/exec/count.cpp b/src/mongo/db/exec/count.cpp index cc31f30898b..a6bd76382d4 100644 --- a/src/mongo/db/exec/count.cpp +++ b/src/mongo/db/exec/count.cpp @@ -36,6 +36,9 @@ namespace mongo { + using std::auto_ptr; + using std::vector; + // static const char* CountStage::kStageType = "COUNT"; diff --git a/src/mongo/db/exec/count_scan.cpp b/src/mongo/db/exec/count_scan.cpp index 00fa2da47e9..355534fe29b 100644 --- a/src/mongo/db/exec/count_scan.cpp +++ b/src/mongo/db/exec/count_scan.cpp @@ -34,6 +34,9 @@ namespace mongo { + using std::auto_ptr; + using std::vector; + // static const char* CountScan::kStageType = "COUNT_SCAN"; diff --git a/src/mongo/db/exec/delete.cpp b/src/mongo/db/exec/delete.cpp index 085ba16c10b..232edd27416 100644 --- a/src/mongo/db/exec/delete.cpp +++ b/src/mongo/db/exec/delete.cpp @@ -41,6 +41,9 @@ namespace mongo { + using std::auto_ptr; + using std::vector; + // static const char* DeleteStage::kStageType = "DELETE"; diff --git a/src/mongo/db/exec/distinct_scan.cpp b/src/mongo/db/exec/distinct_scan.cpp index 93fefed5c16..a0b4e4e0271 100644 --- a/src/mongo/db/exec/distinct_scan.cpp +++ b/src/mongo/db/exec/distinct_scan.cpp @@ -37,6 +37,9 @@ namespace mongo { + using std::auto_ptr; + using std::vector; + // static const char* DistinctScan::kStageType = "DISTINCT"; diff --git a/src/mongo/db/exec/eof.cpp b/src/mongo/db/exec/eof.cpp index c21e6cf6668..3b9b3528b2f 100644 --- a/src/mongo/db/exec/eof.cpp +++ b/src/mongo/db/exec/eof.cpp @@ -34,6 +34,8 @@ namespace mongo { + using std::vector; + // static const char* EOFStage::kStageType = "EOF"; diff --git a/src/mongo/db/exec/fetch.cpp b/src/mongo/db/exec/fetch.cpp index f6e0dd7094b..ac0cb291ab7 100644 --- a/src/mongo/db/exec/fetch.cpp +++ b/src/mongo/db/exec/fetch.cpp @@ -38,6 +38,9 @@ namespace mongo { + using std::auto_ptr; + using std::vector; + // static const char* FetchStage::kStageType = "FETCH"; diff --git a/src/mongo/db/exec/geo_near.cpp b/src/mongo/db/exec/geo_near.cpp index 29ed167bd2d..f45fa051d08 100644 --- a/src/mongo/db/exec/geo_near.cpp +++ b/src/mongo/db/exec/geo_near.cpp @@ -1,3 +1,4 @@ + /** * Copyright (C) 2014 10gen Inc. * @@ -52,6 +53,8 @@ namespace mongo { using boost::scoped_ptr; + using std::abs; + using std::auto_ptr; // // Shared GeoNear search functionality diff --git a/src/mongo/db/exec/group.cpp b/src/mongo/db/exec/group.cpp index 1a7d5b174ac..c6f8c1267b7 100644 --- a/src/mongo/db/exec/group.cpp +++ b/src/mongo/db/exec/group.cpp @@ -38,6 +38,9 @@ namespace mongo { + using std::auto_ptr; + using std::vector; + namespace { // Helper function that extracts the group key from a BSONObj. diff --git a/src/mongo/db/exec/idhack.cpp b/src/mongo/db/exec/idhack.cpp index f3d97f16527..ff3e02b6187 100644 --- a/src/mongo/db/exec/idhack.cpp +++ b/src/mongo/db/exec/idhack.cpp @@ -41,6 +41,9 @@ namespace mongo { + using std::auto_ptr; + using std::vector; + // static const char* IDHackStage::kStageType = "IDHACK"; diff --git a/src/mongo/db/exec/index_scan.cpp b/src/mongo/db/exec/index_scan.cpp index 2a8ab64305b..4bcfaecd115 100644 --- a/src/mongo/db/exec/index_scan.cpp +++ b/src/mongo/db/exec/index_scan.cpp @@ -51,6 +51,9 @@ namespace { namespace mongo { + using std::auto_ptr; + using std::vector; + // static const char* IndexScan::kStageType = "IXSCAN"; diff --git a/src/mongo/db/exec/keep_mutations.cpp b/src/mongo/db/exec/keep_mutations.cpp index c35793c4300..adc1c69e5a4 100644 --- a/src/mongo/db/exec/keep_mutations.cpp +++ b/src/mongo/db/exec/keep_mutations.cpp @@ -33,6 +33,9 @@ namespace mongo { + using std::auto_ptr; + using std::vector; + // static const char* KeepMutationsStage::kStageType = "KEEP_MUTATIONS"; diff --git a/src/mongo/db/exec/limit.cpp b/src/mongo/db/exec/limit.cpp index 0d0dfcb596a..a098206f8db 100644 --- a/src/mongo/db/exec/limit.cpp +++ b/src/mongo/db/exec/limit.cpp @@ -34,6 +34,9 @@ namespace mongo { + using std::auto_ptr; + using std::vector; + // static const char* LimitStage::kStageType = "LIMIT"; diff --git a/src/mongo/db/exec/merge_sort.cpp b/src/mongo/db/exec/merge_sort.cpp index f6e0e735a08..aaf0b9ac962 100644 --- a/src/mongo/db/exec/merge_sort.cpp +++ b/src/mongo/db/exec/merge_sort.cpp @@ -35,6 +35,11 @@ namespace mongo { + using std::auto_ptr; + using std::list; + using std::string; + using std::vector; + // static const char* MergeSortStage::kStageType = "SORT_MERGE"; diff --git a/src/mongo/db/exec/multi_iterator.cpp b/src/mongo/db/exec/multi_iterator.cpp index 676f64f7e92..20f2c3a734b 100644 --- a/src/mongo/db/exec/multi_iterator.cpp +++ b/src/mongo/db/exec/multi_iterator.cpp @@ -35,6 +35,8 @@ namespace mongo { + using std::vector; + MultiIteratorStage::MultiIteratorStage(OperationContext* txn, WorkingSet* ws, Collection* collection) diff --git a/src/mongo/db/exec/multi_plan.cpp b/src/mongo/db/exec/multi_plan.cpp index 1cd5ead1ca0..384469a137b 100644 --- a/src/mongo/db/exec/multi_plan.cpp +++ b/src/mongo/db/exec/multi_plan.cpp @@ -51,6 +51,11 @@ namespace mongo { + using std::auto_ptr; + using std::endl; + using std::list; + using std::vector; + // static const char* MultiPlanStage::kStageType = "MULTI_PLAN"; diff --git a/src/mongo/db/exec/near.cpp b/src/mongo/db/exec/near.cpp index 9c0e8d43ec6..cb10955e4ec 100644 --- a/src/mongo/db/exec/near.cpp +++ b/src/mongo/db/exec/near.cpp @@ -36,6 +36,8 @@ namespace mongo { + using std::vector; + NearStage::NearStage(OperationContext* txn, WorkingSet* workingSet, Collection* collection, @@ -234,7 +236,7 @@ namespace mongo { // Store the member's RecordId, if available, for quick invalidation if (nextMember->hasLoc()) { - _nextIntervalSeen.insert(make_pair(nextMember->loc, nextMemberID)); + _nextIntervalSeen.insert(std::make_pair(nextMember->loc, nextMemberID)); } if (!distanceStatus.isOK()) { diff --git a/src/mongo/db/exec/oplogstart.cpp b/src/mongo/db/exec/oplogstart.cpp index 1edc3bc2b94..5d4a3296f92 100644 --- a/src/mongo/db/exec/oplogstart.cpp +++ b/src/mongo/db/exec/oplogstart.cpp @@ -34,6 +34,8 @@ namespace mongo { + using std::vector; + // Does not take ownership. OplogStart::OplogStart(OperationContext* txn, const Collection* collection, diff --git a/src/mongo/db/exec/or.cpp b/src/mongo/db/exec/or.cpp index 91364d9807e..b9c1c8f3170 100644 --- a/src/mongo/db/exec/or.cpp +++ b/src/mongo/db/exec/or.cpp @@ -35,6 +35,9 @@ namespace mongo { + using std::auto_ptr; + using std::vector; + // static const char* OrStage::kStageType = "OR"; diff --git a/src/mongo/db/exec/pipeline_proxy.cpp b/src/mongo/db/exec/pipeline_proxy.cpp index ca97e7a962b..5369429cd07 100644 --- a/src/mongo/db/exec/pipeline_proxy.cpp +++ b/src/mongo/db/exec/pipeline_proxy.cpp @@ -39,6 +39,7 @@ namespace mongo { using boost::intrusive_ptr; using boost::shared_ptr; + using std::vector; PipelineProxyStage::PipelineProxyStage(intrusive_ptr<Pipeline> pipeline, const boost::shared_ptr<PlanExecutor>& child, diff --git a/src/mongo/db/exec/projection.cpp b/src/mongo/db/exec/projection.cpp index 9d13644f1a7..8043c1546a0 100644 --- a/src/mongo/db/exec/projection.cpp +++ b/src/mongo/db/exec/projection.cpp @@ -41,6 +41,10 @@ namespace mongo { + using std::auto_ptr; + using std::endl; + using std::vector; + static const char* kIdField = "_id"; // static diff --git a/src/mongo/db/exec/projection_exec.cpp b/src/mongo/db/exec/projection_exec.cpp index 6a66ccfa1ee..8ae16dc515d 100644 --- a/src/mongo/db/exec/projection_exec.cpp +++ b/src/mongo/db/exec/projection_exec.cpp @@ -36,6 +36,9 @@ namespace mongo { + using std::max; + using std::string; + ProjectionExec::ProjectionExec() : _include(true), _special(false), diff --git a/src/mongo/db/exec/queued_data_stage.cpp b/src/mongo/db/exec/queued_data_stage.cpp index 3d3ab327601..1e40b87d21a 100644 --- a/src/mongo/db/exec/queued_data_stage.cpp +++ b/src/mongo/db/exec/queued_data_stage.cpp @@ -33,6 +33,9 @@ namespace mongo { + using std::auto_ptr; + using std::vector; + const char* QueuedDataStage::kStageType = "QUEUED_DATA"; QueuedDataStage::QueuedDataStage(WorkingSet* ws) diff --git a/src/mongo/db/exec/queued_data_stage_test.cpp b/src/mongo/db/exec/queued_data_stage_test.cpp index 98d74ce894c..26bc5962a8a 100644 --- a/src/mongo/db/exec/queued_data_stage_test.cpp +++ b/src/mongo/db/exec/queued_data_stage_test.cpp @@ -38,6 +38,8 @@ using namespace mongo; namespace { + using std::auto_ptr; + // // Basic test that we get out valid stats objects. // diff --git a/src/mongo/db/exec/shard_filter.cpp b/src/mongo/db/exec/shard_filter.cpp index d5344af6dc2..60d31990be0 100644 --- a/src/mongo/db/exec/shard_filter.cpp +++ b/src/mongo/db/exec/shard_filter.cpp @@ -38,6 +38,9 @@ namespace mongo { + using std::auto_ptr; + using std::vector; + // static const char* ShardFilterStage::kStageType = "SHARDING_FILTER"; diff --git a/src/mongo/db/exec/skip.cpp b/src/mongo/db/exec/skip.cpp index 34d4e07c9f3..f20f4a90935 100644 --- a/src/mongo/db/exec/skip.cpp +++ b/src/mongo/db/exec/skip.cpp @@ -33,6 +33,9 @@ namespace mongo { + using std::auto_ptr; + using std::vector; + // static const char* SkipStage::kStageType = "SKIP"; diff --git a/src/mongo/db/exec/sort.cpp b/src/mongo/db/exec/sort.cpp index aaa2b852206..3ccafbdb318 100644 --- a/src/mongo/db/exec/sort.cpp +++ b/src/mongo/db/exec/sort.cpp @@ -43,6 +43,8 @@ namespace mongo { + using std::auto_ptr; + using std::endl; using std::vector; // static diff --git a/src/mongo/db/exec/stagedebug_cmd.cpp b/src/mongo/db/exec/stagedebug_cmd.cpp index fb0ea1619d4..d93a4637a41 100644 --- a/src/mongo/db/exec/stagedebug_cmd.cpp +++ b/src/mongo/db/exec/stagedebug_cmd.cpp @@ -51,6 +51,10 @@ namespace mongo { + using std::auto_ptr; + using std::string; + using std::vector; + /** * A command for manually constructing a query tree and running it. * diff --git a/src/mongo/db/exec/subplan.cpp b/src/mongo/db/exec/subplan.cpp index e436fe8e01a..ec155e3bdb8 100644 --- a/src/mongo/db/exec/subplan.cpp +++ b/src/mongo/db/exec/subplan.cpp @@ -43,6 +43,10 @@ namespace mongo { + using std::auto_ptr; + using std::endl; + using std::vector; + // static const char* SubplanStage::kStageType = "SUBPLAN"; diff --git a/src/mongo/db/exec/text.cpp b/src/mongo/db/exec/text.cpp index 95053c8c8da..ee1c733f955 100644 --- a/src/mongo/db/exec/text.cpp +++ b/src/mongo/db/exec/text.cpp @@ -39,6 +39,10 @@ namespace mongo { + using std::auto_ptr; + using std::string; + using std::vector; + // static const char* TextStage::kStageType = "TEXT"; diff --git a/src/mongo/db/exec/update.cpp b/src/mongo/db/exec/update.cpp index 016fe231ecd..96f23972ffe 100644 --- a/src/mongo/db/exec/update.cpp +++ b/src/mongo/db/exec/update.cpp @@ -44,6 +44,10 @@ namespace mongo { + using std::auto_ptr; + using std::string; + using std::vector; + namespace mb = mutablebson; namespace { diff --git a/src/mongo/db/exec/working_set.cpp b/src/mongo/db/exec/working_set.cpp index 6fd3a37a0b6..c35b39d7c94 100644 --- a/src/mongo/db/exec/working_set.cpp +++ b/src/mongo/db/exec/working_set.cpp @@ -33,6 +33,8 @@ namespace mongo { + using std::string; + WorkingSet::MemberHolder::MemberHolder() : member(NULL) { } WorkingSet::MemberHolder::~MemberHolder() {} diff --git a/src/mongo/db/exec/working_set_test.cpp b/src/mongo/db/exec/working_set_test.cpp index 120e74a89ab..c2c7f88a474 100644 --- a/src/mongo/db/exec/working_set_test.cpp +++ b/src/mongo/db/exec/working_set_test.cpp @@ -42,6 +42,8 @@ using namespace mongo; namespace { + using std::string; + class WorkingSetFixture : public mongo::unittest::Test { protected: void setUp() { diff --git a/src/mongo/db/field_parser.cpp b/src/mongo/db/field_parser.cpp index 47b5b8cf1c0..a53714afadb 100644 --- a/src/mongo/db/field_parser.cpp +++ b/src/mongo/db/field_parser.cpp @@ -31,6 +31,7 @@ namespace mongo { + using std::string; using mongoutils::str::stream; FieldParser::FieldState FieldParser::extract( BSONObj doc, diff --git a/src/mongo/db/fts/fts_element_iterator.cpp b/src/mongo/db/fts/fts_element_iterator.cpp index 477822371a4..f57e1097c14 100644 --- a/src/mongo/db/fts/fts_element_iterator.cpp +++ b/src/mongo/db/fts/fts_element_iterator.cpp @@ -39,6 +39,8 @@ namespace mongo { namespace fts { + using std::string; + extern const double DEFAULT_WEIGHT; extern const double MAX_WEIGHT; diff --git a/src/mongo/db/fts/fts_element_iterator_test.cpp b/src/mongo/db/fts/fts_element_iterator_test.cpp index 5666084c2e1..312f9e783d7 100644 --- a/src/mongo/db/fts/fts_element_iterator_test.cpp +++ b/src/mongo/db/fts/fts_element_iterator_test.cpp @@ -39,6 +39,8 @@ namespace mongo { namespace fts { + using std::string; + TEST( FTSElementIterator, Test1 ) { BSONObj obj = fromjson( diff --git a/src/mongo/db/fts/fts_index_format.cpp b/src/mongo/db/fts/fts_index_format.cpp index 09519005292..871f4e29d03 100644 --- a/src/mongo/db/fts/fts_index_format.cpp +++ b/src/mongo/db/fts/fts_index_format.cpp @@ -44,6 +44,9 @@ namespace mongo { namespace fts { + using std::string; + using std::vector; + namespace { BSONObj nullObj; BSONElement nullElt; diff --git a/src/mongo/db/fts/fts_matcher.cpp b/src/mongo/db/fts/fts_matcher.cpp index 1497bc41af4..e079c057a8e 100644 --- a/src/mongo/db/fts/fts_matcher.cpp +++ b/src/mongo/db/fts/fts_matcher.cpp @@ -41,6 +41,8 @@ namespace mongo { namespace fts { + using std::string; + FTSMatcher::FTSMatcher( const FTSQuery& query, const FTSSpec& spec ) : _query( query ), _spec( spec ) { diff --git a/src/mongo/db/fts/fts_query.cpp b/src/mongo/db/fts/fts_query.cpp index c1378a0dd72..29034e3753e 100644 --- a/src/mongo/db/fts/fts_query.cpp +++ b/src/mongo/db/fts/fts_query.cpp @@ -45,6 +45,11 @@ namespace mongo { using namespace mongoutils; + using std::set; + using std::string; + using std::stringstream; + using std::vector; + Status FTSQuery::parse(const string& query, const StringData& language, TextIndexVersion textIndexVersion) { _search = query; diff --git a/src/mongo/db/fts/fts_query.h b/src/mongo/db/fts/fts_query.h index 4a0ca4735ce..0bee769172c 100644 --- a/src/mongo/db/fts/fts_query.h +++ b/src/mongo/db/fts/fts_query.h @@ -42,10 +42,6 @@ namespace mongo { namespace fts { - using std::string; - using std::vector; - using std::set; - class FTSQuery { public: diff --git a/src/mongo/db/fts/fts_spec.cpp b/src/mongo/db/fts/fts_spec.cpp index e02674d6bd0..3e0cb344128 100644 --- a/src/mongo/db/fts/fts_spec.cpp +++ b/src/mongo/db/fts/fts_spec.cpp @@ -44,6 +44,8 @@ namespace mongo { namespace fts { + using std::map; + using std::string; using namespace mongoutils; const double DEFAULT_WEIGHT = 1; diff --git a/src/mongo/db/fts/fts_spec_legacy.cpp b/src/mongo/db/fts/fts_spec_legacy.cpp index 556cac1e091..5f958f97b38 100644 --- a/src/mongo/db/fts/fts_spec_legacy.cpp +++ b/src/mongo/db/fts/fts_spec_legacy.cpp @@ -39,6 +39,8 @@ namespace mongo { // text indexes. // + using std::map; + using std::string; using namespace mongoutils; namespace { diff --git a/src/mongo/db/fts/fts_spec_test.cpp b/src/mongo/db/fts/fts_spec_test.cpp index d69c39951b3..aa0d659ed4b 100644 --- a/src/mongo/db/fts/fts_spec_test.cpp +++ b/src/mongo/db/fts/fts_spec_test.cpp @@ -38,6 +38,10 @@ #include "mongo/unittest/unittest.h" namespace mongo { + + using std::set; + using std::string; + namespace fts { /** diff --git a/src/mongo/db/fts/stemmer.cpp b/src/mongo/db/fts/stemmer.cpp index a86cfda8015..dd260f92305 100644 --- a/src/mongo/db/fts/stemmer.cpp +++ b/src/mongo/db/fts/stemmer.cpp @@ -38,6 +38,8 @@ namespace mongo { namespace fts { + using std::string; + Stemmer::Stemmer( const FTSLanguage& language ) { _stemmer = NULL; if ( language.str() != "none" ) diff --git a/src/mongo/db/geo/geoparser.cpp b/src/mongo/db/geo/geoparser.cpp index ce385a051f5..12fee4b7917 100644 --- a/src/mongo/db/geo/geoparser.cpp +++ b/src/mongo/db/geo/geoparser.cpp @@ -43,6 +43,9 @@ namespace mongo { + using std::auto_ptr; + using std::stringstream; + // This field must be present, and... static const string GEOJSON_TYPE = "type"; // Have one of these values: diff --git a/src/mongo/db/geo/hash.cpp b/src/mongo/db/geo/hash.cpp index 53d56f84fa5..318a1cfdcab 100644 --- a/src/mongo/db/geo/hash.cpp +++ b/src/mongo/db/geo/hash.cpp @@ -40,6 +40,8 @@ using namespace mongoutils; namespace mongo { + using std::stringstream; + std::ostream& operator<<(std::ostream &s, const GeoHash &h) { return s << h.toString(); } @@ -242,7 +244,7 @@ namespace mongo { string GeoHash::toStringHex1() const { stringstream ss; - ss << hex << _hash; + ss << std::hex << _hash; return ss.str(); } diff --git a/src/mongo/db/geo/haystack.cpp b/src/mongo/db/geo/haystack.cpp index 6d416721530..cf2c218fa35 100644 --- a/src/mongo/db/geo/haystack.cpp +++ b/src/mongo/db/geo/haystack.cpp @@ -51,6 +51,9 @@ */ namespace mongo { + using std::string; + using std::vector; + class GeoHaystackSearchCommand : public Command { public: GeoHaystackSearchCommand() : Command("geoSearch") {} diff --git a/src/mongo/db/geo/r2_region_coverer.cpp b/src/mongo/db/geo/r2_region_coverer.cpp index 6af5df2c507..c5ee989f85e 100644 --- a/src/mongo/db/geo/r2_region_coverer.cpp +++ b/src/mongo/db/geo/r2_region_coverer.cpp @@ -36,6 +36,8 @@ namespace mongo { + using std::less; + // Definition int const R2RegionCoverer::kDefaultMaxCells = 8; diff --git a/src/mongo/db/geo/r2_region_coverer_test.cpp b/src/mongo/db/geo/r2_region_coverer_test.cpp index 5f61d40357a..470d6208e37 100644 --- a/src/mongo/db/geo/r2_region_coverer_test.cpp +++ b/src/mongo/db/geo/r2_region_coverer_test.cpp @@ -38,6 +38,7 @@ namespace { + using std::auto_ptr; using namespace mongo; using mongo::Polygon; // "windows.h" has another Polygon for Windows GDI. diff --git a/src/mongo/db/geo/shapes.cpp b/src/mongo/db/geo/shapes.cpp index 562e35a46fc..d87cb9334ce 100644 --- a/src/mongo/db/geo/shapes.cpp +++ b/src/mongo/db/geo/shapes.cpp @@ -30,6 +30,8 @@ #include "mongo/db/geo/shapes.h" #include "mongo/util/mongoutils/str.h" +using std::abs; + // So we can get at the str namespace. using namespace mongoutils; diff --git a/src/mongo/db/index/btree_access_method.cpp b/src/mongo/db/index/btree_access_method.cpp index 1002903b921..dcd40fe386c 100644 --- a/src/mongo/db/index/btree_access_method.cpp +++ b/src/mongo/db/index/btree_access_method.cpp @@ -37,6 +37,8 @@ namespace mongo { + using std::vector; + // Standard Btree implementation below. BtreeAccessMethod::BtreeAccessMethod(IndexCatalogEntry* btreeState, SortedDataInterface* btree ) : BtreeBasedAccessMethod(btreeState, btree) { diff --git a/src/mongo/db/index/btree_based_access_method.cpp b/src/mongo/db/index/btree_based_access_method.cpp index 78762b607fa..e94208462ac 100644 --- a/src/mongo/db/index/btree_based_access_method.cpp +++ b/src/mongo/db/index/btree_based_access_method.cpp @@ -47,6 +47,10 @@ namespace mongo { + using std::endl; + using std::set; + using std::vector; + MONGO_EXPORT_SERVER_PARAMETER(failIndexKeyTooLong, bool, true); BtreeBasedAccessMethod::BtreeBasedAccessMethod(IndexCatalogEntry* btreeState, diff --git a/src/mongo/db/index/btree_based_bulk_access_method.cpp b/src/mongo/db/index/btree_based_bulk_access_method.cpp index 073db4c1d92..12fcd1bfbd2 100644 --- a/src/mongo/db/index/btree_based_bulk_access_method.cpp +++ b/src/mongo/db/index/btree_based_bulk_access_method.cpp @@ -43,6 +43,7 @@ namespace mongo { using boost::scoped_ptr; + using std::set; // // Comparison for external sorter interface diff --git a/src/mongo/db/index/btree_index_cursor.cpp b/src/mongo/db/index/btree_index_cursor.cpp index 32bad4caed9..ed8d1935826 100644 --- a/src/mongo/db/index/btree_index_cursor.cpp +++ b/src/mongo/db/index/btree_index_cursor.cpp @@ -39,6 +39,9 @@ namespace mongo { + using std::string; + using std::vector; + BtreeIndexCursor::BtreeIndexCursor(SortedDataInterface::Cursor* cursor) : _cursor(cursor) { } bool BtreeIndexCursor::isEOF() const { return _cursor->isEOF(); } diff --git a/src/mongo/db/index/btree_key_generator.cpp b/src/mongo/db/index/btree_key_generator.cpp index 6049b588fcf..464c39dd486 100644 --- a/src/mongo/db/index/btree_key_generator.cpp +++ b/src/mongo/db/index/btree_key_generator.cpp @@ -31,6 +31,11 @@ namespace mongo { + using std::set; + using std::string; + using std::stringstream; + using std::vector; + // Used in scanandorder.cpp to inforatively error when we try to sort keys with parallel arrays. const int BtreeKeyGenerator::ParallelArraysCode = 10088; diff --git a/src/mongo/db/index/btree_key_generator_test.cpp b/src/mongo/db/index/btree_key_generator_test.cpp index 8b162eca82d..a3e6b582f16 100644 --- a/src/mongo/db/index/btree_key_generator_test.cpp +++ b/src/mongo/db/index/btree_key_generator_test.cpp @@ -36,6 +36,9 @@ using namespace mongo; using boost::scoped_ptr; +using std::cout; +using std::endl; +using std::vector; namespace { diff --git a/src/mongo/db/index_builder.cpp b/src/mongo/db/index_builder.cpp index 95413374f4b..3b03a2270a9 100644 --- a/src/mongo/db/index_builder.cpp +++ b/src/mongo/db/index_builder.cpp @@ -45,6 +45,8 @@ namespace mongo { + using std::endl; + AtomicUInt32 IndexBuilder::_indexBuildCount; namespace { diff --git a/src/mongo/db/index_names.cpp b/src/mongo/db/index_names.cpp index d3f79886e36..6f0b3f095ab 100644 --- a/src/mongo/db/index_names.cpp +++ b/src/mongo/db/index_names.cpp @@ -32,6 +32,8 @@ namespace mongo { + using std::string; + const string IndexNames::GEO_2D = "2d"; const string IndexNames::GEO_HAYSTACK = "geoHaystack"; const string IndexNames::GEO_2DSPHERE = "2dsphere"; diff --git a/src/mongo/db/index_names.h b/src/mongo/db/index_names.h index 728906ed701..817fce2dcf6 100644 --- a/src/mongo/db/index_names.h +++ b/src/mongo/db/index_names.h @@ -32,8 +32,6 @@ namespace mongo { - using std::string; - class BSONObj; /** diff --git a/src/mongo/db/index_rebuilder.cpp b/src/mongo/db/index_rebuilder.cpp index 3c8e93bdb79..8c741066979 100644 --- a/src/mongo/db/index_rebuilder.cpp +++ b/src/mongo/db/index_rebuilder.cpp @@ -51,6 +51,10 @@ namespace mongo { + using std::endl; + using std::string; + using std::vector; + namespace { void checkNS(OperationContext* txn, const std::list<std::string>& nsToCheck) { bool firstTime = true; diff --git a/src/mongo/db/initialize_server_global_state.cpp b/src/mongo/db/initialize_server_global_state.cpp index 3b7716ceb83..7dab5365d40 100644 --- a/src/mongo/db/initialize_server_global_state.cpp +++ b/src/mongo/db/initialize_server_global_state.cpp @@ -73,6 +73,10 @@ namespace fs = boost::filesystem; namespace mongo { + using std::cerr; + using std::cout; + using std::endl; + #ifndef _WIN32 // support for exit value propagation with fork void launchSignal( int sig ) { diff --git a/src/mongo/db/instance.cpp b/src/mongo/db/instance.cpp index 125ff0fe362..9fa8426e6ad 100644 --- a/src/mongo/db/instance.cpp +++ b/src/mongo/db/instance.cpp @@ -97,6 +97,14 @@ namespace mongo { using boost::scoped_ptr; using logger::LogComponent; + using std::auto_ptr; + using std::endl; + using std::hex; + using std::ios; + using std::ofstream; + using std::string; + using std::stringstream; + using std::vector; // for diaglog inline void opread(Message& m) { diff --git a/src/mongo/db/introspect.cpp b/src/mongo/db/introspect.cpp index 69389bb6ecf..eb6588c06ef 100644 --- a/src/mongo/db/introspect.cpp +++ b/src/mongo/db/introspect.cpp @@ -52,6 +52,8 @@ namespace mongo { using boost::scoped_ptr; + using std::endl; + using std::string; namespace { void _appendUserInfo(const CurOp& c, diff --git a/src/mongo/db/json.cpp b/src/mongo/db/json.cpp index 2edca737b0b..9f418790ab7 100644 --- a/src/mongo/db/json.cpp +++ b/src/mongo/db/json.cpp @@ -44,6 +44,8 @@ namespace mongo { using boost::scoped_ptr; + using std::ostringstream; + using std::string; #if 0 #define MONGO_JSON_DEBUG(message) log() << "JSON DEBUG @ " << __FILE__\ diff --git a/src/mongo/db/lasterror.cpp b/src/mongo/db/lasterror.cpp index 70dd6ddb10c..5e2d34ed41e 100644 --- a/src/mongo/db/lasterror.cpp +++ b/src/mongo/db/lasterror.cpp @@ -39,6 +39,8 @@ namespace mongo { + using std::endl; + LastError LastError::noError; LastErrorHolder lastError; diff --git a/src/mongo/db/log_process_details.cpp b/src/mongo/db/log_process_details.cpp index e20e726c9c0..d6898ef95e9 100644 --- a/src/mongo/db/log_process_details.cpp +++ b/src/mongo/db/log_process_details.cpp @@ -45,6 +45,9 @@ namespace mongo { + using std::cout; + using std::endl; + bool is32bit() { return ( sizeof(int*) == 4 ); } diff --git a/src/mongo/db/matcher/expression.cpp b/src/mongo/db/matcher/expression.cpp index 098c049c6e8..e4778bb75d9 100644 --- a/src/mongo/db/matcher/expression.cpp +++ b/src/mongo/db/matcher/expression.cpp @@ -36,6 +36,8 @@ namespace mongo { + using std::string; + MatchExpression::MatchExpression( MatchType type ) : _matchType( type ) { } diff --git a/src/mongo/db/matcher/expression_array_test.cpp b/src/mongo/db/matcher/expression_array_test.cpp index 626ac72409e..96a89254a34 100644 --- a/src/mongo/db/matcher/expression_array_test.cpp +++ b/src/mongo/db/matcher/expression_array_test.cpp @@ -38,6 +38,8 @@ namespace mongo { + using std::auto_ptr; + TEST( ElemMatchObjectMatchExpression, MatchesElementSingle ) { BSONObj baseOperand = BSON( "b" << 5 ); BSONObj match = BSON( "a" << BSON_ARRAY( BSON( "b" << 5.0 ) ) ); diff --git a/src/mongo/db/matcher/expression_geo_test.cpp b/src/mongo/db/matcher/expression_geo_test.cpp index ab1546e012d..21ec6785b60 100644 --- a/src/mongo/db/matcher/expression_geo_test.cpp +++ b/src/mongo/db/matcher/expression_geo_test.cpp @@ -40,6 +40,8 @@ namespace mongo { + using std::auto_ptr; + TEST( ExpressionGeoTest, Geo1 ) { BSONObj query = fromjson("{loc:{$within:{$box:[{x: 4, y:4},[6,6]]}}}"); diff --git a/src/mongo/db/matcher/expression_leaf_test.cpp b/src/mongo/db/matcher/expression_leaf_test.cpp index b28f3f13713..ed2f7b259d9 100644 --- a/src/mongo/db/matcher/expression_leaf_test.cpp +++ b/src/mongo/db/matcher/expression_leaf_test.cpp @@ -38,6 +38,8 @@ namespace mongo { + using std::string; + TEST( EqOp, MatchesElement ) { BSONObj operand = BSON( "a" << 5 ); BSONObj match = BSON( "a" << 5.0 ); diff --git a/src/mongo/db/matcher/expression_parser.cpp b/src/mongo/db/matcher/expression_parser.cpp index 8c7ac2e588f..40fd48e5ea2 100644 --- a/src/mongo/db/matcher/expression_parser.cpp +++ b/src/mongo/db/matcher/expression_parser.cpp @@ -63,6 +63,8 @@ namespace { namespace mongo { + using std::string; + StatusWithMatchExpression MatchExpressionParser::_parseComparison( const char* name, ComparisonMatchExpression* cmp, const BSONElement& e ) { diff --git a/src/mongo/db/matcher/expression_parser_array_test.cpp b/src/mongo/db/matcher/expression_parser_array_test.cpp index 1d4bdf54ee8..e58bb4683d5 100644 --- a/src/mongo/db/matcher/expression_parser_array_test.cpp +++ b/src/mongo/db/matcher/expression_parser_array_test.cpp @@ -39,6 +39,8 @@ namespace mongo { + using std::string; + TEST( MatchExpressionParserArrayTest, Size1 ) { BSONObj query = BSON( "x" << BSON( "$size" << 2 ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); diff --git a/src/mongo/db/matcher/expression_parser_geo.cpp b/src/mongo/db/matcher/expression_parser_geo.cpp index 346b7a148d4..72145c029b1 100644 --- a/src/mongo/db/matcher/expression_parser_geo.cpp +++ b/src/mongo/db/matcher/expression_parser_geo.cpp @@ -37,6 +37,8 @@ namespace mongo { + using std::auto_ptr; + StatusWithMatchExpression expressionParserGeoCallbackReal( const char* name, int type, const BSONObj& section ) { diff --git a/src/mongo/db/matcher/expression_parser_leaf_test.cpp b/src/mongo/db/matcher/expression_parser_leaf_test.cpp index 507b781fdd9..ad28bfd6641 100644 --- a/src/mongo/db/matcher/expression_parser_leaf_test.cpp +++ b/src/mongo/db/matcher/expression_parser_leaf_test.cpp @@ -42,6 +42,9 @@ namespace mongo { + using std::endl; + using std::string; + TEST( MatchExpressionParserLeafTest, SimpleEQ2 ) { BSONObj query = BSON( "x" << BSON( "$eq" << 2 ) ); StatusWithMatchExpression result = MatchExpressionParser::parse( query ); diff --git a/src/mongo/db/matcher/expression_parser_text.cpp b/src/mongo/db/matcher/expression_parser_text.cpp index 86b16e71130..ad8114c88e8 100644 --- a/src/mongo/db/matcher/expression_parser_text.cpp +++ b/src/mongo/db/matcher/expression_parser_text.cpp @@ -37,6 +37,9 @@ namespace mongo { + using std::auto_ptr; + using std::string; + StatusWithMatchExpression expressionParserTextCallbackReal( const BSONObj& queryObj ) { // Validate queryObj, but defer construction of FTSQuery (which requires access to the // target namespace) until stage building time. diff --git a/src/mongo/db/matcher/expression_text.cpp b/src/mongo/db/matcher/expression_text.cpp index c77217d2d10..760491b97c5 100644 --- a/src/mongo/db/matcher/expression_text.cpp +++ b/src/mongo/db/matcher/expression_text.cpp @@ -36,6 +36,8 @@ namespace mongo { + using std::string; + Status TextMatchExpression::init( const string& query, const string& language ) { _query = query; _language = language; diff --git a/src/mongo/db/matcher/expression_tree_test.cpp b/src/mongo/db/matcher/expression_tree_test.cpp index c0ba4cead87..27516ff4344 100644 --- a/src/mongo/db/matcher/expression_tree_test.cpp +++ b/src/mongo/db/matcher/expression_tree_test.cpp @@ -38,6 +38,8 @@ namespace mongo { + using std::auto_ptr; + TEST( NotMatchExpression, MatchesScalar ) { BSONObj baseOperand = BSON( "$lt" << 5 ); auto_ptr<ComparisonMatchExpression> lt( new LTMatchExpression() ); diff --git a/src/mongo/db/matcher/expression_where.cpp b/src/mongo/db/matcher/expression_where.cpp index f52d5c77f23..01a9e5b0aac 100644 --- a/src/mongo/db/matcher/expression_where.cpp +++ b/src/mongo/db/matcher/expression_where.cpp @@ -42,6 +42,11 @@ namespace mongo { + using std::auto_ptr; + using std::endl; + using std::string; + using std::stringstream; + class WhereMatchExpression : public MatchExpression { public: WhereMatchExpression(OperationContext* txn) diff --git a/src/mongo/db/matcher/expression_where_noop.cpp b/src/mongo/db/matcher/expression_where_noop.cpp index 5347493f12c..af1fed42521 100644 --- a/src/mongo/db/matcher/expression_where_noop.cpp +++ b/src/mongo/db/matcher/expression_where_noop.cpp @@ -38,6 +38,9 @@ namespace mongo { + using std::auto_ptr; + using std::string; + /** * Bogus no-op $where match expression to parse $where in mongos, * since mongos doesn't have script engine to compile JS functions. @@ -117,6 +120,7 @@ namespace mongo { StatusWithMatchExpression WhereCallbackNoop::parseWhere(const BSONElement& where) const { + auto_ptr<WhereNoOpMatchExpression> exp( new WhereNoOpMatchExpression() ); if ( where.type() == String || where.type() == Code ) { Status s = exp->init( where.valuestr() ); diff --git a/src/mongo/db/matcher/match_details.cpp b/src/mongo/db/matcher/match_details.cpp index 1c437129adc..6adcfcdd910 100644 --- a/src/mongo/db/matcher/match_details.cpp +++ b/src/mongo/db/matcher/match_details.cpp @@ -36,6 +36,8 @@ namespace mongo { + using std::string; + MatchDetails::MatchDetails() : _elemMatchKeyRequested() { resetOutput(); diff --git a/src/mongo/db/matcher/path_test.cpp b/src/mongo/db/matcher/path_test.cpp index 3bd3b0f4568..12091c4749c 100644 --- a/src/mongo/db/matcher/path_test.cpp +++ b/src/mongo/db/matcher/path_test.cpp @@ -37,6 +37,8 @@ namespace mongo { + using std::string; + TEST( Path, Root1 ) { ElementPath p; ASSERT( p.init( "a" ).isOK() ); diff --git a/src/mongo/db/mongod_options.cpp b/src/mongo/db/mongod_options.cpp index 09826f6c5ce..3fb50aa61a1 100644 --- a/src/mongo/db/mongod_options.cpp +++ b/src/mongo/db/mongod_options.cpp @@ -56,6 +56,10 @@ namespace mongo { + using std::cout; + using std::endl; + using std::string; + MongodGlobalParams mongodGlobalParams; extern DiagLog _diaglog; diff --git a/src/mongo/db/namespace_string.cpp b/src/mongo/db/namespace_string.cpp index afdb6f70c62..e1c3273d3ce 100644 --- a/src/mongo/db/namespace_string.cpp +++ b/src/mongo/db/namespace_string.cpp @@ -32,6 +32,8 @@ namespace mongo { + using std::string; + bool legalClientSystemNS( const StringData& ns , bool write ) { if( ns == "local.system.replset" ) return true; diff --git a/src/mongo/db/namespace_string_test.cpp b/src/mongo/db/namespace_string_test.cpp index 0a062e28922..64ee9d230ae 100644 --- a/src/mongo/db/namespace_string_test.cpp +++ b/src/mongo/db/namespace_string_test.cpp @@ -33,6 +33,8 @@ namespace mongo { + using std::string; + TEST( NamespaceStringTest, Normal ) { ASSERT( NamespaceString::normal( "a" ) ); ASSERT( NamespaceString::normal( "a.b" ) ); diff --git a/src/mongo/db/operation_context_impl.cpp b/src/mongo/db/operation_context_impl.cpp index d8b4e443b27..5292caee5b5 100644 --- a/src/mongo/db/operation_context_impl.cpp +++ b/src/mongo/db/operation_context_impl.cpp @@ -45,6 +45,8 @@ namespace mongo { + using std::string; + OperationContextImpl::OperationContextImpl() : _client(currentClient.get()), _locker(_client->getLocker()) { diff --git a/src/mongo/db/ops/insert.cpp b/src/mongo/db/ops/insert.cpp index 22613fdaf04..131ebbc67b7 100644 --- a/src/mongo/db/ops/insert.cpp +++ b/src/mongo/db/ops/insert.cpp @@ -34,6 +34,8 @@ namespace mongo { + using std::string; + using namespace mongoutils; StatusWith<BSONObj> fixDocumentForInsert( const BSONObj& doc ) { diff --git a/src/mongo/db/ops/modifier_pull_all.cpp b/src/mongo/db/ops/modifier_pull_all.cpp index 2a3cbb855eb..af595d6cd74 100644 --- a/src/mongo/db/ops/modifier_pull_all.cpp +++ b/src/mongo/db/ops/modifier_pull_all.cpp @@ -38,6 +38,8 @@ namespace mongo { + using std::vector; + namespace mb = mutablebson; namespace str = mongoutils::str; diff --git a/src/mongo/db/ops/modifier_push.cpp b/src/mongo/db/ops/modifier_push.cpp index f7b4d2285be..68b3ae82cff 100644 --- a/src/mongo/db/ops/modifier_push.cpp +++ b/src/mongo/db/ops/modifier_push.cpp @@ -44,6 +44,9 @@ namespace mongo { + using std::abs; + using std::numeric_limits; + namespace mb = mutablebson; namespace str = mongoutils::str; diff --git a/src/mongo/db/ops/modifier_table.cpp b/src/mongo/db/ops/modifier_table.cpp index 31d4095160a..2f4f2bd418d 100644 --- a/src/mongo/db/ops/modifier_table.cpp +++ b/src/mongo/db/ops/modifier_table.cpp @@ -48,6 +48,10 @@ #include "mongo/platform/unordered_map.h" namespace mongo { + + using std::make_pair; + using std::string; + namespace modifiertable { namespace { diff --git a/src/mongo/db/ops/path_support.cpp b/src/mongo/db/ops/path_support.cpp index fa72a4aceae..857a54c4b52 100644 --- a/src/mongo/db/ops/path_support.cpp +++ b/src/mongo/db/ops/path_support.cpp @@ -38,6 +38,7 @@ namespace mongo { namespace pathsupport { + using std::string; using mongoutils::str::stream; namespace { @@ -414,7 +415,7 @@ namespace pathsupport { if (!status.isOK()) return status; - equalities->insert(make_pair(eqChild.path(), &eqChild)); + equalities->insert(std::make_pair(eqChild.path(), &eqChild)); } else if (root.matchType() == MatchExpression::AND) { diff --git a/src/mongo/db/ops/path_support_test.cpp b/src/mongo/db/ops/path_support_test.cpp index 686d4b46094..f65cebabf6d 100644 --- a/src/mongo/db/ops/path_support_test.cpp +++ b/src/mongo/db/ops/path_support_test.cpp @@ -53,6 +53,7 @@ namespace { using namespace mutablebson; using namespace pathsupport; using mongoutils::str::stream; + using std::auto_ptr; using std::string; class EmptyDoc : public mongo::unittest::Test { diff --git a/src/mongo/db/ops/update_driver.cpp b/src/mongo/db/ops/update_driver.cpp index d23a91a38f9..20a25d9c792 100644 --- a/src/mongo/db/ops/update_driver.cpp +++ b/src/mongo/db/ops/update_driver.cpp @@ -49,6 +49,9 @@ namespace mongo { namespace mb = mongo::mutablebson; using boost::scoped_ptr; + using std::auto_ptr; + using std::vector; + using pathsupport::EqualityMatches; UpdateDriver::UpdateDriver(const Options& opts) diff --git a/src/mongo/db/pipeline/accumulator_add_to_set.cpp b/src/mongo/db/pipeline/accumulator_add_to_set.cpp index b4003d17c9a..81ad8e85679 100644 --- a/src/mongo/db/pipeline/accumulator_add_to_set.cpp +++ b/src/mongo/db/pipeline/accumulator_add_to_set.cpp @@ -38,6 +38,7 @@ namespace mongo { using boost::intrusive_ptr; + using std::vector; void AccumulatorAddToSet::processInternal(const Value& input, bool merging) { if (!merging) { diff --git a/src/mongo/db/pipeline/accumulator_push.cpp b/src/mongo/db/pipeline/accumulator_push.cpp index f2a62792252..b474acc940d 100644 --- a/src/mongo/db/pipeline/accumulator_push.cpp +++ b/src/mongo/db/pipeline/accumulator_push.cpp @@ -38,6 +38,7 @@ namespace mongo { using boost::intrusive_ptr; + using std::vector; void AccumulatorPush::processInternal(const Value& input, bool merging) { if (!merging) { diff --git a/src/mongo/db/pipeline/dependencies.cpp b/src/mongo/db/pipeline/dependencies.cpp index 1b48ed2de12..063ac83725d 100644 --- a/src/mongo/db/pipeline/dependencies.cpp +++ b/src/mongo/db/pipeline/dependencies.cpp @@ -37,6 +37,11 @@ #include "mongo/util/mongoutils/str.h" namespace mongo { + + using std::set; + using std::string; + using std::vector; + namespace str = mongoutils::str; BSONObj DepsTracker::toProjection() const { diff --git a/src/mongo/db/pipeline/document.cpp b/src/mongo/db/pipeline/document.cpp index 12315636b4d..432a15f55c8 100644 --- a/src/mongo/db/pipeline/document.cpp +++ b/src/mongo/db/pipeline/document.cpp @@ -43,6 +43,8 @@ namespace mongo { using namespace mongoutils; using boost::intrusive_ptr; + using std::string; + using std::vector; Position DocumentStorage::findField(StringData requested) const { int reqSize = requested.size(); // get size calculation out of the way if needed diff --git a/src/mongo/db/pipeline/document_source.cpp b/src/mongo/db/pipeline/document_source.cpp index 00a2b0a626d..d26cc5b1014 100644 --- a/src/mongo/db/pipeline/document_source.cpp +++ b/src/mongo/db/pipeline/document_source.cpp @@ -38,6 +38,7 @@ namespace mongo { using boost::intrusive_ptr; + using std::vector; DocumentSource::DocumentSource(const intrusive_ptr<ExpressionContext> &pCtx) : pSource(NULL) diff --git a/src/mongo/db/pipeline/document_source_command_shards.cpp b/src/mongo/db/pipeline/document_source_command_shards.cpp index cdabe701d3e..12a12defd29 100644 --- a/src/mongo/db/pipeline/document_source_command_shards.cpp +++ b/src/mongo/db/pipeline/document_source_command_shards.cpp @@ -37,6 +37,7 @@ namespace mongo { using boost::intrusive_ptr; + using std::vector; void DocumentSourceCommandShards::setSource(DocumentSource *pSource) { /* this doesn't take a source */ diff --git a/src/mongo/db/pipeline/document_source_cursor.cpp b/src/mongo/db/pipeline/document_source_cursor.cpp index 5c17b373a01..c2cd4ddb539 100644 --- a/src/mongo/db/pipeline/document_source_cursor.cpp +++ b/src/mongo/db/pipeline/document_source_cursor.cpp @@ -46,6 +46,7 @@ namespace mongo { using boost::intrusive_ptr; using boost::shared_ptr; + using std::string; DocumentSourceCursor::~DocumentSourceCursor() { dispose(); diff --git a/src/mongo/db/pipeline/document_source_geo_near.cpp b/src/mongo/db/pipeline/document_source_geo_near.cpp index 36d2eb93d5c..b9615e87abe 100644 --- a/src/mongo/db/pipeline/document_source_geo_near.cpp +++ b/src/mongo/db/pipeline/document_source_geo_near.cpp @@ -37,6 +37,7 @@ namespace mongo { using boost::intrusive_ptr; + using std::min; char DocumentSourceGeoNear::geoNearName[] = "$geoNear"; const char *DocumentSourceGeoNear::getSourceName() const { return geoNearName; } diff --git a/src/mongo/db/pipeline/document_source_group.cpp b/src/mongo/db/pipeline/document_source_group.cpp index 42116be2be3..b5a4443f609 100644 --- a/src/mongo/db/pipeline/document_source_group.cpp +++ b/src/mongo/db/pipeline/document_source_group.cpp @@ -44,6 +44,8 @@ namespace mongo { using boost::intrusive_ptr; using boost::shared_ptr; + using std::pair; + using std::vector; const char DocumentSourceGroup::groupName[] = "$group"; diff --git a/src/mongo/db/pipeline/document_source_match.cpp b/src/mongo/db/pipeline/document_source_match.cpp index b68b998e8a5..95b707e949a 100644 --- a/src/mongo/db/pipeline/document_source_match.cpp +++ b/src/mongo/db/pipeline/document_source_match.cpp @@ -43,6 +43,8 @@ namespace mongo { using boost::intrusive_ptr; + using std::string; + using std::vector; const char DocumentSourceMatch::matchName[] = "$match"; diff --git a/src/mongo/db/pipeline/document_source_merge_cursors.cpp b/src/mongo/db/pipeline/document_source_merge_cursors.cpp index ca21082da7e..d5d3ce1bf1e 100644 --- a/src/mongo/db/pipeline/document_source_merge_cursors.cpp +++ b/src/mongo/db/pipeline/document_source_merge_cursors.cpp @@ -38,6 +38,9 @@ namespace mongo { using boost::intrusive_ptr; + using std::make_pair; + using std::string; + using std::vector; const char DocumentSourceMergeCursors::name[] = "$mergeCursors"; diff --git a/src/mongo/db/pipeline/document_source_out.cpp b/src/mongo/db/pipeline/document_source_out.cpp index 93990b19260..b046ebe8d53 100644 --- a/src/mongo/db/pipeline/document_source_out.cpp +++ b/src/mongo/db/pipeline/document_source_out.cpp @@ -36,6 +36,7 @@ namespace mongo { using boost::intrusive_ptr; + using std::vector; const char DocumentSourceOut::outName[] = "$out"; diff --git a/src/mongo/db/pipeline/document_source_project.cpp b/src/mongo/db/pipeline/document_source_project.cpp index 8dc3136524f..78e661f44ff 100644 --- a/src/mongo/db/pipeline/document_source_project.cpp +++ b/src/mongo/db/pipeline/document_source_project.cpp @@ -42,6 +42,8 @@ namespace mongo { using boost::intrusive_ptr; + using std::string; + using std::vector; const char DocumentSourceProject::projectName[] = "$project"; diff --git a/src/mongo/db/pipeline/document_source_redact.cpp b/src/mongo/db/pipeline/document_source_redact.cpp index fd166d7cf0b..21046432156 100644 --- a/src/mongo/db/pipeline/document_source_redact.cpp +++ b/src/mongo/db/pipeline/document_source_redact.cpp @@ -43,6 +43,7 @@ namespace mongo { using boost::intrusive_ptr; + using std::vector; const char DocumentSourceRedact::redactName[] = "$redact"; diff --git a/src/mongo/db/pipeline/document_source_sort.cpp b/src/mongo/db/pipeline/document_source_sort.cpp index 2af962abafe..0a1ea7a82bf 100644 --- a/src/mongo/db/pipeline/document_source_sort.cpp +++ b/src/mongo/db/pipeline/document_source_sort.cpp @@ -46,6 +46,9 @@ namespace mongo { using boost::intrusive_ptr; using boost::scoped_ptr; + using std::make_pair; + using std::string; + using std::vector; const char DocumentSourceSort::sortName[] = "$sort"; diff --git a/src/mongo/db/pipeline/document_source_unwind.cpp b/src/mongo/db/pipeline/document_source_unwind.cpp index 687d815abb4..b94a15e4e2d 100644 --- a/src/mongo/db/pipeline/document_source_unwind.cpp +++ b/src/mongo/db/pipeline/document_source_unwind.cpp @@ -40,6 +40,8 @@ namespace mongo { using boost::intrusive_ptr; + using std::string; + using std::vector; /** Helper class to unwind array from a single document. */ class DocumentSourceUnwind::Unwinder { diff --git a/src/mongo/db/pipeline/expression.cpp b/src/mongo/db/pipeline/expression.cpp index ed0c8cbde12..5d61245b8ec 100644 --- a/src/mongo/db/pipeline/expression.cpp +++ b/src/mongo/db/pipeline/expression.cpp @@ -48,7 +48,11 @@ namespace mongo { using namespace mongoutils; + using boost::intrusive_ptr; + using std::set; + using std::string; + using std::vector; /// Helper function to easily wrap constants with $const. static Value serializeConstant(Value val) { diff --git a/src/mongo/db/pipeline/field_path.cpp b/src/mongo/db/pipeline/field_path.cpp index bbb6dd9b5f8..d68bc2e2fc7 100644 --- a/src/mongo/db/pipeline/field_path.cpp +++ b/src/mongo/db/pipeline/field_path.cpp @@ -37,6 +37,11 @@ namespace mongo { + using std::ostream; + using std::string; + using std::stringstream; + using std::vector; + using namespace mongoutils; const char FieldPath::prefix[] = "$"; diff --git a/src/mongo/db/pipeline/pipeline.cpp b/src/mongo/db/pipeline/pipeline.cpp index 8dd7d9e0267..6b38dec714d 100644 --- a/src/mongo/db/pipeline/pipeline.cpp +++ b/src/mongo/db/pipeline/pipeline.cpp @@ -49,6 +49,10 @@ namespace mongo { using boost::intrusive_ptr; + using std::endl; + using std::ostringstream; + using std::string; + using std::vector; const char Pipeline::commandName[] = "aggregate"; const char Pipeline::pipelineName[] = "pipeline"; diff --git a/src/mongo/db/pipeline/pipeline_d.cpp b/src/mongo/db/pipeline/pipeline_d.cpp index 21c075ba1c6..b11e0ede71e 100644 --- a/src/mongo/db/pipeline/pipeline_d.cpp +++ b/src/mongo/db/pipeline/pipeline_d.cpp @@ -47,6 +47,7 @@ namespace mongo { using boost::intrusive_ptr; using boost::shared_ptr; + using std::string; namespace { class MongodImplementation : public DocumentSourceNeedsMongod::MongodInterface { diff --git a/src/mongo/db/pipeline/value.cpp b/src/mongo/db/pipeline/value.cpp index 22fb3d90fd0..9077c49b5d6 100644 --- a/src/mongo/db/pipeline/value.cpp +++ b/src/mongo/db/pipeline/value.cpp @@ -44,6 +44,12 @@ namespace mongo { using namespace mongoutils; using boost::intrusive_ptr; + using std::min; + using std::numeric_limits; + using std::ostream; + using std::string; + using std::stringstream; + using std::vector; void ValueStorage::verifyRefCountingIfShould() const { switch (type) { @@ -620,7 +626,7 @@ namespace mongo { const vector<Value>& lArr = rL.getArray(); const vector<Value>& rArr = rR.getArray(); - const size_t elems = min(lArr.size(), rArr.size()); + const size_t elems = std::min(lArr.size(), rArr.size()); for (size_t i = 0; i < elems; i++ ) { // compare the two corresponding elements ret = Value::compare(lArr[i], rArr[i]); diff --git a/src/mongo/db/prefetch.cpp b/src/mongo/db/prefetch.cpp index f25c73da946..1de1d565c47 100644 --- a/src/mongo/db/prefetch.cpp +++ b/src/mongo/db/prefetch.cpp @@ -47,6 +47,10 @@ #include "mongo/util/mmap.h" namespace mongo { + + using std::endl; + using std::string; + namespace repl { namespace { // todo / idea: the prefetcher, when it fetches _id, on an upsert, will see if the record exists. if it does not, diff --git a/src/mongo/db/projection.cpp b/src/mongo/db/projection.cpp index 1e13dae4e30..abdba593da1 100644 --- a/src/mongo/db/projection.cpp +++ b/src/mongo/db/projection.cpp @@ -43,6 +43,10 @@ namespace mongo { using boost::shared_ptr; + using std::auto_ptr; + using std::endl; + using std::max; + using std::string; void Projection::init(const BSONObj& o, const MatchExpressionParser::WhereCallback& whereCallback) { diff --git a/src/mongo/db/query/canonical_query_test.cpp b/src/mongo/db/query/canonical_query_test.cpp index 73127fbd34f..af3f705ca05 100644 --- a/src/mongo/db/query/canonical_query_test.cpp +++ b/src/mongo/db/query/canonical_query_test.cpp @@ -35,6 +35,9 @@ using namespace mongo; namespace { + using std::auto_ptr; + using std::string; + static const char* ns = "somebogusns"; /** diff --git a/src/mongo/db/query/explain.cpp b/src/mongo/db/query/explain.cpp index ecce742a307..40b091cdc87 100644 --- a/src/mongo/db/query/explain.cpp +++ b/src/mongo/db/query/explain.cpp @@ -49,6 +49,9 @@ namespace { using namespace mongo; using boost::scoped_ptr; + using std::auto_ptr; + using std::string; + using std::vector; /** * Traverse the tree rooted at 'root', and add all tree nodes into the list 'flattened'. diff --git a/src/mongo/db/query/expression_index.cpp b/src/mongo/db/query/expression_index.cpp index 13cd25e07b0..51cc439da23 100644 --- a/src/mongo/db/query/expression_index.cpp +++ b/src/mongo/db/query/expression_index.cpp @@ -39,6 +39,8 @@ namespace mongo { + using std::set; + BSONObj ExpressionMapping::hash(const BSONElement& value) { BSONObjBuilder bob; bob.append("", BSONElementHasher::hash64(value, BSONElementHasher::DEFAULT_HASH_SEED)); diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp index 74e58268b68..7e176e2c7f5 100644 --- a/src/mongo/db/query/find.cpp +++ b/src/mongo/db/query/find.cpp @@ -63,6 +63,8 @@ #include "mongo/util/mongoutils/str.h" using boost::scoped_ptr; +using std::auto_ptr; +using std::endl; namespace mongo { // The .h for this in find_constants.h. diff --git a/src/mongo/db/query/get_executor.cpp b/src/mongo/db/query/get_executor.cpp index 7e3b6087998..32fe3525c75 100644 --- a/src/mongo/db/query/get_executor.cpp +++ b/src/mongo/db/query/get_executor.cpp @@ -74,6 +74,11 @@ namespace mongo { + using std::auto_ptr; + using std::endl; + using std::string; + using std::vector; + // static void filterAllowedIndexEntries(const AllowedIndices& allowedIndices, std::vector<IndexEntry>* indexEntries) { diff --git a/src/mongo/db/query/index_bounds.cpp b/src/mongo/db/query/index_bounds.cpp index 664b2245613..b88bbe67f42 100644 --- a/src/mongo/db/query/index_bounds.cpp +++ b/src/mongo/db/query/index_bounds.cpp @@ -33,6 +33,7 @@ namespace mongo { + using std::string; using std::vector; namespace { diff --git a/src/mongo/db/query/index_bounds_builder_test.cpp b/src/mongo/db/query/index_bounds_builder_test.cpp index 92231ba7a32..accf74f06fa 100644 --- a/src/mongo/db/query/index_bounds_builder_test.cpp +++ b/src/mongo/db/query/index_bounds_builder_test.cpp @@ -43,6 +43,9 @@ using namespace mongo; namespace { using std::auto_ptr; + using std::numeric_limits; + using std::string; + using std::vector; double numberMin = -numeric_limits<double>::max(); double numberMax = numeric_limits<double>::max(); diff --git a/src/mongo/db/query/interval.cpp b/src/mongo/db/query/interval.cpp index c42feefa2c2..cdbb7abbb6d 100644 --- a/src/mongo/db/query/interval.cpp +++ b/src/mongo/db/query/interval.cpp @@ -30,6 +30,8 @@ namespace mongo { + using std::string; + Interval::Interval() : _intervalData(BSONObj()), start(BSONElement()), startInclusive(false), end(BSONElement()), endInclusive(false) { } diff --git a/src/mongo/db/query/lite_parsed_query.cpp b/src/mongo/db/query/lite_parsed_query.cpp index d002850122b..dae741b59c1 100644 --- a/src/mongo/db/query/lite_parsed_query.cpp +++ b/src/mongo/db/query/lite_parsed_query.cpp @@ -36,6 +36,9 @@ namespace mongo { + using std::auto_ptr; + using std::string; + const string LiteParsedQuery::cmdOptionMaxTimeMS("maxTimeMS"); const string LiteParsedQuery::queryOptionMaxTimeMS("$maxTimeMS"); diff --git a/src/mongo/db/query/parsed_projection.cpp b/src/mongo/db/query/parsed_projection.cpp index 0fa92ed8951..c18ddd4135e 100644 --- a/src/mongo/db/query/parsed_projection.cpp +++ b/src/mongo/db/query/parsed_projection.cpp @@ -32,6 +32,9 @@ namespace mongo { + using std::auto_ptr; + using std::string; + /** * Parses the projection 'spec' and checks its validity with respect to the query 'query'. * Puts covering information into 'out'. diff --git a/src/mongo/db/query/plan_cache.cpp b/src/mongo/db/query/plan_cache.cpp index bc3fff29458..d1b16dc209c 100644 --- a/src/mongo/db/query/plan_cache.cpp +++ b/src/mongo/db/query/plan_cache.cpp @@ -47,6 +47,9 @@ namespace mongo { + using std::string; + using std::vector; + // // Cache-related functions for CanonicalQuery // diff --git a/src/mongo/db/query/plan_cache_test.cpp b/src/mongo/db/query/plan_cache_test.cpp index 19b44fd46a5..e10f112134a 100644 --- a/src/mongo/db/query/plan_cache_test.cpp +++ b/src/mongo/db/query/plan_cache_test.cpp @@ -54,6 +54,8 @@ namespace { using boost::scoped_ptr; using std::auto_ptr; + using std::string; + using std::vector; static const char* ns = "somebogusns"; diff --git a/src/mongo/db/query/plan_enumerator.cpp b/src/mongo/db/query/plan_enumerator.cpp index ae485a7386f..7f60f5d1eaf 100644 --- a/src/mongo/db/query/plan_enumerator.cpp +++ b/src/mongo/db/query/plan_enumerator.cpp @@ -40,6 +40,11 @@ namespace { using namespace mongo; + using std::auto_ptr; + using std::endl; + using std::set; + using std::string; + using std::vector; std::string getPathPrefix(std::string path) { if (mongoutils::str::contains(path, '.')) { diff --git a/src/mongo/db/query/plan_executor.cpp b/src/mongo/db/query/plan_executor.cpp index 2a9e1009aad..cb1c5fcb19e 100644 --- a/src/mongo/db/query/plan_executor.cpp +++ b/src/mongo/db/query/plan_executor.cpp @@ -47,6 +47,8 @@ namespace mongo { using boost::shared_ptr; + using std::string; + using std::vector; namespace { diff --git a/src/mongo/db/query/plan_ranker.cpp b/src/mongo/db/query/plan_ranker.cpp index 12c9bfef5b7..54075c2f16a 100644 --- a/src/mongo/db/query/plan_ranker.cpp +++ b/src/mongo/db/query/plan_ranker.cpp @@ -63,6 +63,7 @@ namespace { namespace mongo { + using std::endl; using std::vector; // static diff --git a/src/mongo/db/query/planner_access.cpp b/src/mongo/db/query/planner_access.cpp index 0e73da652cf..bb79362aad3 100644 --- a/src/mongo/db/query/planner_access.cpp +++ b/src/mongo/db/query/planner_access.cpp @@ -60,6 +60,7 @@ namespace { namespace mongo { + using std::auto_ptr; using std::vector; // static diff --git a/src/mongo/db/query/planner_analysis.cpp b/src/mongo/db/query/planner_analysis.cpp index a1ba92b8c70..24f5af7279b 100644 --- a/src/mongo/db/query/planner_analysis.cpp +++ b/src/mongo/db/query/planner_analysis.cpp @@ -37,6 +37,11 @@ namespace mongo { + using std::auto_ptr; + using std::endl; + using std::string; + using std::vector; + // // Helpers for bounds explosion AKA quick-and-dirty SERVER-1205. // diff --git a/src/mongo/db/query/query_planner.cpp b/src/mongo/db/query/query_planner.cpp index 8f5880ab467..324cdbd07dd 100644 --- a/src/mongo/db/query/query_planner.cpp +++ b/src/mongo/db/query/query_planner.cpp @@ -50,6 +50,9 @@ namespace mongo { + using std::auto_ptr; + using std::numeric_limits; + // Copied verbatim from db/index.h static bool isIdIndex( const BSONObj &pattern ) { BSONObjIterator i(pattern); diff --git a/src/mongo/db/query/query_planner_test.cpp b/src/mongo/db/query/query_planner_test.cpp index cb493541032..5f67c114a99 100644 --- a/src/mongo/db/query/query_planner_test.cpp +++ b/src/mongo/db/query/query_planner_test.cpp @@ -49,6 +49,10 @@ using namespace mongo; namespace { + using std::map; + using std::string; + using std::vector; + static const char* ns = "somebogusns"; class QueryPlannerTest : public mongo::unittest::Test { diff --git a/src/mongo/db/query/query_planner_test_lib.cpp b/src/mongo/db/query/query_planner_test_lib.cpp index a95f406721e..cf315f2908a 100644 --- a/src/mongo/db/query/query_planner_test_lib.cpp +++ b/src/mongo/db/query/query_planner_test_lib.cpp @@ -46,6 +46,8 @@ namespace { using namespace mongo; + using std::string; + bool filterMatches(const BSONObj& testFilter, const QuerySolutionNode* trueFilterNode) { if (NULL == trueFilterNode->filter) { return false; } diff --git a/src/mongo/db/query/query_planner_text_test.cpp b/src/mongo/db/query/query_planner_text_test.cpp index 422163fb72a..f88f9bb16dc 100644 --- a/src/mongo/db/query/query_planner_text_test.cpp +++ b/src/mongo/db/query/query_planner_text_test.cpp @@ -44,6 +44,10 @@ #include "mongo/util/assert_util.h" using namespace mongo; +using std::cout; +using std::endl; +using std::string; +using std::vector; namespace { diff --git a/src/mongo/db/query/query_solution.cpp b/src/mongo/db/query/query_solution.cpp index 7b11ade8dbc..877e58612c3 100644 --- a/src/mongo/db/query/query_solution.cpp +++ b/src/mongo/db/query/query_solution.cpp @@ -35,6 +35,8 @@ namespace mongo { + using std::set; + string QuerySolutionNode::toString() const { mongoutils::str::stream ss; appendToString(&ss, 0); diff --git a/src/mongo/db/query/stage_builder.cpp b/src/mongo/db/query/stage_builder.cpp index 549a8f461d9..097b4f71e61 100644 --- a/src/mongo/db/query/stage_builder.cpp +++ b/src/mongo/db/query/stage_builder.cpp @@ -55,6 +55,8 @@ namespace mongo { + using std::auto_ptr; + PlanStage* buildStages(OperationContext* txn, Collection* collection, const QuerySolution& qsol, diff --git a/src/mongo/db/range_deleter.cpp b/src/mongo/db/range_deleter.cpp index 02a2dc02da9..28e8ab08e94 100644 --- a/src/mongo/db/range_deleter.cpp +++ b/src/mongo/db/range_deleter.cpp @@ -46,6 +46,7 @@ #include "mongo/util/timer.h" using std::auto_ptr; +using std::endl; using std::set; using std::pair; using std::string; @@ -413,7 +414,7 @@ namespace { stats->reserve(kDeleteJobsHistory); scoped_lock sl(_statsHistoryMutex); - for (deque<DeleteJobStats*>::const_iterator it = _statsHistory.begin(); + for (std::deque<DeleteJobStats*>::const_iterator it = _statsHistory.begin(); it != _statsHistory.end(); ++it) { stats->push_back(new DeleteJobStats(**it)); } diff --git a/src/mongo/db/range_deleter_db_env.cpp b/src/mongo/db/range_deleter_db_env.cpp index b79f0dbb714..25f3ce65ed4 100644 --- a/src/mongo/db/range_deleter_db_env.cpp +++ b/src/mongo/db/range_deleter_db_env.cpp @@ -45,6 +45,9 @@ namespace mongo { + using std::endl; + using std::string; + void RangeDeleterDBEnv::initThread() { if ( currentClient.get() == NULL ) Client::initThread( "RangeDeleter" ); diff --git a/src/mongo/db/range_deleter_mock_env.cpp b/src/mongo/db/range_deleter_mock_env.cpp index 4e51da8a50b..d4d8ad17112 100644 --- a/src/mongo/db/range_deleter_mock_env.cpp +++ b/src/mongo/db/range_deleter_mock_env.cpp @@ -33,6 +33,9 @@ namespace mongo { + using std::set; + using std::string; + bool DeletedRangeCmp::operator()(const DeletedRange& lhs, const DeletedRange& rhs) const { const int nsComp = lhs.ns.compare(rhs.ns); diff --git a/src/mongo/db/repair_database.cpp b/src/mongo/db/repair_database.cpp index 6dab35b1fbb..26f4dc5382e 100644 --- a/src/mongo/db/repair_database.cpp +++ b/src/mongo/db/repair_database.cpp @@ -50,6 +50,10 @@ #include "mongo/util/log.h" namespace mongo { + + using std::endl; + using std::string; + namespace { Status rebuildIndexesOnCollection(OperationContext* txn, DatabaseCatalogEntry* dbce, diff --git a/src/mongo/db/repl/bgsync.cpp b/src/mongo/db/repl/bgsync.cpp index 8b4166a7476..9a1a10ddd8c 100644 --- a/src/mongo/db/repl/bgsync.cpp +++ b/src/mongo/db/repl/bgsync.cpp @@ -51,6 +51,8 @@ namespace mongo { + using std::string; + namespace repl { namespace { diff --git a/src/mongo/db/repl/isself_test.cpp b/src/mongo/db/repl/isself_test.cpp index b54f32c0b9f..b3af1721e62 100644 --- a/src/mongo/db/repl/isself_test.cpp +++ b/src/mongo/db/repl/isself_test.cpp @@ -40,6 +40,8 @@ namespace repl { namespace { + using std::string; + TEST(IsSelf, DetectsSameHostIPv4) { #if defined(_WIN32) || defined(__linux__) || defined(__APPLE__) bool wasEnabled = IPv6Enabled(); diff --git a/src/mongo/db/repl/master_slave.cpp b/src/mongo/db/repl/master_slave.cpp index cdc2b77d867..bc527e3935c 100644 --- a/src/mongo/db/repl/master_slave.cpp +++ b/src/mongo/db/repl/master_slave.cpp @@ -69,6 +69,14 @@ #include "mongo/util/log.h" using boost::scoped_ptr; +using std::auto_ptr; +using std::cout; +using std::endl; +using std::max; +using std::min; +using std::set; +using std::stringstream; +using std::vector; namespace mongo { namespace repl { diff --git a/src/mongo/db/repl/oplog.cpp b/src/mongo/db/repl/oplog.cpp index b7cb638e335..65579567d2d 100644 --- a/src/mongo/db/repl/oplog.cpp +++ b/src/mongo/db/repl/oplog.cpp @@ -70,6 +70,10 @@ #include "mongo/util/startup_test.h" namespace mongo { + + using std::endl; + using std::stringstream; + namespace repl { namespace { diff --git a/src/mongo/db/repl/oplogreader.cpp b/src/mongo/db/repl/oplogreader.cpp index 0f10e516963..a3d2bca8e7f 100644 --- a/src/mongo/db/repl/oplogreader.cpp +++ b/src/mongo/db/repl/oplogreader.cpp @@ -53,6 +53,8 @@ namespace mongo { using boost::shared_ptr; + using std::endl; + using std::string; namespace repl { diff --git a/src/mongo/db/repl/repl_set_heartbeat_response_test.cpp b/src/mongo/db/repl/repl_set_heartbeat_response_test.cpp index 3b4fe4ac8a0..71003ab4fec 100644 --- a/src/mongo/db/repl/repl_set_heartbeat_response_test.cpp +++ b/src/mongo/db/repl/repl_set_heartbeat_response_test.cpp @@ -39,6 +39,7 @@ namespace repl { namespace { using boost::scoped_ptr; + using std::auto_ptr; bool stringContains(const std::string &haystack, const std::string& needle) { return haystack.find(needle) != std::string::npos; diff --git a/src/mongo/db/repl/repl_set_seed_list.cpp b/src/mongo/db/repl/repl_set_seed_list.cpp index aef6277eb46..861a2398711 100644 --- a/src/mongo/db/repl/repl_set_seed_list.cpp +++ b/src/mongo/db/repl/repl_set_seed_list.cpp @@ -40,6 +40,8 @@ namespace mongo { namespace repl { + using std::string; + /** @param cfgString <setname>/<seedhost1>,<seedhost2> */ void parseReplSetSeedList(ReplicationCoordinatorExternalState* externalState, const std::string& cfgString, diff --git a/src/mongo/db/repl/replication_coordinator_mock.cpp b/src/mongo/db/repl/replication_coordinator_mock.cpp index ef8bebcf235..6b806b46719 100644 --- a/src/mongo/db/repl/replication_coordinator_mock.cpp +++ b/src/mongo/db/repl/replication_coordinator_mock.cpp @@ -37,6 +37,8 @@ namespace mongo { namespace repl { + using std::vector; + ReplicationCoordinatorMock::ReplicationCoordinatorMock(const ReplSettings& settings) : _settings(settings) {} ReplicationCoordinatorMock::~ReplicationCoordinatorMock() {} diff --git a/src/mongo/db/repl/replication_info.cpp b/src/mongo/db/repl/replication_info.cpp index 4559424cac7..cf7ff0faabb 100644 --- a/src/mongo/db/repl/replication_info.cpp +++ b/src/mongo/db/repl/replication_info.cpp @@ -48,6 +48,12 @@ #include "mongo/s/write_ops/batched_command_request.h" namespace mongo { + + using std::auto_ptr; + using std::list; + using std::string; + using std::stringstream; + namespace repl { void appendReplicationInfo(OperationContext* txn, BSONObjBuilder& result, int level) { diff --git a/src/mongo/db/repl/replset_commands.cpp b/src/mongo/db/repl/replset_commands.cpp index 1821e55e98b..a46ab9b474b 100644 --- a/src/mongo/db/repl/replset_commands.cpp +++ b/src/mongo/db/repl/replset_commands.cpp @@ -60,6 +60,10 @@ namespace mongo { namespace repl { + using std::string; + using std::stringstream; + using std::vector; + unsigned replSetForceInitialSyncFailure = 0; // Testing only, enabled via command-line. diff --git a/src/mongo/db/repl/resync.cpp b/src/mongo/db/repl/resync.cpp index d2039fcd4e5..16e385c9b48 100644 --- a/src/mongo/db/repl/resync.cpp +++ b/src/mongo/db/repl/resync.cpp @@ -34,6 +34,10 @@ #include "mongo/db/operation_context.h" namespace mongo { + + using std::string; + using std::stringstream; + namespace repl { // operator requested resynchronization of replication (on a slave or secondary). {resync: 1} diff --git a/src/mongo/db/repl/rs_initialsync.cpp b/src/mongo/db/repl/rs_initialsync.cpp index b33d096a167..c1fa5efe18d 100644 --- a/src/mongo/db/repl/rs_initialsync.cpp +++ b/src/mongo/db/repl/rs_initialsync.cpp @@ -55,6 +55,9 @@ namespace mongo { namespace repl { namespace { + using std::list; + using std::string; + /** * Truncates the oplog (removes any documents) and resets internal variables that were * originally initialized or affected by using values from the oplog at startup time. These diff --git a/src/mongo/db/repl/rs_rollback.cpp b/src/mongo/db/repl/rs_rollback.cpp index 30e5863f397..aa8a8facfec 100644 --- a/src/mongo/db/repl/rs_rollback.cpp +++ b/src/mongo/db/repl/rs_rollback.cpp @@ -97,6 +97,13 @@ namespace mongo { using boost::shared_ptr; + using std::auto_ptr; + using std::endl; + using std::list; + using std::map; + using std::set; + using std::string; + using std::pair; namespace repl { namespace { diff --git a/src/mongo/db/repl/sync.cpp b/src/mongo/db/repl/sync.cpp index 0530c719eac..bdfc676a63f 100644 --- a/src/mongo/db/repl/sync.cpp +++ b/src/mongo/db/repl/sync.cpp @@ -45,6 +45,9 @@ namespace mongo { + using std::endl; + using std::string; + namespace repl { void Sync::setHostname(const string& hostname) { diff --git a/src/mongo/db/repl/sync_source_feedback.cpp b/src/mongo/db/repl/sync_source_feedback.cpp index 6f606e2fe24..57c747163e5 100644 --- a/src/mongo/db/repl/sync_source_feedback.cpp +++ b/src/mongo/db/repl/sync_source_feedback.cpp @@ -50,6 +50,9 @@ namespace mongo { + using std::endl; + using std::string; + namespace repl { // used in replAuthenticate diff --git a/src/mongo/db/repl/sync_tail.cpp b/src/mongo/db/repl/sync_tail.cpp index 966bf144136..5b72fc86d1a 100644 --- a/src/mongo/db/repl/sync_tail.cpp +++ b/src/mongo/db/repl/sync_tail.cpp @@ -59,6 +59,8 @@ namespace mongo { + using std::endl; + namespace repl { #if defined(MONGO_PLATFORM_64) const int replWriterThreadCount = 16; @@ -143,7 +145,7 @@ namespace repl { // equal numbers and is still likely to be different for different numbers. const double dbl = elem.numberDouble(); if (isNaN(dbl)) { - boost::hash_combine(hash, numeric_limits<double>::quiet_NaN()); + boost::hash_combine(hash, std::numeric_limits<double>::quiet_NaN()); } else { boost::hash_combine(hash, dbl); diff --git a/src/mongo/db/repl/topology_coordinator_impl.cpp b/src/mongo/db/repl/topology_coordinator_impl.cpp index ff83fee57fc..e624fb2407e 100644 --- a/src/mongo/db/repl/topology_coordinator_impl.cpp +++ b/src/mongo/db/repl/topology_coordinator_impl.cpp @@ -51,6 +51,8 @@ namespace mongo { namespace repl { + using std::vector; + const Seconds TopologyCoordinatorImpl::LastVote::leaseTime = Seconds(30); namespace { diff --git a/src/mongo/db/restapi.cpp b/src/mongo/db/restapi.cpp index e4e6a561757..db6f7b6db7e 100644 --- a/src/mongo/db/restapi.cpp +++ b/src/mongo/db/restapi.cpp @@ -57,6 +57,12 @@ namespace mongo { bool getInitialSyncCompleted(); + using std::auto_ptr; + using std::string; + using std::stringstream; + using std::endl; + using std::vector; + using namespace html; class RESTHandler : public DbWebHandler { diff --git a/src/mongo/db/server_options_helpers.cpp b/src/mongo/db/server_options_helpers.cpp index d13f74b03f3..38b7d87ee74 100644 --- a/src/mongo/db/server_options_helpers.cpp +++ b/src/mongo/db/server_options_helpers.cpp @@ -55,6 +55,7 @@ #include "mongo/util/net/ssl_options.h" #include "mongo/util/options_parser/startup_options.h" +using std::endl; using std::string; namespace mongo { diff --git a/src/mongo/db/server_parameters.cpp b/src/mongo/db/server_parameters.cpp index fefdee6f4a1..f57c8750678 100644 --- a/src/mongo/db/server_parameters.cpp +++ b/src/mongo/db/server_parameters.cpp @@ -39,6 +39,9 @@ namespace mongo { + using std::string; + using std::vector; + namespace { ServerParameterSet* GLOBAL = NULL; } diff --git a/src/mongo/db/server_parameters_test.cpp b/src/mongo/db/server_parameters_test.cpp index c2a6f56156c..6e74cde215d 100644 --- a/src/mongo/db/server_parameters_test.cpp +++ b/src/mongo/db/server_parameters_test.cpp @@ -35,6 +35,9 @@ namespace mongo { + using std::string; + using std::vector; + TEST( ServerParameters, Simple1 ) { int f = 5; ExportedServerParameter<int> ff( NULL, "ff", &f, true, true ); diff --git a/src/mongo/db/sorter/sorter.cpp b/src/mongo/db/sorter/sorter.cpp index d3225a5ef4e..8cb5048c2fc 100644 --- a/src/mongo/db/sorter/sorter.cpp +++ b/src/mongo/db/sorter/sorter.cpp @@ -114,7 +114,7 @@ namespace mongo { /** Ensures a named file is deleted when this object goes out of scope */ class FileDeleter { public: - FileDeleter(const string& fileName) :_fileName(fileName) {} + FileDeleter(const std::string& fileName) :_fileName(fileName) {} ~FileDeleter() { DESTRUCTOR_GUARD( boost::filesystem::remove(_fileName); @@ -160,7 +160,7 @@ namespace mongo { > Settings; typedef std::pair<Key, Value> Data; - FileIterator(const string& fileName, + FileIterator(const std::string& fileName, const Settings& settings, boost::shared_ptr<FileDeleter> fileDeleter) : _settings(settings) @@ -257,7 +257,7 @@ namespace mongo { bool _done; boost::scoped_array<char> _buffer; boost::scoped_ptr<BufReader> _reader; - string _fileName; + std::string _fileName; boost::shared_ptr<FileDeleter> _fileDeleter; // Must outlive _file std::ifstream _file; }; @@ -274,7 +274,7 @@ namespace mongo { const SortOptions& opts, const Comparator& comp) : _opts(opts) - , _remaining(opts.limit ? opts.limit : numeric_limits<unsigned long long>::max()) + , _remaining(opts.limit ? opts.limit : std::numeric_limits<unsigned long long>::max()) , _first(true) , _greater(comp) { diff --git a/src/mongo/db/sorter/sorter_test.cpp b/src/mongo/db/sorter/sorter_test.cpp index fb4cdf8a8c0..fdab37d69b8 100644 --- a/src/mongo/db/sorter/sorter_test.cpp +++ b/src/mongo/db/sorter/sorter_test.cpp @@ -45,6 +45,7 @@ namespace mongo { using namespace mongo::sorter; using boost::make_shared; + using std::pair; // Stub to avoid including the server_options library // TODO: This should go away once we can do these checks at compile time diff --git a/src/mongo/db/startup_warnings_mongod.cpp b/src/mongo/db/startup_warnings_mongod.cpp index abcf096f3c3..e81ed1f24b3 100644 --- a/src/mongo/db/startup_warnings_mongod.cpp +++ b/src/mongo/db/startup_warnings_mongod.cpp @@ -46,6 +46,9 @@ namespace mongo { + using std::ios_base; + using std::string; + void logMongodStartupWarnings() { logCommonStartupWarnings(); diff --git a/src/mongo/db/stats/counters.cpp b/src/mongo/db/stats/counters.cpp index 87a3d462e9d..78b3178be2f 100644 --- a/src/mongo/db/stats/counters.cpp +++ b/src/mongo/db/stats/counters.cpp @@ -40,6 +40,9 @@ #include "mongo/util/log.h" namespace mongo { + + using std::endl; + OpCounters::OpCounters() {} void OpCounters::incInsertInWriteLock(int n) { diff --git a/src/mongo/db/stats/snapshots.cpp b/src/mongo/db/stats/snapshots.cpp index 8cfac6860fa..f36bce434c2 100644 --- a/src/mongo/db/stats/snapshots.cpp +++ b/src/mongo/db/stats/snapshots.cpp @@ -47,6 +47,9 @@ */ namespace mongo { + using std::auto_ptr; + using std::endl; + void SnapshotData::takeSnapshot() { _created = curTimeMicros64(); Top::global.cloneMap(_usage); diff --git a/src/mongo/db/stats/snapshots_webplugins.cpp b/src/mongo/db/stats/snapshots_webplugins.cpp index 53dd5896e70..281ed1dbf5c 100644 --- a/src/mongo/db/stats/snapshots_webplugins.cpp +++ b/src/mongo/db/stats/snapshots_webplugins.cpp @@ -38,6 +38,12 @@ namespace { using namespace html; + using std::auto_ptr; + using std::fixed; + using std::setprecision; + using std::string; + using std::stringstream; + class WriteLockStatus : public WebStatusPlugin { public: WriteLockStatus() : WebStatusPlugin( "write lock" , 51 , "% time in write lock, by 4 sec periods" ) {} diff --git a/src/mongo/db/stats/top.cpp b/src/mongo/db/stats/top.cpp index 7c1be88a76b..a95f1ae7dc6 100644 --- a/src/mongo/db/stats/top.cpp +++ b/src/mongo/db/stats/top.cpp @@ -46,6 +46,11 @@ namespace mongo { + using std::endl; + using std::string; + using std::stringstream; + using std::vector; + Top::UsageData::UsageData( const UsageData& older, const UsageData& newer ) { // this won't be 100% accurate on rollovers and drop(), but at least it won't be negative time = (newer.time >= older.time) ? (newer.time - older.time) : newer.time; diff --git a/src/mongo/db/storage/in_memory/in_memory_btree_impl.cpp b/src/mongo/db/storage/in_memory/in_memory_btree_impl.cpp index 3260b9ab391..ea303575bf5 100644 --- a/src/mongo/db/storage/in_memory/in_memory_btree_impl.cpp +++ b/src/mongo/db/storage/in_memory/in_memory_btree_impl.cpp @@ -44,6 +44,8 @@ namespace mongo { using boost::shared_ptr; + using std::string; + using std::vector; namespace { diff --git a/src/mongo/db/storage/key_string.cpp b/src/mongo/db/storage/key_string.cpp index 4089525cb3c..381d7795abf 100644 --- a/src/mongo/db/storage/key_string.cpp +++ b/src/mongo/db/storage/key_string.cpp @@ -44,6 +44,8 @@ namespace mongo { + using std::string; + namespace { typedef KeyString::TypeBits TypeBits; diff --git a/src/mongo/db/storage/key_string_test.cpp b/src/mongo/db/storage/key_string_test.cpp index ed5d7c7f4a1..f132645703a 100644 --- a/src/mongo/db/storage/key_string_test.cpp +++ b/src/mongo/db/storage/key_string_test.cpp @@ -36,6 +36,7 @@ #include "mongo/util/hex.h" #include "mongo/util/log.h" +using std::string; using namespace mongo; BSONObj toBson(const KeyString& ks, Ordering ord) { diff --git a/src/mongo/db/storage/kv/kv_catalog.cpp b/src/mongo/db/storage/kv/kv_catalog.cpp index 3f5c4c85be3..81490a90e80 100644 --- a/src/mongo/db/storage/kv/kv_catalog.cpp +++ b/src/mongo/db/storage/kv/kv_catalog.cpp @@ -54,6 +54,7 @@ namespace { } using boost::scoped_ptr; + using std::string; class KVCatalog::AddIdentChange : public RecoveryUnit::Change { public: diff --git a/src/mongo/db/storage/kv/kv_collection_catalog_entry.cpp b/src/mongo/db/storage/kv/kv_collection_catalog_entry.cpp index 65b5bd054d2..c32736bcf07 100644 --- a/src/mongo/db/storage/kv/kv_collection_catalog_entry.cpp +++ b/src/mongo/db/storage/kv/kv_collection_catalog_entry.cpp @@ -35,6 +35,9 @@ #include "mongo/db/storage/kv/kv_engine.h" namespace mongo { + + using std::string; + class KVCollectionCatalogEntry::AddIndexChange : public RecoveryUnit::Change { public: AddIndexChange(OperationContext* opCtx, KVCollectionCatalogEntry* cce, diff --git a/src/mongo/db/storage/kv/kv_database_catalog_entry.cpp b/src/mongo/db/storage/kv/kv_database_catalog_entry.cpp index abde589c5a3..f397c767dca 100644 --- a/src/mongo/db/storage/kv/kv_database_catalog_entry.cpp +++ b/src/mongo/db/storage/kv/kv_database_catalog_entry.cpp @@ -37,6 +37,10 @@ #include "mongo/db/storage/recovery_unit.h" namespace mongo { + + using std::string; + using std::vector; + class KVDatabaseCatalogEntry::AddCollectionChange : public RecoveryUnit::Change { public: AddCollectionChange(OperationContext* opCtx, KVDatabaseCatalogEntry* dce, diff --git a/src/mongo/db/storage/kv/kv_engine_test_harness.cpp b/src/mongo/db/storage/kv/kv_engine_test_harness.cpp index f1d721ede4a..f2438689f8e 100644 --- a/src/mongo/db/storage/kv/kv_engine_test_harness.cpp +++ b/src/mongo/db/storage/kv/kv_engine_test_harness.cpp @@ -43,6 +43,7 @@ namespace mongo { using boost::scoped_ptr; + using std::string; namespace { class MyOperationContext : public OperationContextNoop { diff --git a/src/mongo/db/storage/kv/kv_storage_engine.cpp b/src/mongo/db/storage/kv/kv_storage_engine.cpp index 6ded627f501..ef56ed40325 100644 --- a/src/mongo/db/storage/kv/kv_storage_engine.cpp +++ b/src/mongo/db/storage/kv/kv_storage_engine.cpp @@ -39,6 +39,9 @@ namespace mongo { + using std::string; + using std::vector; + namespace { const std::string catalogInfo = "_mdb_catalog"; } diff --git a/src/mongo/db/storage/mmap_v1/aligned_builder.cpp b/src/mongo/db/storage/mmap_v1/aligned_builder.cpp index 8df70d47d41..d11e88611bd 100644 --- a/src/mongo/db/storage/mmap_v1/aligned_builder.cpp +++ b/src/mongo/db/storage/mmap_v1/aligned_builder.cpp @@ -37,6 +37,8 @@ namespace mongo { + using std::endl; + AlignedBuilder::AlignedBuilder(unsigned initSize) { _len = 0; _malloc(initSize); diff --git a/src/mongo/db/storage/mmap_v1/btree/btree_interface.cpp b/src/mongo/db/storage/mmap_v1/btree/btree_interface.cpp index d7765c6be99..fbd1e6ad063 100644 --- a/src/mongo/db/storage/mmap_v1/btree/btree_interface.cpp +++ b/src/mongo/db/storage/mmap_v1/btree/btree_interface.cpp @@ -39,6 +39,8 @@ namespace mongo { using boost::scoped_ptr; + using std::string; + using std::vector; template <class OnDiskFormat> class BtreeBuilderInterfaceImpl : public SortedDataBuilderInterface { diff --git a/src/mongo/db/storage/mmap_v1/btree/btree_interface_test.cpp b/src/mongo/db/storage/mmap_v1/btree/btree_interface_test.cpp index 7fcdb64c6cb..74458f3e5e7 100644 --- a/src/mongo/db/storage/mmap_v1/btree/btree_interface_test.cpp +++ b/src/mongo/db/storage/mmap_v1/btree/btree_interface_test.cpp @@ -35,6 +35,8 @@ namespace mongo { + using std::auto_ptr; + class MyHarnessHelper : public HarnessHelper { public: MyHarnessHelper() diff --git a/src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp b/src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp index 60537a80aa3..9ac587b376c 100644 --- a/src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp +++ b/src/mongo/db/storage/mmap_v1/btree/btree_logic.cpp @@ -42,6 +42,16 @@ namespace mongo { + using std::auto_ptr; + using std::dec; + using std::endl; + using std::hex; + using std::make_pair; + using std::pair; + using std::string; + using std::stringstream; + using std::vector; + // BtreeLogic::Builder algorithm // // Phase 1: diff --git a/src/mongo/db/storage/mmap_v1/btree/btree_logic_test.cpp b/src/mongo/db/storage/mmap_v1/btree/btree_logic_test.cpp index a84b135091b..87bfd0a03db 100644 --- a/src/mongo/db/storage/mmap_v1/btree/btree_logic_test.cpp +++ b/src/mongo/db/storage/mmap_v1/btree/btree_logic_test.cpp @@ -43,6 +43,8 @@ namespace mongo { + using std::string; + /** * This class is made friend of BtreeLogic so we can add whatever private method accesses we * need to it, to be used by the tests. diff --git a/src/mongo/db/storage/mmap_v1/btree/btree_test_help.cpp b/src/mongo/db/storage/mmap_v1/btree/btree_test_help.cpp index 9609177b0e7..fe0cdf7e82e 100644 --- a/src/mongo/db/storage/mmap_v1/btree/btree_test_help.cpp +++ b/src/mongo/db/storage/mmap_v1/btree/btree_test_help.cpp @@ -37,6 +37,8 @@ namespace mongo { + using std::string; + string bigNumString(long long n, int len) { char sub[17]; sprintf(sub, "%.16llx", n); diff --git a/src/mongo/db/storage/mmap_v1/btree/key.cpp b/src/mongo/db/storage/mmap_v1/btree/key.cpp index 9e9c0728799..d1bae1d4b33 100644 --- a/src/mongo/db/storage/mmap_v1/btree/key.cpp +++ b/src/mongo/db/storage/mmap_v1/btree/key.cpp @@ -38,6 +38,10 @@ namespace mongo { + using std::endl; + using std::numeric_limits; + using std::min; + extern const Ordering nullOrdering = Ordering::make(BSONObj()); // KeyBson is for V0 (version #0) indexes diff --git a/src/mongo/db/storage/mmap_v1/catalog/namespace_details_collection_entry.cpp b/src/mongo/db/storage/mmap_v1/catalog/namespace_details_collection_entry.cpp index 4f18bc622d8..4a3d7c394bf 100644 --- a/src/mongo/db/storage/mmap_v1/catalog/namespace_details_collection_entry.cpp +++ b/src/mongo/db/storage/mmap_v1/catalog/namespace_details_collection_entry.cpp @@ -37,6 +37,9 @@ #include "mongo/util/startup_test.h" namespace mongo { + + using std::string; + NamespaceDetailsCollectionCatalogEntry::NamespaceDetailsCollectionCatalogEntry( const StringData& ns, NamespaceDetails* details, RecordStore* indexRecordStore, diff --git a/src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp b/src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp index 6faffcc6900..71d17417586 100644 --- a/src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp +++ b/src/mongo/db/storage/mmap_v1/catalog/namespace_details_rsv1_metadata.cpp @@ -38,6 +38,7 @@ namespace mongo { using boost::scoped_ptr; + using std::numeric_limits; BOOST_STATIC_ASSERT(RecordStoreV1Base::Buckets == NamespaceDetails::SmallBuckets + NamespaceDetails::LargeBuckets); diff --git a/src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp b/src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp index c4021faa522..ab2f441818b 100644 --- a/src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp +++ b/src/mongo/db/storage/mmap_v1/catalog/namespace_index.cpp @@ -47,6 +47,10 @@ namespace mongo { + using std::endl; + using std::list; + using std::string; + NamespaceIndex::NamespaceIndex(const std::string& dir, const std::string& database) : _dir(dir), _database(database), diff --git a/src/mongo/db/storage/mmap_v1/catalog/namespace_test.cpp b/src/mongo/db/storage/mmap_v1/catalog/namespace_test.cpp index 7c50b86a5bf..6a0edb79ea4 100644 --- a/src/mongo/db/storage/mmap_v1/catalog/namespace_test.cpp +++ b/src/mongo/db/storage/mmap_v1/catalog/namespace_test.cpp @@ -34,6 +34,8 @@ namespace mongo { + using std::string; + TEST( NamespaceTest, Basics ) { Namespace foo( "foo.bar" ); Namespace bar( "bar.foo" ); diff --git a/src/mongo/db/storage/mmap_v1/data_file.cpp b/src/mongo/db/storage/mmap_v1/data_file.cpp index d6c4a8a794c..da66be40b8a 100644 --- a/src/mongo/db/storage/mmap_v1/data_file.cpp +++ b/src/mongo/db/storage/mmap_v1/data_file.cpp @@ -45,6 +45,9 @@ namespace mongo { + + using std::endl; + namespace { void data_file_check(void *_mb) { diff --git a/src/mongo/db/storage/mmap_v1/data_file_sync.cpp b/src/mongo/db/storage/mmap_v1/data_file_sync.cpp index 74e64414467..46b682558bb 100644 --- a/src/mongo/db/storage/mmap_v1/data_file_sync.cpp +++ b/src/mongo/db/storage/mmap_v1/data_file_sync.cpp @@ -43,6 +43,8 @@ namespace mongo { + using std::endl; + DataFileSync dataFileSync; DataFileSync::DataFileSync() diff --git a/src/mongo/db/storage/mmap_v1/dur.cpp b/src/mongo/db/storage/mmap_v1/dur.cpp index 56f9f73d7a3..54fbb311eda 100644 --- a/src/mongo/db/storage/mmap_v1/dur.cpp +++ b/src/mongo/db/storage/mmap_v1/dur.cpp @@ -96,6 +96,16 @@ #include "mongo/util/timer.h" namespace mongo { + + using std::endl; + using std::fixed; + using std::hex; + using std::set; + using std::setprecision; + using std::setw; + using std::string; + using std::stringstream; + namespace dur { namespace { diff --git a/src/mongo/db/storage/mmap_v1/dur_commitjob.cpp b/src/mongo/db/storage/mmap_v1/dur_commitjob.cpp index 95a677ef991..480476d473f 100644 --- a/src/mongo/db/storage/mmap_v1/dur_commitjob.cpp +++ b/src/mongo/db/storage/mmap_v1/dur_commitjob.cpp @@ -47,6 +47,9 @@ namespace mongo { using boost::shared_ptr; + using std::endl; + using std::max; + using std::min; namespace dur { diff --git a/src/mongo/db/storage/mmap_v1/dur_journal.cpp b/src/mongo/db/storage/mmap_v1/dur_journal.cpp index d180e43726d..05a8a83fc2a 100644 --- a/src/mongo/db/storage/mmap_v1/dur_journal.cpp +++ b/src/mongo/db/storage/mmap_v1/dur_journal.cpp @@ -64,8 +64,11 @@ using namespace mongoutils; namespace mongo { - class AlignedBuilder; + using std::endl; + using std::hex; + using std::string; + class AlignedBuilder; namespace dur { // Rotate after reaching this data size in a journal (j._<n>) file diff --git a/src/mongo/db/storage/mmap_v1/dur_preplogbuffer.cpp b/src/mongo/db/storage/mmap_v1/dur_preplogbuffer.cpp index f32c4599177..1d1835f143a 100644 --- a/src/mongo/db/storage/mmap_v1/dur_preplogbuffer.cpp +++ b/src/mongo/db/storage/mmap_v1/dur_preplogbuffer.cpp @@ -54,6 +54,10 @@ namespace mongo { + using std::endl; + using std::min; + using std::stringstream; + namespace dur { extern Journal j; @@ -66,7 +70,7 @@ namespace mongo { error() << "findMMF_inlock failed " << privateViews.numberOfViews_inlock() << endl; printStackTrace(); // we want a stack trace and the assert below didn't print a trace once in the real world - not sure why stringstream ss; - ss << "view pointer cannot be resolved " << hex << (size_t) ptr; + ss << "view pointer cannot be resolved " << std::hex << (size_t) ptr; journalingFailure(ss.str().c_str()); // asserts, which then abends } return f; diff --git a/src/mongo/db/storage/mmap_v1/dur_recover.cpp b/src/mongo/db/storage/mmap_v1/dur_recover.cpp index 771726ce4b2..cedd7f3285b 100644 --- a/src/mongo/db/storage/mmap_v1/dur_recover.cpp +++ b/src/mongo/db/storage/mmap_v1/dur_recover.cpp @@ -63,6 +63,17 @@ namespace mongo { + using boost::shared_ptr; + using std::auto_ptr; + using std::endl; + using std::hex; + using std::map; + using std::pair; + using std::setw; + using std::string; + using std::stringstream; + using std::vector; + /** * Thrown when a journal section is corrupt. This is considered OK as long as it occurs while * processing the last file. Processing stops at the first corrupt section. diff --git a/src/mongo/db/storage/mmap_v1/dur_writetodatafiles.cpp b/src/mongo/db/storage/mmap_v1/dur_writetodatafiles.cpp index 58b4d15daba..8c9bd195119 100644 --- a/src/mongo/db/storage/mmap_v1/dur_writetodatafiles.cpp +++ b/src/mongo/db/storage/mmap_v1/dur_writetodatafiles.cpp @@ -40,6 +40,8 @@ namespace mongo { namespace dur { + using std::endl; + static void WRITETODATAFILES_Impl1(const JSectHeader& h, const AlignedBuilder& uncompressed) { LOG(3) << "journal WRITETODATAFILES 1" << endl; diff --git a/src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp b/src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp index f0546a63f35..603a5809861 100644 --- a/src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp +++ b/src/mongo/db/storage/mmap_v1/durable_mapped_file.cpp @@ -52,7 +52,13 @@ using namespace mongoutils; namespace mongo { + + using std::dec; + using std::endl; + using std::hex; + using std::map; using std::pair; + using std::string; void DurableMappedFile::remapThePrivateView() { verify(storageGlobalParams.dur); diff --git a/src/mongo/db/storage/mmap_v1/durop.cpp b/src/mongo/db/storage/mmap_v1/durop.cpp index 3d6102588dc..aa70b169f32 100644 --- a/src/mongo/db/storage/mmap_v1/durop.cpp +++ b/src/mongo/db/storage/mmap_v1/durop.cpp @@ -50,6 +50,8 @@ namespace mongo { using boost::scoped_array; using boost::shared_ptr; + using std::endl; + using std::string; namespace dur { diff --git a/src/mongo/db/storage/mmap_v1/extent.cpp b/src/mongo/db/storage/mmap_v1/extent.cpp index 4c880ee07d1..905e4d28a9e 100644 --- a/src/mongo/db/storage/mmap_v1/extent.cpp +++ b/src/mongo/db/storage/mmap_v1/extent.cpp @@ -36,6 +36,10 @@ namespace mongo { + using std::iostream; + using std::string; + using std::vector; + BOOST_STATIC_ASSERT( sizeof(Extent)-4 == 48+128 ); BSONObj Extent::dump() const { diff --git a/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp b/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp index 4be8ac12c06..6f82110b5d3 100644 --- a/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp +++ b/src/mongo/db/storage/mmap_v1/journal_latency_test_cmd.cpp @@ -54,6 +54,11 @@ namespace mongo { + using std::max; + using std::min; + using std::string; + using std::stringstream; + namespace dur { boost::filesystem::path getJournalDir(); } diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp index 529c46b37c6..6554adc5322 100644 --- a/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp +++ b/src/mongo/db/storage/mmap_v1/mmap_v1_database_catalog_entry.cpp @@ -57,6 +57,7 @@ namespace mongo { using boost::scoped_ptr; + using std::auto_ptr; namespace { diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp index 926e65b4740..090d0c87f8d 100644 --- a/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp +++ b/src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp @@ -53,6 +53,12 @@ namespace mongo { + using std::endl; + using std::ifstream; + using std::string; + using std::stringstream; + using std::vector; + namespace { #if !defined(__sunos__) diff --git a/src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp b/src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp index 7f1d873b369..99039a50049 100644 --- a/src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp +++ b/src/mongo/db/storage/mmap_v1/mmap_v1_extent_manager.cpp @@ -54,6 +54,12 @@ namespace mongo { + using std::auto_ptr; + using std::endl; + using std::max; + using std::string; + using std::stringstream; + // Turn on this failpoint to force the system to yield for a fetch. Setting to "alwaysOn" // will cause yields for fetching to occur on every 'kNeedsFetchFailFreq'th call to // recordNeedsFetch(). diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp index 733042390ec..d3ad195cfdf 100644 --- a/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp +++ b/src/mongo/db/storage/mmap_v1/record_store_v1_base.cpp @@ -48,6 +48,8 @@ namespace mongo { using boost::scoped_ptr; + using std::set; + using std::string; /* Deleted list buckets are used to quickly locate free space based on size. Each bucket contains records up to that size (meaning a record with a size exactly equal to diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp index e0093f3a4c8..98adeed89a9 100644 --- a/src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp +++ b/src/mongo/db/storage/mmap_v1/record_store_v1_capped.cpp @@ -61,6 +61,11 @@ namespace mongo { + using std::dec; + using std::endl; + using std::hex; + using std::vector; + CappedRecordStoreV1::CappedRecordStoreV1( OperationContext* txn, CappedDocumentDeleteCallback* collection, const StringData& ns, diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_capped_test.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_capped_test.cpp index cdd20a5da44..951164b214a 100644 --- a/src/mongo/db/storage/mmap_v1/record_store_v1_capped_test.cpp +++ b/src/mongo/db/storage/mmap_v1/record_store_v1_capped_test.cpp @@ -42,6 +42,9 @@ using namespace mongo; namespace { + using std::string; + using std::vector; + // Provides data to be inserted. Must be large enough for largest possible record. // Should be in BSS so unused portions should be free. char zeros[20*1024*1024] = {}; diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_repair_iterator.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_repair_iterator.cpp index b5a9d155759..7f8151dce81 100644 --- a/src/mongo/db/storage/mmap_v1/record_store_v1_repair_iterator.cpp +++ b/src/mongo/db/storage/mmap_v1/record_store_v1_repair_iterator.cpp @@ -38,6 +38,8 @@ namespace mongo { + using std::endl; + RecordStoreV1RepairIterator::RecordStoreV1RepairIterator(OperationContext* txn, const RecordStoreV1Base* recordStore) : _txn(txn), _recordStore(recordStore), _stage(FORWARD_SCAN) { diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp index eb718322a2f..1ede42c7f5f 100644 --- a/src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp +++ b/src/mongo/db/storage/mmap_v1/record_store_v1_simple.cpp @@ -51,6 +51,9 @@ namespace mongo { + using std::endl; + using std::vector; + static Counter64 freelistAllocs; static Counter64 freelistBucketExhausted; static Counter64 freelistIterations; @@ -229,7 +232,7 @@ namespace mongo { void SimpleRecordStoreV1::addDeletedRec( OperationContext* txn, const DiskLoc& dloc ) { DeletedRecord* d = drec( dloc ); - DEBUGGING log() << "TEMP: add deleted rec " << dloc.toString() << ' ' << hex << d->extentOfs() << endl; + DEBUGGING log() << "TEMP: add deleted rec " << dloc.toString() << ' ' << std::hex << d->extentOfs() << endl; int b = bucket(d->lengthWithHeaders()); *txn->recoveryUnit()->writing(&d->nextDeleted()) = _details->deletedListEntry(b); diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp index 2f1b0181ec8..58a5ceeb317 100644 --- a/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp +++ b/src/mongo/db/storage/mmap_v1/record_store_v1_simple_test.cpp @@ -39,6 +39,9 @@ using namespace mongo; namespace { + + using std::string; + TEST(SimpleRecordStoreV1, ChangeNoPaddingSetting) { OperationContextNoop txn; DummyExtentManager em; diff --git a/src/mongo/db/storage/mmap_v1/record_store_v1_test_help.cpp b/src/mongo/db/storage/mmap_v1/record_store_v1_test_help.cpp index 0cf7dc3f3fa..af789cc747b 100644 --- a/src/mongo/db/storage/mmap_v1/record_store_v1_test_help.cpp +++ b/src/mongo/db/storage/mmap_v1/record_store_v1_test_help.cpp @@ -46,6 +46,8 @@ namespace mongo { + using std::numeric_limits; + DummyRecordStoreV1MetaData::DummyRecordStoreV1MetaData( bool capped, int userFlags ) { _dataSize = 0; _numRecords = 0; diff --git a/src/mongo/db/storage/mmap_v1/repair_database.cpp b/src/mongo/db/storage/mmap_v1/repair_database.cpp index afd4c08a546..33992f4ccbc 100644 --- a/src/mongo/db/storage/mmap_v1/repair_database.cpp +++ b/src/mongo/db/storage/mmap_v1/repair_database.cpp @@ -56,6 +56,11 @@ namespace mongo { using boost::scoped_ptr; + using std::endl; + using std::map; + using std::string; + using std::stringstream; + using std::vector; typedef boost::filesystem::path Path; diff --git a/src/mongo/db/storage/record_store_test_docwriter.h b/src/mongo/db/storage/record_store_test_docwriter.h index e026e942f9b..b52cfd97335 100644 --- a/src/mongo/db/storage/record_store_test_docwriter.h +++ b/src/mongo/db/storage/record_store_test_docwriter.h @@ -32,8 +32,6 @@ #include "mongo/db/storage/record_store.h" -using std::string; - namespace mongo { namespace { diff --git a/src/mongo/db/storage/record_store_test_harness.cpp b/src/mongo/db/storage/record_store_test_harness.cpp index fd5ecbea1cc..466c0891251 100644 --- a/src/mongo/db/storage/record_store_test_harness.cpp +++ b/src/mongo/db/storage/record_store_test_harness.cpp @@ -38,6 +38,7 @@ namespace mongo { using boost::scoped_ptr; + using std::string; TEST( RecordStoreTestHarness, Simple1 ) { scoped_ptr<HarnessHelper> harnessHelper( newHarnessHelper() ); diff --git a/src/mongo/db/storage/record_store_test_updaterecord.h b/src/mongo/db/storage/record_store_test_updaterecord.h index 4ff21ae0e1c..ad1141671c0 100644 --- a/src/mongo/db/storage/record_store_test_updaterecord.h +++ b/src/mongo/db/storage/record_store_test_updaterecord.h @@ -35,8 +35,6 @@ #include "mongo/db/storage/record_store.h" #include "mongo/unittest/unittest.h" -using std::string; - namespace mongo { namespace { diff --git a/src/mongo/db/storage/record_store_test_validate.h b/src/mongo/db/storage/record_store_test_validate.h index 6682649f5da..c342e43dfda 100644 --- a/src/mongo/db/storage/record_store_test_validate.h +++ b/src/mongo/db/storage/record_store_test_validate.h @@ -37,10 +37,6 @@ #include "mongo/db/storage/record_store_test_harness.h" #include "mongo/unittest/unittest.h" -using std::set; -using std::string; -using std::stringstream; - namespace mongo { namespace { diff --git a/src/mongo/db/storage/sorted_data_interface_test_cursor_advanceto.cpp b/src/mongo/db/storage/sorted_data_interface_test_cursor_advanceto.cpp index b2d59de5ec1..b9802b763b3 100644 --- a/src/mongo/db/storage/sorted_data_interface_test_cursor_advanceto.cpp +++ b/src/mongo/db/storage/sorted_data_interface_test_cursor_advanceto.cpp @@ -38,6 +38,7 @@ namespace mongo { using boost::scoped_ptr; + using std::vector; // Insert multiple single-field keys and advance to each of them // using a forward cursor by specifying their exact key. When diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp index d6b2766c02c..82d77b08746 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index.cpp @@ -59,6 +59,10 @@ namespace mongo { namespace { + + using std::string; + using std::vector; + static const int TempKeyMaxSize = 1024; // this goes away with SERVER-3372 static const WiredTigerItem emptyItem(NULL, 0); diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_index_test.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_index_test.cpp index f070ee361d1..11e14e6b33e 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_index_test.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_index_test.cpp @@ -47,6 +47,8 @@ namespace mongo { + using std::string; + class MyHarnessHelper : public HarnessHelper { public: MyHarnessHelper() : _dbpath( "wt_test" ), _conn( NULL ) { diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp index 921847f1992..84543d3d439 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp @@ -55,6 +55,9 @@ namespace mongo { + using std::set; + using std::string; + namespace { int mdb_handle_error(WT_EVENT_HANDLER *handler, WT_SESSION *session, int errorCode, const char *message) { diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_parameters.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_parameters.cpp index 07df199cfcc..5be812178dc 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_parameters.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_parameters.cpp @@ -37,6 +37,8 @@ namespace mongo { +using std::string; + WiredTigerEngineRuntimeConfigParameter::WiredTigerEngineRuntimeConfigParameter( WiredTigerKVEngine* engine) : ServerParameter(ServerParameterSet::getGlobal(), diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp index bc5b647b4a1..e1fe44de5b1 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_record_store.cpp @@ -59,6 +59,7 @@ namespace mongo { using boost::scoped_ptr; + using std::string; namespace { static const int kMinimumRecordStoreVersion = 1; diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp index fb324881312..aad21c18eaa 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_size_storer.cpp @@ -43,6 +43,8 @@ namespace mongo { + using std::string; + namespace { int MAGIC = 123123; } diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp index 71fe57003dd..a73035b4f2b 100644 --- a/src/mongo/db/ttl.cpp +++ b/src/mongo/db/ttl.cpp @@ -56,6 +56,12 @@ namespace mongo { + using std::set; + using std::endl; + using std::list; + using std::string; + using std::vector; + Counter64 ttlPasses; Counter64 ttlDeletedDocuments; diff --git a/src/mongo/db/update_index_data.cpp b/src/mongo/db/update_index_data.cpp index fa96b7cfa1a..45e9f90c90c 100644 --- a/src/mongo/db/update_index_data.cpp +++ b/src/mongo/db/update_index_data.cpp @@ -34,6 +34,8 @@ namespace mongo { + using std::string; + UpdateIndexData::UpdateIndexData() : _allPathsIndexed( false ) { } void UpdateIndexData::addPath( const StringData& path ) { diff --git a/src/mongo/db/update_index_data_test.cpp b/src/mongo/db/update_index_data_test.cpp index b9b85023152..d011889e8fa 100644 --- a/src/mongo/db/update_index_data_test.cpp +++ b/src/mongo/db/update_index_data_test.cpp @@ -33,6 +33,8 @@ namespace mongo { + using std::string; + TEST( UpdateIndexDataTest, Simple1 ) { UpdateIndexData a; a.addPath( "a.b" ); diff --git a/src/mongo/db/write_concern.cpp b/src/mongo/db/write_concern.cpp index ed4fb8ac3a3..97db25a5c5b 100644 --- a/src/mongo/db/write_concern.cpp +++ b/src/mongo/db/write_concern.cpp @@ -42,6 +42,8 @@ namespace mongo { + using std::string; + static TimerStats gleWtimeStats; static ServerStatusMetricField<TimerStats> displayGleLatency("getLastError.wtime", &gleWtimeStats ); diff --git a/src/mongo/db/write_concern_options.cpp b/src/mongo/db/write_concern_options.cpp index 90690b87599..dd8b14cdb05 100644 --- a/src/mongo/db/write_concern_options.cpp +++ b/src/mongo/db/write_concern_options.cpp @@ -33,6 +33,8 @@ namespace mongo { + using std::string; + const BSONObj WriteConcernOptions::Default = BSONObj(); const BSONObj WriteConcernOptions::Acknowledged(BSON("w" << W_NORMAL)); const BSONObj WriteConcernOptions::AllConfigs = BSONObj(); |