summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-06-03 11:01:10 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-06-03 12:53:58 -0400
commitafb7ac5a82b0a2fa83d94018eb6f98a4f6aa4ffc (patch)
tree5f3fc7cb8e7723a9d5c5c0e122d2332930dab13f
parentcc59f160a2f10e69419bb17d4561950fa6fd78f8 (diff)
downloadmongo-afb7ac5a82b0a2fa83d94018eb6f98a4f6aa4ffc.tar.gz
SERVER-18798 Move FindAndModifyRequest to the request/response library
-rw-r--r--src/mongo/client/SConscript13
-rw-r--r--src/mongo/db/SConscript5
-rw-r--r--src/mongo/db/auth/SConscript15
-rw-r--r--src/mongo/db/catalog/collection.cpp1
-rw-r--r--src/mongo/db/clientcursor.cpp2
-rw-r--r--src/mongo/db/clientcursor.h8
-rw-r--r--src/mongo/db/commands/find_and_modify.cpp2
-rw-r--r--src/mongo/db/dbcommands.cpp1
-rw-r--r--src/mongo/db/dbhelpers.cpp1
-rw-r--r--src/mongo/db/dbhelpers.h2
-rw-r--r--src/mongo/db/field_parser.cpp4
-rw-r--r--src/mongo/db/field_ref_set.cpp3
-rw-r--r--src/mongo/db/query/SConscript18
-rw-r--r--src/mongo/db/query/find_and_modify_request.cpp (renamed from src/mongo/client/find_and_modify_request.cpp)2
-rw-r--r--src/mongo/db/query/find_and_modify_request.h (renamed from src/mongo/client/find_and_modify_request.h)0
-rw-r--r--src/mongo/db/query/find_and_modify_request_test.cpp (renamed from src/mongo/client/find_and_modify_request_test.cpp)2
-rw-r--r--src/mongo/db/write_concern_options.cpp3
-rw-r--r--src/mongo/db/write_concern_options.h3
-rw-r--r--src/mongo/s/catalog/SConscript4
-rw-r--r--src/mongo/s/catalog/dist_lock_catalog_impl.cpp2
-rw-r--r--src/mongo/s/catalog/dist_lock_catalog_impl_test.cpp2
21 files changed, 42 insertions, 51 deletions
diff --git a/src/mongo/client/SConscript b/src/mongo/client/SConscript
index 8e6f8ae84bd..83dd6bae95f 100644
--- a/src/mongo/client/SConscript
+++ b/src/mongo/client/SConscript
@@ -90,7 +90,6 @@ env.Library(
env.Library(
target='remote_command_runner',
source=[
- 'find_and_modify_request.cpp',
'remote_command_runner.cpp',
],
LIBDEPS=[
@@ -109,7 +108,7 @@ env.Library(
LIBDEPS=[
'connection_pool',
'remote_command_runner',
- '$BUILD_DIR/mongo/db/query/getmore_request_response',
+ '$BUILD_DIR/mongo/db/query/command_request_response',
'$BUILD_DIR/mongo/db/query/lite_parsed_query',
]
)
@@ -211,13 +210,3 @@ env.Library(
LIBDEPS=[
],
)
-
-env.CppUnitTest(
- target="find_and_modify_request_test",
- source=[
- "find_and_modify_request_test.cpp",
- ],
- LIBDEPS=[
- 'remote_command_runner'
- ]
-)
diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript
index 3c1c9ae3399..f3d17d574a1 100644
--- a/src/mongo/db/SConscript
+++ b/src/mongo/db/SConscript
@@ -42,10 +42,9 @@ env.Library(
],
LIBDEPS=[
'$BUILD_DIR/mongo/bson/bson',
- '$BUILD_DIR/mongo/util/foundation',
'$BUILD_DIR/mongo/db/index_names',
- '$BUILD_DIR/mongo/db/service_context',
- ],
+ '$BUILD_DIR/mongo/util/foundation',
+ ]
)
env.CppUnitTest(
diff --git a/src/mongo/db/auth/SConscript b/src/mongo/db/auth/SConscript
index 94fa4f24f74..c07d1cb04bb 100644
--- a/src/mongo/db/auth/SConscript
+++ b/src/mongo/db/auth/SConscript
@@ -114,10 +114,17 @@ env.Library('authmongos',
LIBDEPS=['authservercommon',
'$BUILD_DIR/mongo/s/catalog/dist_lock_manager'])
-env.Library('authmocks',
- ['authz_manager_external_state_mock.cpp'],
- LIBDEPS=['$BUILD_DIR/mongo/db/ops/update_driver',
- '$BUILD_DIR/mongo/db/matcher/expressions'])
+env.Library(
+ target='authmocks',
+ source=[
+ 'authz_manager_external_state_mock.cpp'
+ ],
+ LIBDEPS=[
+ '$BUILD_DIR/mongo/db/matcher/expressions',
+ '$BUILD_DIR/mongo/db/ops/update_driver',
+ '$BUILD_DIR/mongo/db/service_context',
+ ]
+)
env.Library('sasltestcrutch',
['sasl_test_crutch.cpp'],
diff --git a/src/mongo/db/catalog/collection.cpp b/src/mongo/db/catalog/collection.cpp
index b78d3b5a9c7..cd044530418 100644
--- a/src/mongo/db/catalog/collection.cpp
+++ b/src/mongo/db/catalog/collection.cpp
@@ -46,6 +46,7 @@
#include "mongo/db/commands/server_status_metric.h"
#include "mongo/db/curop.h"
#include "mongo/db/index/index_access_method.h"
+#include "mongo/db/keypattern.h"
#include "mongo/db/matcher/expression_parser.h"
#include "mongo/db/op_observer.h"
#include "mongo/db/operation_context.h"
diff --git a/src/mongo/db/clientcursor.cpp b/src/mongo/db/clientcursor.cpp
index 84fe0017e18..c35c75dd88d 100644
--- a/src/mongo/db/clientcursor.cpp
+++ b/src/mongo/db/clientcursor.cpp
@@ -33,7 +33,6 @@
#include <vector>
#include "mongo/base/counter.h"
-#include "mongo/client/dbclientinterface.h"
#include "mongo/db/audit.h"
#include "mongo/db/auth/action_set.h"
#include "mongo/db/auth/action_type.h"
@@ -49,6 +48,7 @@
#include "mongo/db/repl/repl_client_info.h"
#include "mongo/db/repl/replication_coordinator_global.h"
#include "mongo/db/server_parameters.h"
+#include "mongo/util/background.h"
#include "mongo/util/exit.h"
namespace mongo {
diff --git a/src/mongo/db/clientcursor.h b/src/mongo/db/clientcursor.h
index f5350ff5707..18e64a4c0fe 100644
--- a/src/mongo/db/clientcursor.h
+++ b/src/mongo/db/clientcursor.h
@@ -30,26 +30,18 @@
#include <boost/noncopyable.hpp>
#include <boost/scoped_ptr.hpp>
-#include <boost/thread/recursive_mutex.hpp>
#include "mongo/db/jsobj.h"
-#include "mongo/db/keypattern.h"
#include "mongo/db/query/plan_executor.h"
#include "mongo/db/record_id.h"
#include "mongo/s/collection_metadata.h"
-#include "mongo/util/background.h"
#include "mongo/util/net/message.h"
namespace mongo {
- typedef boost::lock_guard<boost::recursive_mutex> recursive_scoped_lock;
class ClientCursor;
class Collection;
- class CurOp;
class CursorManager;
- class Database;
- class NamespaceDetails;
- class ParsedQuery;
class RecoveryUnit;
typedef long long CursorId; /* passed to the client so it can send back on getMore */
diff --git a/src/mongo/db/commands/find_and_modify.cpp b/src/mongo/db/commands/find_and_modify.cpp
index f4ad2ae3891..9170e5af7a2 100644
--- a/src/mongo/db/commands/find_and_modify.cpp
+++ b/src/mongo/db/commands/find_and_modify.cpp
@@ -38,7 +38,6 @@
#include "mongo/base/status_with.h"
#include "mongo/bson/bsonobj.h"
#include "mongo/bson/bsonobjbuilder.h"
-#include "mongo/client/find_and_modify_request.h"
#include "mongo/db/catalog/document_validation.h"
#include "mongo/db/client.h"
#include "mongo/db/commands.h"
@@ -55,6 +54,7 @@
#include "mongo/db/ops/update_lifecycle_impl.h"
#include "mongo/db/ops/update_request.h"
#include "mongo/db/query/explain.h"
+#include "mongo/db/query/find_and_modify_request.h"
#include "mongo/db/query/get_executor.h"
#include "mongo/db/query/plan_executor.h"
#include "mongo/db/repl/repl_client_info.h"
diff --git a/src/mongo/db/dbcommands.cpp b/src/mongo/db/dbcommands.cpp
index 4dda571ab5a..a8fa185b86f 100644
--- a/src/mongo/db/dbcommands.cpp
+++ b/src/mongo/db/dbcommands.cpp
@@ -75,6 +75,7 @@
#include "mongo/db/introspect.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/json.h"
+#include "mongo/db/keypattern.h"
#include "mongo/db/lasterror.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/op_observer.h"
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp
index f1c8f9ed6ce..a56fb037464 100644
--- a/src/mongo/db/dbhelpers.cpp
+++ b/src/mongo/db/dbhelpers.cpp
@@ -37,7 +37,6 @@
#include <boost/filesystem/operations.hpp>
#include <fstream>
-#include "mongo/client/dbclientinterface.h"
#include "mongo/db/catalog/collection.h"
#include "mongo/db/catalog/index_create.h"
#include "mongo/db/db.h"
diff --git a/src/mongo/db/dbhelpers.h b/src/mongo/db/dbhelpers.h
index d149176a443..a5e173773ca 100644
--- a/src/mongo/db/dbhelpers.h
+++ b/src/mongo/db/dbhelpers.h
@@ -30,10 +30,8 @@
#include <boost/filesystem/path.hpp>
-#include "mongo/db/client.h"
#include "mongo/db/db.h"
#include "mongo/db/record_id.h"
-#include "mongo/db/keypattern.h"
namespace mongo {
diff --git a/src/mongo/db/field_parser.cpp b/src/mongo/db/field_parser.cpp
index 1dbca72c2c7..6437c35febf 100644
--- a/src/mongo/db/field_parser.cpp
+++ b/src/mongo/db/field_parser.cpp
@@ -26,13 +26,13 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/field_parser.h"
-#include "mongo/util/mongoutils/str.h"
namespace mongo {
using std::string;
- using mongoutils::str::stream;
FieldParser::FieldState FieldParser::extract( BSONObj doc,
const BSONField<bool>& field,
diff --git a/src/mongo/db/field_ref_set.cpp b/src/mongo/db/field_ref_set.cpp
index efc49f2dd1d..1ec099c7c7b 100644
--- a/src/mongo/db/field_ref_set.cpp
+++ b/src/mongo/db/field_ref_set.cpp
@@ -26,6 +26,8 @@
* it in the license file.
*/
+#include "mongo/platform/basic.h"
+
#include "mongo/db/field_ref_set.h"
#include "mongo/util/assert_util.h"
@@ -35,7 +37,6 @@ namespace mongo {
using std::vector;
using std::string;
- namespace str = mongoutils::str;
namespace {
diff --git a/src/mongo/db/query/SConscript b/src/mongo/db/query/SConscript
index c34f05476b3..66f00e9696c 100644
--- a/src/mongo/db/query/SConscript
+++ b/src/mongo/db/query/SConscript
@@ -23,7 +23,7 @@ env.Library(
],
LIBDEPS=[
"explain_common",
- "getmore_request_response",
+ "command_request_response",
"index_bounds",
"lite_parsed_query",
"$BUILD_DIR/mongo/bson/bson",
@@ -99,24 +99,28 @@ env.Library(
)
env.Library(
- target='getmore_request_response',
+ target='command_request_response',
source=[
'cursor_responses.cpp',
+ 'find_and_modify_request.cpp',
'getmore_request.cpp',
],
LIBDEPS=[
'$BUILD_DIR/mongo/bson/bson',
- ],
+ '$BUILD_DIR/mongo/db/common',
+ '$BUILD_DIR/mongo/db/namespace_string',
+ ]
)
env.CppUnitTest(
- target="getmore_request_test",
+ target='command_request_response_test',
source=[
- "getmore_request_test.cpp"
+ 'find_and_modify_request_test.cpp',
+ 'getmore_request_test.cpp',
],
LIBDEPS=[
- "getmore_request_response",
- ],
+ 'command_request_response',
+ ]
)
env.Library(
diff --git a/src/mongo/client/find_and_modify_request.cpp b/src/mongo/db/query/find_and_modify_request.cpp
index 691b3900e87..013baeb5079 100644
--- a/src/mongo/client/find_and_modify_request.cpp
+++ b/src/mongo/db/query/find_and_modify_request.cpp
@@ -28,7 +28,7 @@
#include "mongo/platform/basic.h"
-#include "mongo/client/find_and_modify_request.h"
+#include "mongo/db/query/find_and_modify_request.h"
#include "mongo/base/status_with.h"
#include "mongo/bson/bsonobjbuilder.h"
diff --git a/src/mongo/client/find_and_modify_request.h b/src/mongo/db/query/find_and_modify_request.h
index 569f1c66aaf..569f1c66aaf 100644
--- a/src/mongo/client/find_and_modify_request.h
+++ b/src/mongo/db/query/find_and_modify_request.h
diff --git a/src/mongo/client/find_and_modify_request_test.cpp b/src/mongo/db/query/find_and_modify_request_test.cpp
index f782b36245f..bde2c48ac2e 100644
--- a/src/mongo/client/find_and_modify_request_test.cpp
+++ b/src/mongo/db/query/find_and_modify_request_test.cpp
@@ -29,7 +29,7 @@
#include "mongo/platform/basic.h"
#include "mongo/bson/json.h"
-#include "mongo/client/find_and_modify_request.h"
+#include "mongo/db/query/find_and_modify_request.h"
#include "mongo/unittest/unittest.h"
namespace mongo {
diff --git a/src/mongo/db/write_concern_options.cpp b/src/mongo/db/write_concern_options.cpp
index 7f1ce2e13ff..c8c2041154f 100644
--- a/src/mongo/db/write_concern_options.cpp
+++ b/src/mongo/db/write_concern_options.cpp
@@ -27,9 +27,8 @@
#include "mongo/db/write_concern_options.h"
-#include "mongo/client/dbclientinterface.h"
+#include "mongo/base/status.h"
#include "mongo/db/field_parser.h"
-#include "mongo/db/jsobj.h"
namespace mongo {
diff --git a/src/mongo/db/write_concern_options.h b/src/mongo/db/write_concern_options.h
index 6b3cee6d147..2bfae25cf64 100644
--- a/src/mongo/db/write_concern_options.h
+++ b/src/mongo/db/write_concern_options.h
@@ -29,11 +29,12 @@
#include <string>
-#include "mongo/base/status.h"
#include "mongo/db/jsobj.h"
namespace mongo {
+ class Status;
+
struct WriteConcernOptions {
public:
diff --git a/src/mongo/s/catalog/SConscript b/src/mongo/s/catalog/SConscript
index 14dfa7ac420..cb074a225e7 100644
--- a/src/mongo/s/catalog/SConscript
+++ b/src/mongo/s/catalog/SConscript
@@ -91,10 +91,10 @@ env.Library(
'$BUILD_DIR/mongo/client/remote_command_runner',
'$BUILD_DIR/mongo/client/remote_command_targeter',
'$BUILD_DIR/mongo/db/common',
- '$BUILD_DIR/mongo/db/namespace_string',
+ '$BUILD_DIR/mongo/db/query/command_request_response',
+ '$BUILD_DIR/mongo/rpc/command_status',
'$BUILD_DIR/mongo/s/base',
'$BUILD_DIR/mongo/s/batch_write_types',
- '$BUILD_DIR/mongo/rpc/command_status',
'$BUILD_DIR/mongo/util/net/hostandport',
],
)
diff --git a/src/mongo/s/catalog/dist_lock_catalog_impl.cpp b/src/mongo/s/catalog/dist_lock_catalog_impl.cpp
index 00f936b2293..11cda5baaea 100644
--- a/src/mongo/s/catalog/dist_lock_catalog_impl.cpp
+++ b/src/mongo/s/catalog/dist_lock_catalog_impl.cpp
@@ -35,11 +35,11 @@
#include "mongo/base/status.h"
#include "mongo/base/status_with.h"
#include "mongo/bson/util/bson_extract.h"
-#include "mongo/client/find_and_modify_request.h"
#include "mongo/client/read_preference.h"
#include "mongo/client/remote_command_runner.h"
#include "mongo/client/remote_command_targeter.h"
#include "mongo/db/lasterror.h"
+#include "mongo/db/query/find_and_modify_request.h"
#include "mongo/rpc/get_status_from_command_result.h"
#include "mongo/s/type_lockpings.h"
#include "mongo/s/type_locks.h"
diff --git a/src/mongo/s/catalog/dist_lock_catalog_impl_test.cpp b/src/mongo/s/catalog/dist_lock_catalog_impl_test.cpp
index e41f9060746..7ca41094f95 100644
--- a/src/mongo/s/catalog/dist_lock_catalog_impl_test.cpp
+++ b/src/mongo/s/catalog/dist_lock_catalog_impl_test.cpp
@@ -31,10 +31,10 @@
#include "mongo/base/status.h"
#include "mongo/base/status_with.h"
#include "mongo/bson/json.h"
-#include "mongo/client/find_and_modify_request.h"
#include "mongo/client/remote_command_runner_mock.h"
#include "mongo/client/remote_command_targeter_mock.h"
#include "mongo/db/jsobj.h"
+#include "mongo/db/query/find_and_modify_request.h"
#include "mongo/s/catalog/dist_lock_catalog_impl.h"
#include "mongo/s/type_lockpings.h"
#include "mongo/s/type_locks.h"