diff options
author | Esha Maharishi <esha.maharishi@mongodb.com> | 2016-05-25 17:01:10 -0400 |
---|---|---|
committer | Esha Maharishi <esha.maharishi@mongodb.com> | 2016-06-10 16:19:42 -0400 |
commit | 1e26998e7fda52c226385fae4069ebbc384c294a (patch) | |
tree | fb26938216376e21a295c9163ac53a80b43d8d8f /src/mongo/db/s/type_shard_identity.h | |
parent | f3f756132c74c1b44696d30faf6ef806fc7de860 (diff) | |
download | mongo-1e26998e7fda52c226385fae4069ebbc384c294a.tar.gz |
SERVER-24126 Add step to _cfgsvrAddShard command where it inserts the shardIdentity document to the new shard
Diffstat (limited to 'src/mongo/db/s/type_shard_identity.h')
-rw-r--r-- | src/mongo/db/s/type_shard_identity.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/db/s/type_shard_identity.h b/src/mongo/db/s/type_shard_identity.h index 30e2c832dff..9c51913fe0f 100644 --- a/src/mongo/db/s/type_shard_identity.h +++ b/src/mongo/db/s/type_shard_identity.h @@ -32,6 +32,7 @@ #include "mongo/client/connection_string.h" #include "mongo/db/jsobj.h" +#include "mongo/s/write_ops/batched_update_request.h" namespace mongo { @@ -40,6 +41,8 @@ namespace mongo { */ class ShardIdentityType { public: + ShardIdentityType() = default; + // The _id value for this document type. static const std::string IdName; @@ -78,6 +81,13 @@ public: void setClusterId(OID clusterId); /** + * Returns an update object that can be used to insert a shardIdentity doc on a shard or update + * the existing shardIdentity doc's configsvrConnString (if the _id, shardName, and clusterId + * match those in this ShardIdentityType instance). + */ + std::unique_ptr<BatchedUpdateRequest> createUpsertForAddShard() const; + + /** * Returns an update object that can be used to update the config server field of the * shardIdentity document with the new connection string. */ |