summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-03-11 14:44:09 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-03-11 17:44:25 -0400
commitf931ac5fa8d69d1b3e08267cd47ba14e5b3b30e2 (patch)
tree00a81d87222674efc58844b6dc9f54acfa877d75
parent346c9c7f9c802fb57931a62b2f2e402f07c8c805 (diff)
downloadmongo-f931ac5fa8d69d1b3e08267cd47ba14e5b3b30e2.tar.gz
SERVER-17496 sharding_client library
-rw-r--r--src/mongo/SConscript16
-rw-r--r--src/mongo/db/auth/security_key.h2
-rw-r--r--src/mongo/s/client/SConscript29
-rw-r--r--src/mongo/s/client/shard_connection_test.cpp (renamed from src/mongo/s/shard_conn_test.cpp)5
4 files changed, 35 insertions, 17 deletions
diff --git a/src/mongo/SConscript b/src/mongo/SConscript
index fb8b81e15fd..d983cae0f90 100644
--- a/src/mongo/SConscript
+++ b/src/mongo/SConscript
@@ -48,6 +48,7 @@ env.SConscript(['base/SConscript',
'installer/msi/SConscript',
'logger/SConscript',
'platform/SConscript',
+ 's/client/SConscript',
's/commands/SConscript',
's/SConscript',
'unittest/SConscript',
@@ -555,7 +556,6 @@ coredbEnv.Library("coredb", [
"db/pipeline/expression.cpp",
"db/projection.cpp",
"db/stats/timer_stats.cpp",
- "s/client/shard_connection.cpp",
],
LIBDEPS=['db/auth/serverauth',
'db/commands/server_status_core',
@@ -848,7 +848,8 @@ env.Library('coreshard',
],
LIBDEPS=[
's/base',
- 's/cluster_ops_impl'
+ 's/client/sharding_client',
+ 's/cluster_ops_impl',
])
env.Library('mongoscore',
@@ -898,17 +899,6 @@ env.CppUnitTest("scoped_db_conn_test", [ "client/scoped_db_conn_test.cpp" ],
"mongoscore"],
NO_CRUTCH=True)
-env.CppUnitTest("shard_conn_test", [ "s/shard_conn_test.cpp" ],
- LIBDEPS=[
- "mongoscore",
- "coreshard",
- "mongocommon",
- "coreserver",
- "coredb",
- "message_server_port",
- "mocklib",
- "$BUILD_DIR/mongo/db/auth/authmocks"])
-
env.CppUnitTest("shard_test", [ "s/shard_test.cpp" ],
LIBDEPS=[ "mongoscore",
"coreshard",
diff --git a/src/mongo/db/auth/security_key.h b/src/mongo/db/auth/security_key.h
index ce54ec8c1e4..a250b34a029 100644
--- a/src/mongo/db/auth/security_key.h
+++ b/src/mongo/db/auth/security_key.h
@@ -30,8 +30,6 @@
#include <string>
-#include "mongo/client/dbclientinterface.h"
-
namespace mongo {
/**
* This method checks the validity of filename as a security key, hashes its
diff --git a/src/mongo/s/client/SConscript b/src/mongo/s/client/SConscript
new file mode 100644
index 00000000000..af88c51d786
--- /dev/null
+++ b/src/mongo/s/client/SConscript
@@ -0,0 +1,29 @@
+# -*- mode: python -*-
+
+Import("env")
+
+env.Library(
+ target='sharding_client',
+ source=[
+ 'shard_connection.cpp',
+ ],
+ LIBDEPS=[
+ '$BUILD_DIR/mongo/clientdriver',
+ ]
+)
+
+env.CppUnitTest(
+ target='sharding_client_test',
+ source=[
+ 'shard_connection_test.cpp'
+ ],
+ LIBDEPS=[
+ 'sharding_client',
+ '$BUILD_DIR/mongo/coredb',
+ '$BUILD_DIR/mongo/coreserver',
+ '$BUILD_DIR/mongo/coreshard',
+ '$BUILD_DIR/mongo/mongoscore',
+ '$BUILD_DIR/mongo/mongocommon',
+ '$BUILD_DIR/mongo/mocklib',
+ ]
+)
diff --git a/src/mongo/s/shard_conn_test.cpp b/src/mongo/s/client/shard_connection_test.cpp
index 696a5b46b2b..233f7c6e9e2 100644
--- a/src/mongo/s/shard_conn_test.cpp
+++ b/src/mongo/s/client/shard_connection_test.cpp
@@ -54,7 +54,7 @@ using mongo::ShardConnection;
using std::string;
using std::vector;
-namespace mongo_test {
+namespace {
const string TARGET_HOST = "$dummy:27017";
/**
@@ -311,4 +311,5 @@ namespace mongo_test {
checkNewConns(assertNotEqual, conn2CreationTime, 10);
conn1Again.done();
}
-}
+
+} // namespace