summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorDianna Hohensee <dianna.hohensee@10gen.com>2017-06-23 15:50:30 -0400
committerDianna Hohensee <dianna.hohensee@10gen.com>2017-06-26 12:23:42 -0400
commit862af7cdac5b9b9740335fd476209cd455f84c91 (patch)
tree95e7c9f7cb5ba435972fc06ec151ee5a6a6bea27 /src/mongo
parent9724f3eb2a41982b0414e5fb518bf77d20b45232 (diff)
downloadmongo-862af7cdac5b9b9740335fd476209cd455f84c91.tar.gz
SERVER-29325 add constructors for CollectionAndChangedChunks struct
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/s/SConscript1
-rw-r--r--src/mongo/s/catalog_cache_loader.cpp49
-rw-r--r--src/mongo/s/catalog_cache_loader.h9
3 files changed, 58 insertions, 1 deletions
diff --git a/src/mongo/s/SConscript b/src/mongo/s/SConscript
index ad69a105aa7..9407707f369 100644
--- a/src/mongo/s/SConscript
+++ b/src/mongo/s/SConscript
@@ -257,6 +257,7 @@ env.Library(
source=[
'balancer_configuration.cpp',
'catalog_cache.cpp',
+ 'catalog_cache_loader.cpp',
'chunk.cpp',
'chunk_manager.cpp',
'cluster_identity_loader.cpp',
diff --git a/src/mongo/s/catalog_cache_loader.cpp b/src/mongo/s/catalog_cache_loader.cpp
new file mode 100644
index 00000000000..0f535b158ee
--- /dev/null
+++ b/src/mongo/s/catalog_cache_loader.cpp
@@ -0,0 +1,49 @@
+/**
+ * Copyright (C) 2017 MongoDB Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License, version 3,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * As a special exception, the copyright holders give permission to link the
+ * code of portions of this program with the OpenSSL library under certain
+ * conditions as described in each individual source file and distribute
+ * linked combinations including the program with the OpenSSL library. You
+ * must comply with the GNU Affero General Public License in all respects for
+ * all of the code used other than as permitted herein. If you modify file(s)
+ * with this exception, you may extend this exception to your version of the
+ * file(s), but you are not obligated to do so. If you do not wish to do so,
+ * delete this exception statement from your version. If you delete this
+ * exception statement from all source files in the program, then also delete
+ * it in the license file.
+ */
+
+#include "mongo/platform/basic.h"
+
+#include "mongo/s/catalog_cache_loader.h"
+
+namespace mongo {
+
+CatalogCacheLoader::CollectionAndChangedChunks::CollectionAndChangedChunks() = default;
+
+CatalogCacheLoader::CollectionAndChangedChunks::CollectionAndChangedChunks(
+ const OID& collEpoch,
+ const BSONObj& collShardKeyPattern,
+ const BSONObj& collDefaultCollation,
+ bool collShardKeyIsUnique,
+ std::vector<ChunkType> chunks)
+ : epoch(collEpoch),
+ shardKeyPattern(collShardKeyPattern),
+ defaultCollation(collDefaultCollation),
+ shardKeyIsUnique(collShardKeyIsUnique),
+ changedChunks(chunks) {}
+
+} // namespace mongo
diff --git a/src/mongo/s/catalog_cache_loader.h b/src/mongo/s/catalog_cache_loader.h
index e28bb13cd97..bb6a2095238 100644
--- a/src/mongo/s/catalog_cache_loader.h
+++ b/src/mongo/s/catalog_cache_loader.h
@@ -55,11 +55,18 @@ public:
* Used as a return value for getChunksSince.
*/
struct CollectionAndChangedChunks {
+ CollectionAndChangedChunks();
+ CollectionAndChangedChunks(const OID& collEpoch,
+ const BSONObj& collShardKeyPattern,
+ const BSONObj& collDefaultCollation,
+ bool collShardKeyIsUnique,
+ std::vector<ChunkType> chunks);
+
// Information about the entire collection
OID epoch;
BSONObj shardKeyPattern;
BSONObj defaultCollation;
- bool shardKeyIsUnique;
+ bool shardKeyIsUnique{false};
// The chunks which have changed sorted by their chunkVersion. This list might potentially
// contain all the chunks in the collection.