summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/type_shard_identity.h
diff options
context:
space:
mode:
authorEsha Maharishi <esha.maharishi@mongodb.com>2016-05-25 17:01:10 -0400
committerEsha Maharishi <esha.maharishi@mongodb.com>2016-06-10 16:19:42 -0400
commit1e26998e7fda52c226385fae4069ebbc384c294a (patch)
treefb26938216376e21a295c9163ac53a80b43d8d8f /src/mongo/db/s/type_shard_identity.h
parentf3f756132c74c1b44696d30faf6ef806fc7de860 (diff)
downloadmongo-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.h10
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.
*/