diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2015-04-13 15:47:20 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2015-04-21 14:31:46 -0400 |
commit | 4777fb87f36dc4c1f808570490eab01a1c12095f (patch) | |
tree | 34e6d877daf775d3d1a4d6006b82a2b6eabe61e2 /src/mongo/dbtests/sharding.cpp | |
parent | 1e0624eb98e4c5609ddf86c8f14bdea68bce9f3b (diff) | |
download | mongo-4777fb87f36dc4c1f808570490eab01a1c12095f.tar.gz |
SERVER-18024 Move collection metadata loading under the catalog manager
Cleans up the CollectionType parsing code and moves all the collection
metadata retrieval logic under the catalog manager.
Also moves type_collection.* under the catalog manager library.
Diffstat (limited to 'src/mongo/dbtests/sharding.cpp')
-rw-r--r-- | src/mongo/dbtests/sharding.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/mongo/dbtests/sharding.cpp b/src/mongo/dbtests/sharding.cpp index 1d68fb9ce20..632471629ee 100644 --- a/src/mongo/dbtests/sharding.cpp +++ b/src/mongo/dbtests/sharding.cpp @@ -39,12 +39,12 @@ #include "mongo/dbtests/config_server_fixture.h" #include "mongo/dbtests/dbtests.h" #include "mongo/s/catalog/type_chunk.h" +#include "mongo/s/catalog/type_collection.h" #include "mongo/s/catalog/type_shard.h" #include "mongo/s/chunk_diff.h" #include "mongo/s/chunk_manager.h" #include "mongo/s/chunk_version.h" #include "mongo/s/config.h" -#include "mongo/s/type_collection.h" #include "mongo/util/log.h" namespace ShardingTests { @@ -259,17 +259,15 @@ namespace ShardingTests { ChunkType::DEPRECATED_lastmod()); // Make manager load existing chunks - BSONObjBuilder collDocBuilder; - collDocBuilder << CollectionType::ns(collName()); - collDocBuilder << CollectionType::keyPattern(BSON( "_id" << 1 )); - collDocBuilder << CollectionType::unique(false); - collDocBuilder << CollectionType::dropped(false); - collDocBuilder << CollectionType::DEPRECATED_lastmod(jsTime()); - collDocBuilder << CollectionType::DEPRECATED_lastmodEpoch(version.epoch()); - - BSONObj collDoc(collDocBuilder.done()); - - ChunkManager manager(collDoc); + CollectionType collType; + collType.setNs(collName()); + collType.setEpoch(version.epoch()); + collType.setUpdatedAt(jsTime()); + collType.setKeyPattern(BSON("_id" << 1)); + collType.setUnique(false); + collType.setDropped(false); + + ChunkManager manager(collType); manager.loadExistingRanges(shard().getConnString(), NULL); ASSERT(manager.getVersion().epoch() == version.epoch()); |