diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-04-21 09:25:10 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2016-04-22 09:47:30 -0400 |
commit | 5d7fc3355a967026b76f635554bdcb09a76caa3e (patch) | |
tree | 1d6a0a0094a0e9d76c96a0b511489efea7da56e7 /src/mongo/s/balancer_policy_tests.cpp | |
parent | 5b94941dc64dca9a9b48cfe9049830520f2d8f67 (diff) | |
download | mongo-5d7fc3355a967026b76f635554bdcb09a76caa3e.tar.gz |
SERVER-23609 Get rid of struct ChunkInfo
Merges this structure in the MigrateInfo class.
Diffstat (limited to 'src/mongo/s/balancer_policy_tests.cpp')
-rw-r--r-- | src/mongo/s/balancer_policy_tests.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/mongo/s/balancer_policy_tests.cpp b/src/mongo/s/balancer_policy_tests.cpp index d3550cd3cf3..1fb427e8d10 100644 --- a/src/mongo/s/balancer_policy_tests.cpp +++ b/src/mongo/s/balancer_policy_tests.cpp @@ -65,7 +65,7 @@ TEST(BalancerPolicyTests, BalanceNormalTest) { { ChunkType chunk; - chunk.setMin(BSON("x" << BSON("$minKey" << 1))); + chunk.setMin(BSON("x" << BSON("$maxKey" << 1))); chunk.setMax(BSON("x" << 49)); chunks.push_back(chunk); } @@ -97,7 +97,7 @@ TEST(BalancerPolicyTests, BalanceJumbo) { { ChunkType chunk; - chunk.setMin(BSON("x" << BSON("$minKey" << 1))); + chunk.setMin(BSON("x" << BSON("$maxKey" << 1))); chunk.setMax(BSON("x" << 10)); chunk.setJumbo(true); chunks.push_back(chunk); @@ -144,7 +144,7 @@ TEST(BalancerPolicyTests, BalanceJumbo) { std::unique_ptr<MigrateInfo> c(BalancerPolicy::balance("ns", status, 1)); ASSERT(c); - ASSERT_EQUALS(30, c->chunk.max["x"].numberInt()); + ASSERT_EQUALS(30, c->maxKey["x"].numberInt()); } TEST(BalanceNormalTests, BalanceDrainingTest) { @@ -153,7 +153,7 @@ TEST(BalanceNormalTests, BalanceDrainingTest) { { ChunkType chunk; - chunk.setMin(BSON("x" << BSON("$minKey" << 1))); + chunk.setMin(BSON("x" << BSON("$maxKey" << 1))); chunk.setMax(BSON("x" << 49)); chunks.push_back(chunk); } @@ -178,7 +178,7 @@ TEST(BalanceNormalTests, BalanceDrainingTest) { ASSERT(c); ASSERT_EQUALS(c->to, "shard1"); ASSERT_EQUALS(c->from, "shard0"); - ASSERT(!c->chunk.min.isEmpty()); + ASSERT(!c->minKey.isEmpty()); } TEST(BalancerPolicyTests, BalanceEndedDrainingTest) { @@ -187,7 +187,7 @@ TEST(BalancerPolicyTests, BalanceEndedDrainingTest) { { ChunkType chunk; - chunk.setMin(BSON("x" << BSON("$minKey" << 1))); + chunk.setMin(BSON("x" << BSON("$maxKey" << 1))); chunk.setMax(BSON("x" << 49)); chunks.push_back(chunk); } @@ -218,7 +218,7 @@ TEST(BalancerPolicyTests, BalanceImpasseTest) { { ChunkType chunk; - chunk.setMin(BSON("x" << BSON("$minKey" << 1))); + chunk.setMin(BSON("x" << BSON("$maxKey" << 1))); chunk.setMax(BSON("x" << 49)); chunks.push_back(chunk); } @@ -262,7 +262,7 @@ void addShard(ShardToChunksMap& shardToChunks, unsigned numChunks, bool last) { ChunkType chunk; if (i == 0 && total == 0) { - chunk.setMin(BSON("x" << BSON("$minKey" << 1))); + chunk.setMin(BSON("x" << BSON("$maxKey" << 1))); } else { chunk.setMin(BSON("x" << total + i)); } @@ -283,7 +283,7 @@ void moveChunk(ShardToChunksMap& shardToChunks, MigrateInfo* m) { vector<ChunkType>& chunks = shardToChunks[m->from]; for (vector<ChunkType>::iterator i = chunks.begin(); i != chunks.end(); ++i) { - if (i->getMin() == m->chunk.min) { + if (i->getMin() == m->minKey) { shardToChunks[m->to].push_back(*i); chunks.erase(i); return; @@ -331,7 +331,7 @@ TEST(BalancerPolicyTests, TagsDraining) { break; } - if (m->chunk.min["x"].numberInt() < 7) { + if (m->minKey["x"].numberInt() < 7) { ASSERT_EQUALS("shard0", m->to); } else { ASSERT_EQUALS("shard2", m->to); |