summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/chunktests.cpp
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-05-27 12:31:55 -0400
committerKaloian Manassiev <kaloian.manassiev@mongodb.com>2015-05-29 07:37:25 -0400
commit1f4188fbdc733aa1cb08403d75f13a04d2279817 (patch)
tree5dda0598a438141b8d8808c9b3b724f1f00f3920 /src/mongo/dbtests/chunktests.cpp
parent57e5a2ee48e68d3fedab2d2942ae1b00ad651205 (diff)
downloadmongo-1f4188fbdc733aa1cb08403d75f13a04d2279817.tar.gz
SERVER-18438 Remove unused sharding code
* Unnecessary const fields in the chunk manager * Unused methods from the shard registry No functional changes.
Diffstat (limited to 'src/mongo/dbtests/chunktests.cpp')
-rw-r--r--src/mongo/dbtests/chunktests.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/mongo/dbtests/chunktests.cpp b/src/mongo/dbtests/chunktests.cpp
index a85e629770f..c7b48f2c0dc 100644
--- a/src/mongo/dbtests/chunktests.cpp
+++ b/src/mongo/dbtests/chunktests.cpp
@@ -48,28 +48,27 @@ namespace mongo {
}
void setSingleChunkForShards( const vector<BSONObj> &splitPoints ) {
- ChunkMap &chunkMap = const_cast<ChunkMap&>( _chunkMap );
- ChunkRangeManager &chunkRanges = const_cast<ChunkRangeManager&>( _chunkRanges );
- set<Shard> &shards = const_cast<set<Shard>&>( _shards );
-
vector<BSONObj> mySplitPoints( splitPoints );
mySplitPoints.insert( mySplitPoints.begin(), _keyPattern.getKeyPattern().globalMin() );
mySplitPoints.push_back( _keyPattern.getKeyPattern().globalMax() );
- for( unsigned i = 1; i < mySplitPoints.size(); ++i ) {
- string name = str::stream() << (i-1);
+ for (unsigned i = 1; i < mySplitPoints.size(); ++i) {
+ const string name = str::stream() << (i - 1);
+
Shard shard(name,
ConnectionString(HostAndPort(name)),
0 /* maxSize */,
false /* draining */);
- shards.insert( shard );
-
- ChunkPtr chunk( new Chunk( this, mySplitPoints[ i-1 ], mySplitPoints[ i ],
- shard ) );
- chunkMap[ mySplitPoints[ i ] ] = chunk;
+ _shards.insert(shard);
+
+ boost::shared_ptr<Chunk> chunk(new Chunk(this,
+ mySplitPoints[i - 1],
+ mySplitPoints[i],
+ shard));
+ _chunkMap[mySplitPoints[i]] = chunk;
}
- chunkRanges.reloadAll( chunkMap );
+ _chunkRanges.reloadAll(_chunkMap);
}
};