diff options
author | Kaloian Manassiev <kaloianm@mongodb.com> | 2017-06-09 05:22:04 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2017-06-09 06:41:47 -0400 |
commit | 12a3661d030ecc827569cda5842c11b422d285c8 (patch) | |
tree | 8b745babedc8f8e0ad522682d470de320117821c /src/mongo/s | |
parent | 8d53685476630e6a0db502dab5fe35ad268ca44c (diff) | |
download | mongo-12a3661d030ecc827569cda5842c11b422d285c8.tar.gz |
SERVER-29464 Get rid of unused code in the write commands parsing
Diffstat (limited to 'src/mongo/s')
-rw-r--r-- | src/mongo/s/catalog/type_shard.h | 1 | ||||
-rw-r--r-- | src/mongo/s/write_ops/batched_command_response.cpp | 5 | ||||
-rw-r--r-- | src/mongo/s/write_ops/batched_command_response.h | 1 | ||||
-rw-r--r-- | src/mongo/s/write_ops/batched_delete_request.cpp | 26 | ||||
-rw-r--r-- | src/mongo/s/write_ops/batched_delete_request.h | 4 | ||||
-rw-r--r-- | src/mongo/s/write_ops/batched_insert_request.cpp | 2 | ||||
-rw-r--r-- | src/mongo/s/write_ops/batched_insert_request.h | 1 | ||||
-rw-r--r-- | src/mongo/s/write_ops/batched_update_request.cpp | 28 | ||||
-rw-r--r-- | src/mongo/s/write_ops/batched_update_request.h | 4 |
9 files changed, 6 insertions, 66 deletions
diff --git a/src/mongo/s/catalog/type_shard.h b/src/mongo/s/catalog/type_shard.h index be5c7075ef0..5e3ca3d8989 100644 --- a/src/mongo/s/catalog/type_shard.h +++ b/src/mongo/s/catalog/type_shard.h @@ -34,7 +34,6 @@ #include "mongo/db/jsobj.h" #include "mongo/s/shard_id.h" -#include "mongo/s/write_ops/batched_update_request.h" namespace mongo { diff --git a/src/mongo/s/write_ops/batched_command_response.cpp b/src/mongo/s/write_ops/batched_command_response.cpp index 5e949afa3ae..9a835a1cf3f 100644 --- a/src/mongo/s/write_ops/batched_command_response.cpp +++ b/src/mongo/s/write_ops/batched_command_response.cpp @@ -58,6 +58,11 @@ BatchedCommandResponse::BatchedCommandResponse() { clear(); } +BatchedCommandResponse::~BatchedCommandResponse() { + unsetErrDetails(); + unsetUpsertDetails(); +} + bool BatchedCommandResponse::isValid(std::string* errMsg) const { std::string dummy; if (errMsg == NULL) { diff --git a/src/mongo/s/write_ops/batched_command_response.h b/src/mongo/s/write_ops/batched_command_response.h index 0789d3cf2d7..49579da74a1 100644 --- a/src/mongo/s/write_ops/batched_command_response.h +++ b/src/mongo/s/write_ops/batched_command_response.h @@ -64,6 +64,7 @@ public: static const BSONField<WriteConcernErrorDetail*> writeConcernError; BatchedCommandResponse(); + ~BatchedCommandResponse(); BatchedCommandResponse(BatchedCommandResponse&&) = default; BatchedCommandResponse& operator=(BatchedCommandResponse&&) = default; diff --git a/src/mongo/s/write_ops/batched_delete_request.cpp b/src/mongo/s/write_ops/batched_delete_request.cpp index 74903579419..fd8a947b084 100644 --- a/src/mongo/s/write_ops/batched_delete_request.cpp +++ b/src/mongo/s/write_ops/batched_delete_request.cpp @@ -49,10 +49,6 @@ BatchedDeleteRequest::BatchedDeleteRequest() { clear(); } -BatchedDeleteRequest::~BatchedDeleteRequest() { - unsetDeletes(); -} - bool BatchedDeleteRequest::isValid(std::string* errMsg) const { std::string dummy; if (errMsg == NULL) { @@ -156,28 +152,6 @@ void BatchedDeleteRequest::clear() { _isOrderedSet = false; } -void BatchedDeleteRequest::cloneTo(BatchedDeleteRequest* other) const { - other->clear(); - - other->_ns = _ns; - other->_isNSSet = _isNSSet; - - for (std::vector<BatchedDeleteDocument*>::const_iterator it = _deletes.begin(); - it != _deletes.end(); - ++it) { - unique_ptr<BatchedDeleteDocument> tempBatchDeleteDocument(new BatchedDeleteDocument); - (*it)->cloneTo(tempBatchDeleteDocument.get()); - other->addToDeletes(tempBatchDeleteDocument.release()); - } - other->_isDeletesSet = _isDeletesSet; - - other->_writeConcern = _writeConcern; - other->_isWriteConcernSet = _isWriteConcernSet; - - other->_ordered = _ordered; - other->_isOrderedSet = _isOrderedSet; -} - std::string BatchedDeleteRequest::toString() const { return toBSON().toString(); } diff --git a/src/mongo/s/write_ops/batched_delete_request.h b/src/mongo/s/write_ops/batched_delete_request.h index 62a9e0034bc..5ed9d6718ff 100644 --- a/src/mongo/s/write_ops/batched_delete_request.h +++ b/src/mongo/s/write_ops/batched_delete_request.h @@ -64,10 +64,6 @@ public: // BatchedDeleteRequest(); - ~BatchedDeleteRequest(); - - /** Copies all the fields present in 'this' to 'other'. */ - void cloneTo(BatchedDeleteRequest* other) const; bool isValid(std::string* errMsg) const; BSONObj toBSON() const; diff --git a/src/mongo/s/write_ops/batched_insert_request.cpp b/src/mongo/s/write_ops/batched_insert_request.cpp index 69aa4927643..39849a45fd9 100644 --- a/src/mongo/s/write_ops/batched_insert_request.cpp +++ b/src/mongo/s/write_ops/batched_insert_request.cpp @@ -49,8 +49,6 @@ BatchedInsertRequest::BatchedInsertRequest() { clear(); } -BatchedInsertRequest::~BatchedInsertRequest() {} - bool BatchedInsertRequest::isValid(std::string* errMsg) const { std::string dummy; if (errMsg == NULL) { diff --git a/src/mongo/s/write_ops/batched_insert_request.h b/src/mongo/s/write_ops/batched_insert_request.h index 221d41d81db..6d642f248e1 100644 --- a/src/mongo/s/write_ops/batched_insert_request.h +++ b/src/mongo/s/write_ops/batched_insert_request.h @@ -63,7 +63,6 @@ public: // BatchedInsertRequest(); - ~BatchedInsertRequest(); /** Copies all the fields present in 'this' to 'other'. */ void cloneTo(BatchedInsertRequest* other) const; diff --git a/src/mongo/s/write_ops/batched_update_request.cpp b/src/mongo/s/write_ops/batched_update_request.cpp index 648c60938bf..fcfd506d521 100644 --- a/src/mongo/s/write_ops/batched_update_request.cpp +++ b/src/mongo/s/write_ops/batched_update_request.cpp @@ -50,10 +50,6 @@ BatchedUpdateRequest::BatchedUpdateRequest() { clear(); } -BatchedUpdateRequest::~BatchedUpdateRequest() { - unsetUpdates(); -} - bool BatchedUpdateRequest::isValid(std::string* errMsg) const { std::string dummy; if (errMsg == NULL) { @@ -167,30 +163,6 @@ void BatchedUpdateRequest::clear() { _shouldBypassValidation = false; } -void BatchedUpdateRequest::cloneTo(BatchedUpdateRequest* other) const { - other->clear(); - - other->_ns = _ns; - other->_isNSSet = _isNSSet; - - for (std::vector<BatchedUpdateDocument*>::const_iterator it = _updates.begin(); - it != _updates.end(); - ++it) { - unique_ptr<BatchedUpdateDocument> tempBatchUpdateDocument(new BatchedUpdateDocument); - (*it)->cloneTo(tempBatchUpdateDocument.get()); - other->addToUpdates(tempBatchUpdateDocument.release()); - } - other->_isUpdatesSet = _isUpdatesSet; - - other->_writeConcern = _writeConcern; - other->_isWriteConcernSet = _isWriteConcernSet; - - other->_ordered = _ordered; - other->_isOrderedSet = _isOrderedSet; - - other->_shouldBypassValidation = _shouldBypassValidation; -} - std::string BatchedUpdateRequest::toString() const { return toBSON().toString(); } diff --git a/src/mongo/s/write_ops/batched_update_request.h b/src/mongo/s/write_ops/batched_update_request.h index 791775c2784..c2f133f82b1 100644 --- a/src/mongo/s/write_ops/batched_update_request.h +++ b/src/mongo/s/write_ops/batched_update_request.h @@ -64,10 +64,6 @@ public: // BatchedUpdateRequest(); - ~BatchedUpdateRequest(); - - /** Copies all the fields present in 'this' to 'other'. */ - void cloneTo(BatchedUpdateRequest* other) const; bool isValid(std::string* errMsg) const; BSONObj toBSON() const; |