summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2012-06-14 22:28:12 -0400
committerEliot Horowitz <eliot@10gen.com>2012-06-14 22:28:12 -0400
commitb62ea5f5eb0107fe3f50275dda6ee5ffd05be1bb (patch)
tree553853017f82256ebaaedacd465c86a045d41525
parentfd8471474acc02f69e60dc73caedf53edc39690a (diff)
downloadmongo-b62ea5f5eb0107fe3f50275dda6ee5ffd05be1bb.tar.gz
make an explicity DistributionStatus
-rw-r--r--src/mongo/s/balancer_policy_tests.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mongo/s/balancer_policy_tests.cpp b/src/mongo/s/balancer_policy_tests.cpp
index 57d1c89f0ba..9f83c135930 100644
--- a/src/mongo/s/balancer_policy_tests.cpp
+++ b/src/mongo/s/balancer_policy_tests.cpp
@@ -56,7 +56,8 @@ namespace mongo {
info["shard1"] = ShardInfo( 0, 0, false, false );
MigrateInfo* c = NULL;
- c = BalancerPolicy::balance( "ns", DistributionStatus( info, chunkMap ), 1 );
+ DistributionStatus status( info, chunkMap );
+ c = BalancerPolicy::balance( "ns", status, 1 );
ASSERT( c );
}
@@ -78,8 +79,8 @@ namespace mongo {
limitsMap["shard0"] = ShardInfo( 0LL, 2LL, true, false );
limitsMap["shard1"] = ShardInfo( 0LL, 0LL, false, false );
- MigrateInfo* c = NULL;
- c = BalancerPolicy::balance( "ns", DistributionStatus( limitsMap, chunkMap), 0 );
+ DistributionStatus status( limitsMap, chunkMap );
+ MigrateInfo* c = BalancerPolicy::balance( "ns", status, 0 );
ASSERT( c );
ASSERT_EQUALS( c->to , "shard1" );
ASSERT_EQUALS( c->from , "shard0" );
@@ -103,8 +104,8 @@ namespace mongo {
limitsMap["shard0"] = ShardInfo( 0, 2, false, false );
limitsMap["shard1"] = ShardInfo( 0, 0, true, false );
- MigrateInfo* c = NULL;
- c = BalancerPolicy::balance( "ns", DistributionStatus( limitsMap, chunkMap), 0 );
+ DistributionStatus status( limitsMap, chunkMap );
+ MigrateInfo* c = BalancerPolicy::balance( "ns", status, 0 );
ASSERT( ! c );
}
@@ -127,8 +128,8 @@ namespace mongo {
limitsMap["shard1"] = ShardInfo( 1, 1, false, false );
limitsMap["shard2"] = ShardInfo( 0, 1, true, false );
- MigrateInfo* c = NULL;
- c = BalancerPolicy::balance( "ns", DistributionStatus(limitsMap, chunkMap), 0 );
+ DistributionStatus status(limitsMap, chunkMap);
+ MigrateInfo* c = BalancerPolicy::balance( "ns", status, 0 );
ASSERT( ! c );
}