diff options
author | Bernard Gorman <bernard.gorman@gmail.com> | 2021-03-24 14:07:04 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-04-02 21:51:14 +0000 |
commit | ea51edf33aa685e8b8d4692ee42b8c0e8e9cfb98 (patch) | |
tree | a3866340e9e80201eb9c9b675200700cc30ad53d /src/mongo/db/s/shard_metadata_util.cpp | |
parent | 0198bcfb938ccd788f90a2f5e6156871cf18330f (diff) | |
download | mongo-ea51edf33aa685e8b8d4692ee42b8c0e8e9cfb98.tar.gz |
SERVER-54975 Rename IDL parser classes to use CommandRequest and CommandReply suffixes
Diffstat (limited to 'src/mongo/db/s/shard_metadata_util.cpp')
-rw-r--r-- | src/mongo/db/s/shard_metadata_util.cpp | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/mongo/db/s/shard_metadata_util.cpp b/src/mongo/db/s/shard_metadata_util.cpp index 5fb64d1af5c..a0fb83169ef 100644 --- a/src/mongo/db/s/shard_metadata_util.cpp +++ b/src/mongo/db/s/shard_metadata_util.cpp @@ -226,7 +226,8 @@ Status updateShardCollectionsEntry(OperationContext* opCtx, } auto commandResponse = client.runCommand([&] { - write_ops::Update updateOp(NamespaceString::kShardConfigCollectionsNamespace); + write_ops::UpdateCommandRequest updateOp( + NamespaceString::kShardConfigCollectionsNamespace); updateOp.setUpdates({[&] { write_ops::UpdateOpEntry entry; entry.setQ(query); @@ -269,7 +270,8 @@ Status updateShardDatabasesEntry(OperationContext* opCtx, } auto commandResponse = client.runCommand([&] { - write_ops::Update updateOp(NamespaceString::kShardConfigDatabasesNamespace); + write_ops::UpdateCommandRequest updateOp( + NamespaceString::kShardConfigDatabasesNamespace); updateOp.setUpdates({[&] { write_ops::UpdateOpEntry entry; entry.setQ(query); @@ -372,7 +374,7 @@ Status updateShardChunks(OperationContext* opCtx, // // query: { "_id" : {"$gte": chunk.min, "$lt": chunk.max}} auto deleteCommandResponse = client.runCommand([&] { - write_ops::Delete deleteOp(chunkMetadataNss); + write_ops::DeleteCommandRequest deleteOp(chunkMetadataNss); deleteOp.setDeletes({[&] { write_ops::DeleteOpEntry entry; entry.setQ(BSON(ChunkType::minShardID @@ -387,7 +389,7 @@ Status updateShardChunks(OperationContext* opCtx, // Now the document can be expected to cleanly insert without overlap auto insertCommandResponse = client.runCommand([&] { - write_ops::Insert insertOp(chunkMetadataNss); + write_ops::InsertCommandRequest insertOp(chunkMetadataNss); insertOp.setDocuments({chunk.toShardBSON()}); return insertOp.serialize({}); }()); @@ -404,15 +406,16 @@ Status updateShardChunks(OperationContext* opCtx, void updateTimestampOnShardCollections(OperationContext* opCtx, const NamespaceString& nss, const boost::optional<Timestamp>& timestamp) { - write_ops::Update clearFields(NamespaceString::kShardConfigCollectionsNamespace, [&] { - write_ops::UpdateOpEntry u; - u.setQ(BSON(ShardCollectionType::kNssFieldName << nss.ns())); - BSONObj updateOp = (timestamp) - ? BSON("$set" << BSON(CollectionType::kTimestampFieldName << *timestamp)) - : BSON("$unset" << BSON(CollectionType::kTimestampFieldName << "")); - u.setU(write_ops::UpdateModification::parseFromClassicUpdate(updateOp)); - return std::vector{u}; - }()); + write_ops::UpdateCommandRequest clearFields( + NamespaceString::kShardConfigCollectionsNamespace, [&] { + write_ops::UpdateOpEntry u; + u.setQ(BSON(ShardCollectionType::kNssFieldName << nss.ns())); + BSONObj updateOp = (timestamp) + ? BSON("$set" << BSON(CollectionType::kTimestampFieldName << *timestamp)) + : BSON("$unset" << BSON(CollectionType::kTimestampFieldName << "")); + u.setU(write_ops::UpdateModification::parseFromClassicUpdate(updateOp)); + return std::vector{u}; + }()); DBDirectClient client(opCtx); const auto commandResult = client.runCommand(clearFields.serialize({})); @@ -425,7 +428,8 @@ Status dropChunksAndDeleteCollectionsEntry(OperationContext* opCtx, const Namesp DBDirectClient client(opCtx); auto deleteCommandResponse = client.runCommand([&] { - write_ops::Delete deleteOp(NamespaceString::kShardConfigCollectionsNamespace); + write_ops::DeleteCommandRequest deleteOp( + NamespaceString::kShardConfigCollectionsNamespace); deleteOp.setDeletes({[&] { write_ops::DeleteOpEntry entry; entry.setQ(BSON(ShardCollectionType::kNssFieldName << nss.ns())); @@ -483,7 +487,8 @@ Status deleteDatabasesEntry(OperationContext* opCtx, StringData dbName) { DBDirectClient client(opCtx); auto deleteCommandResponse = client.runCommand([&] { - write_ops::Delete deleteOp(NamespaceString::kShardConfigDatabasesNamespace); + write_ops::DeleteCommandRequest deleteOp( + NamespaceString::kShardConfigDatabasesNamespace); deleteOp.setDeletes({[&] { write_ops::DeleteOpEntry entry; entry.setQ(BSON(ShardDatabaseType::name << dbName.toString())); |