summaryrefslogtreecommitdiff
path: root/src/mongo/s/catalog_cache_test_fixture.cpp
diff options
context:
space:
mode:
authorMartin Neupauer <martin.neupauer@mongodb.com>2018-09-27 12:58:41 -0400
committerMartin Neupauer <martin.neupauer@mongodb.com>2018-10-01 14:24:42 -0400
commitf9ae642a5cab2be1c4592d67f722b849b5151739 (patch)
tree5cb18213f01177ed1d03c10940f1bc98bd2311cf /src/mongo/s/catalog_cache_test_fixture.cpp
parent5b13c41ef9773fa875b278cbc7ce418f444e5698 (diff)
downloadmongo-f9ae642a5cab2be1c4592d67f722b849b5151739.tar.gz
SERVER-36113 Add ability to perform $exchange when shard key is hashed
Diffstat (limited to 'src/mongo/s/catalog_cache_test_fixture.cpp')
-rw-r--r--src/mongo/s/catalog_cache_test_fixture.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/mongo/s/catalog_cache_test_fixture.cpp b/src/mongo/s/catalog_cache_test_fixture.cpp
index c7df14e96b1..cc53b998540 100644
--- a/src/mongo/s/catalog_cache_test_fixture.cpp
+++ b/src/mongo/s/catalog_cache_test_fixture.cpp
@@ -183,8 +183,22 @@ void CatalogCacheTestFixture::expectGetCollection(NamespaceString nss,
CachedCollectionRoutingInfo CatalogCacheTestFixture::loadRoutingTableWithTwoChunksAndTwoShards(
NamespaceString nss) {
+
+ return loadRoutingTableWithTwoChunksAndTwoShardsImpl(nss, BSON("_id" << 1));
+}
+
+CachedCollectionRoutingInfo CatalogCacheTestFixture::loadRoutingTableWithTwoChunksAndTwoShardsHash(
+ NamespaceString nss) {
+
+ return loadRoutingTableWithTwoChunksAndTwoShardsImpl(nss,
+ BSON("_id"
+ << "hashed"));
+}
+
+CachedCollectionRoutingInfo CatalogCacheTestFixture::loadRoutingTableWithTwoChunksAndTwoShardsImpl(
+ NamespaceString nss, const BSONObj& shardKey) {
const OID epoch = OID::gen();
- const ShardKeyPattern shardKeyPattern(BSON("_id" << 1));
+ const ShardKeyPattern shardKeyPattern(shardKey);
auto future = scheduleRoutingInfoRefresh(nss);