diff options
author | Shaun Verch <shaun.verch@10gen.com> | 2013-11-01 16:12:52 -0400 |
---|---|---|
committer | Shaun Verch <shaun.verch@10gen.com> | 2013-11-04 17:25:41 -0500 |
commit | d1f06420857ea4a3ed5b6f8ffd0304398cffa3cb (patch) | |
tree | 58acc45335ea7c51d840545685b54b8a8268228a | |
parent | 44680ab9835615856f144e9f027d91ef5b16682d (diff) | |
download | mongo-d1f06420857ea4a3ed5b6f8ffd0304398cffa3cb.tar.gz |
SERVER-11538: Create mongoclient library to avoid pulling in mongocommon
-rw-r--r-- | src/mongo/SConscript | 46 | ||||
-rw-r--r-- | src/mongo/client/dbclient_rs_test.cpp | 18 | ||||
-rw-r--r-- | src/mongo/db/server_options.cpp | 39 | ||||
-rw-r--r-- | src/mongo/db/server_options.h | 33 | ||||
-rw-r--r-- | src/mongo/s/SConscript | 11 | ||||
-rw-r--r-- | src/mongo/s/chunk_diff_test.cpp | 9 | ||||
-rw-r--r-- | src/mongo/s/collection_metadata_test.cpp | 9 | ||||
-rw-r--r-- | src/mongo/s/metadata_loader_test.cpp | 9 |
8 files changed, 53 insertions, 121 deletions
diff --git a/src/mongo/SConscript b/src/mongo/SConscript index 150f7861ade..0d89adb7855 100644 --- a/src/mongo/SConscript +++ b/src/mongo/SConscript @@ -237,6 +237,19 @@ env.StaticLibrary('network', [ 'server_options_core', ]) +env.StaticLibrary('clientdriver', [ + "client/connpool.cpp", + "client/dbclient.cpp", + "client/dbclient_rs.cpp", + "client/dbclientcursor.cpp", + 'client/sasl_client_authenticate.cpp', + "client/syncclusterconnection.cpp", + "db/dbmessage.cpp" + ], + LIBDEPS=['auth_helpers', + 'network', + ]) + commonFiles = [ "pch.cpp", "buildinfo.cpp", "db/lasterror.cpp", @@ -257,13 +270,6 @@ commonFiles = [ "pch.cpp", "util/stack_introspect.cpp", "util/startup_test.cpp", "util/version.cpp", - "client/connpool.cpp", - "client/dbclient.cpp", - "client/dbclient_rs.cpp", - "client/dbclientcursor.cpp", - 'client/sasl_client_authenticate.cpp', - "client/syncclusterconnection.cpp", - "db/dbmessage.cpp" ] extraCommonLibdeps = [] @@ -318,17 +324,18 @@ env.StaticLibrary("fail_point", env.StaticLibrary('mongocommon', commonFiles, LIBDEPS=['auth_helpers', 'bson', + 'background_job', + 'clientdriver', + 'fail_point', 'foundation', - 'mongohasher', 'md5', + 'mongohasher', + 'network', 'processinfo', - 'synchronization', + 'spin_lock', 'stacktrace', 'stringutils', - 'fail_point', - 'spin_lock', - 'background_job', - 'network', + 'synchronization', 'util/concurrency/thread_name', '$BUILD_DIR/third_party/shim_pcrecpp', '$BUILD_DIR/third_party/murmurhash3/murmurhash3', @@ -421,6 +428,7 @@ env.StaticLibrary("coredb", [ '$BUILD_DIR/third_party/shim_snappy', 'server_options', '$BUILD_DIR/mongo/util/cmdline_utils/cmdline_utils', + 'clientdriver', ]) coreServerFiles = [ "db/client_basic.cpp", @@ -700,15 +708,7 @@ env.CppUnitTest( "balancer_policy_test" , [ "s/balancer_policy_tests.cpp" ] , NO_CRUTCH=True) env.CppUnitTest("dbclient_rs_test", [ "client/dbclient_rs_test.cpp" ], - LIBDEPS=[ - "coredb", - "coreserver", - "coreshard", - "mocklib", - "mongocommon", - "message_server_port", - "mongoscore"], - NO_CRUTCH=True) + LIBDEPS=['clientdriver', 'mocklib']) env.CppUnitTest("scoped_db_conn_test", [ "client/scoped_db_conn_test.cpp" ], LIBDEPS=[ @@ -988,7 +988,7 @@ env.StaticLibrary('mocklib', [ 'dbtests/mock/mock_remote_db_server.cpp', 'dbtests/mock/mock_replica_set.cpp' ], - LIBDEPS=['mongocommon']) + LIBDEPS=['clientdriver']) test = testEnv.Install( '#/', diff --git a/src/mongo/client/dbclient_rs_test.cpp b/src/mongo/client/dbclient_rs_test.cpp index d8c2c1b874f..32527fc7c59 100644 --- a/src/mongo/client/dbclient_rs_test.cpp +++ b/src/mongo/client/dbclient_rs_test.cpp @@ -33,24 +33,6 @@ #include <string> #include <vector> -namespace mongo { - // Symbols defined to build the binary correctly. - - bool inShutdown() { - return false; - } - - DBClientBase *createDirectClient() { return NULL; } - - void dbexit(ExitCode rc, const char *why){ - ::_exit(rc); - } - - bool haveLocalShardingInfo(const string& ns) { - return false; - } -} - namespace { using boost::scoped_ptr; using std::auto_ptr; diff --git a/src/mongo/db/server_options.cpp b/src/mongo/db/server_options.cpp index a16bc1652f2..5ded399409c 100644 --- a/src/mongo/db/server_options.cpp +++ b/src/mongo/db/server_options.cpp @@ -1,35 +1,28 @@ -/* - * Copyright (C) 2013 10gen Inc. +/* Copyright 2013 10gen Inc. * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * As a special exception, the copyright holders give permission to link the - * code of portions of this program with the OpenSSL library under certain - * conditions as described in each individual source file and distribute - * linked combinations including the program with the OpenSSL library. You - * must comply with the GNU Affero General Public License in all respects for - * all of the code used other than as permitted herein. If you modify file(s) - * with this exception, you may extend this exception to your version of the - * file(s), but you are not obligated to do so. If you do not wish to do so, - * delete this exception statement from your version. If you delete this - * exception statement from all source files in the program, then also delete - * it in the license file. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include "mongo/db/server_options.h" namespace mongo { + /** + * This struct represents global configuration data for the server. These options get set from + * the command line and are used inline in the code. Note that much shared code uses this + * struct, which is why it is here in its own file rather than in the same file as the code that + * sets it via the command line, which would pull in more dependencies. + */ ServerGlobalParams serverGlobalParams; } // namespace mongo diff --git a/src/mongo/db/server_options.h b/src/mongo/db/server_options.h index 583f10f8737..e051c79adf9 100644 --- a/src/mongo/db/server_options.h +++ b/src/mongo/db/server_options.h @@ -1,29 +1,16 @@ -/* - * Copyright (C) 2013 10gen Inc. +/* Copyright 2013 10gen Inc. * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. + * http://www.apache.org/licenses/LICENSE-2.0 * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - * As a special exception, the copyright holders give permission to link the - * code of portions of this program with the OpenSSL library under certain - * conditions as described in each individual source file and distribute - * linked combinations including the program with the OpenSSL library. You - * must comply with the GNU Affero General Public License in all respects for - * all of the code used other than as permitted herein. If you modify file(s) - * with this exception, you may extend this exception to your version of the - * file(s), but you are not obligated to do so. If you do not wish to do so, - * delete this exception statement from your version. If you delete this - * exception statement from all source files in the program, then also delete - * it in the license file. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #pragma once diff --git a/src/mongo/s/SConscript b/src/mongo/s/SConscript index d506dfb1ae9..7b98b631365 100644 --- a/src/mongo/s/SConscript +++ b/src/mongo/s/SConscript @@ -104,28 +104,25 @@ env.StaticLibrary('metadata', ['collection_metadata.cpp', LIBDEPS=['base', '$BUILD_DIR/mongo/bson', '$BUILD_DIR/mongo/base/base', - '$BUILD_DIR/mongo/mongocommon', # DBClient library + '$BUILD_DIR/mongo/clientdriver', ]) env.CppUnitTest('chunk_diff_test', 'chunk_diff_test.cpp', LIBDEPS=['metadata', - '$BUILD_DIR/mongo/db/common'], - NO_CRUTCH=True) + '$BUILD_DIR/mongo/db/common']) env.CppUnitTest('collection_metadata_test', 'collection_metadata_test.cpp', LIBDEPS=['metadata', '$BUILD_DIR/mongo/mocklib', - '$BUILD_DIR/mongo/db/common'], - NO_CRUTCH=True) + '$BUILD_DIR/mongo/db/common']) env.CppUnitTest('metadata_loader_test', 'metadata_loader_test.cpp', LIBDEPS=['metadata', '$BUILD_DIR/mongo/mocklib', - '$BUILD_DIR/mongo/db/common'], - NO_CRUTCH=True) + '$BUILD_DIR/mongo/db/common']) # # Write Operations diff --git a/src/mongo/s/chunk_diff_test.cpp b/src/mongo/s/chunk_diff_test.cpp index c4c3d2f1120..5a9b61068d5 100644 --- a/src/mongo/s/chunk_diff_test.cpp +++ b/src/mongo/s/chunk_diff_test.cpp @@ -33,15 +33,6 @@ #include "mongo/s/chunk_diff.h" #include "mongo/unittest/unittest.h" -namespace mongo { - - // Temporary crutches to allow us to link against libraries that need this symbol - bool inShutdown() { - return false; - } - -} // namespace mongo - namespace { using mongo::BSONObj; diff --git a/src/mongo/s/collection_metadata_test.cpp b/src/mongo/s/collection_metadata_test.cpp index ed43d20184e..10fd97a8f5e 100644 --- a/src/mongo/s/collection_metadata_test.cpp +++ b/src/mongo/s/collection_metadata_test.cpp @@ -42,15 +42,6 @@ #include "mongo/unittest/unittest.h" #include "mongo/util/net/hostandport.h" -namespace mongo { - - // Temporary crutches to allow us to link against libraries that need this symbol - bool inShutdown() { - return false; - } - -} // namespace mongo - namespace { using boost::scoped_ptr; diff --git a/src/mongo/s/metadata_loader_test.cpp b/src/mongo/s/metadata_loader_test.cpp index cef823d9673..0f8f0feb00a 100644 --- a/src/mongo/s/metadata_loader_test.cpp +++ b/src/mongo/s/metadata_loader_test.cpp @@ -44,15 +44,6 @@ #include "mongo/unittest/unittest.h" #include "mongo/util/net/hostandport.h" -namespace mongo { - - // Temporary crutches to allow us to link against libraries that need this symbol - bool inShutdown() { - return false; - } - -} // namespace mongo - namespace { using boost::scoped_ptr; |