diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2015-05-27 12:31:55 -0400 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2015-05-29 07:37:25 -0400 |
commit | 1f4188fbdc733aa1cb08403d75f13a04d2279817 (patch) | |
tree | 5dda0598a438141b8d8808c9b3b724f1f00f3920 /src/mongo/dbtests/chunktests.cpp | |
parent | 57e5a2ee48e68d3fedab2d2942ae1b00ad651205 (diff) | |
download | mongo-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.cpp | 23 |
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); } }; |