summaryrefslogtreecommitdiff
path: root/src/mongo/s/write_ops
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2013-12-02 14:33:12 -0500
committerRandolph Tan <randolph@10gen.com>2013-12-02 15:16:31 -0500
commita4b73fd001b877a58c66d3381ea939f5251caa6a (patch)
treecda202feffdee5cd6719577d83d3a932c7d56f32 /src/mongo/s/write_ops
parent253ca6ed273c963aa4842f0b5447d2f3bd429a53 (diff)
downloadmongo-a4b73fd001b877a58c66d3381ea939f5251caa6a.tar.gz
SERVER-11874 Add helper methods for insert/update/remove to the cluster_write api
Diffstat (limited to 'src/mongo/s/write_ops')
-rw-r--r--src/mongo/s/write_ops/batched_command_request.h11
-rw-r--r--src/mongo/s/write_ops/batched_delete_request.h4
-rw-r--r--src/mongo/s/write_ops/batched_update_request.h4
3 files changed, 19 insertions, 0 deletions
diff --git a/src/mongo/s/write_ops/batched_command_request.h b/src/mongo/s/write_ops/batched_command_request.h
index 65de53dc28d..2dd6314f6b7 100644
--- a/src/mongo/s/write_ops/batched_command_request.h
+++ b/src/mongo/s/write_ops/batched_command_request.h
@@ -45,12 +45,23 @@ namespace mongo {
BatchedCommandRequest( BatchType batchType );
+ /**
+ * insertReq ownership is transferred to here.
+ */
BatchedCommandRequest( BatchedInsertRequest* insertReq ) :
_batchType( BatchType_Insert ), _insertReq( insertReq ) {
}
+
+ /**
+ * updateReq ownership is transferred to here.
+ */
BatchedCommandRequest( BatchedUpdateRequest* updateReq ) :
_batchType( BatchType_Update ), _updateReq( updateReq ) {
}
+
+ /**
+ * deleteReq ownership is transferred to here.
+ */
BatchedCommandRequest( BatchedDeleteRequest* deleteReq ) :
_batchType( BatchType_Delete ), _deleteReq( deleteReq ) {
}
diff --git a/src/mongo/s/write_ops/batched_delete_request.h b/src/mongo/s/write_ops/batched_delete_request.h
index c06a78ea63b..5d673958c5f 100644
--- a/src/mongo/s/write_ops/batched_delete_request.h
+++ b/src/mongo/s/write_ops/batched_delete_request.h
@@ -82,6 +82,10 @@ namespace mongo {
const std::string& getCollName() const;
void setDeletes(const std::vector<BatchedDeleteDocument*>& deletes);
+
+ /**
+ * deletes ownership is transferred to here.
+ */
void addToDeletes(BatchedDeleteDocument* deletes);
void unsetDeletes();
bool isDeletesSet() const;
diff --git a/src/mongo/s/write_ops/batched_update_request.h b/src/mongo/s/write_ops/batched_update_request.h
index 2f7cfa3831b..dfdaccd5be3 100644
--- a/src/mongo/s/write_ops/batched_update_request.h
+++ b/src/mongo/s/write_ops/batched_update_request.h
@@ -82,6 +82,10 @@ namespace mongo {
const std::string& getCollName() const;
void setUpdates(const std::vector<BatchedUpdateDocument*>& updates);
+
+ /**
+ * updates ownership is transferred to here.
+ */
void addToUpdates(BatchedUpdateDocument* updates);
void unsetUpdates();
bool isUpdatesSet() const;