0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 00:56:44 +01:00

use ShardKeyPattern

This commit is contained in:
Eliot Horowitz 2009-02-26 10:14:50 -05:00
parent a49b857887
commit 2212fb8974
2 changed files with 4 additions and 3 deletions

View File

@ -101,8 +101,8 @@ namespace mongo {
if ( _sharded.size() > 0 ){
BSONObjBuilder a;
for ( map<string,BSONObj>::reverse_iterator i=_sharded.rbegin(); i != _sharded.rend(); i++){
a.append( i->first.c_str() , i->second );
for ( map<string,ShardKeyPattern>::reverse_iterator i=_sharded.rbegin(); i != _sharded.rend(); i++){
a.append( i->first.c_str() , i->second.key() );
}
to.appendArray( "sharded" , a.obj() );
}

View File

@ -26,6 +26,7 @@
#include "../db/namespace.h"
#include "../client/dbclient.h"
#include "../client/model.h"
#include "shardkey.h"
namespace mongo {
@ -93,7 +94,7 @@ namespace mongo {
string _primary; // e.g. localhost , mongo.foo.com:9999
bool _partitioned;
map<string,BSONObj> _sharded; // { "alleyinsider.blog.posts" : { ts : 1 } , ... ] - all ns that are sharded
map<string,ShardKeyPattern> _sharded; // { "alleyinsider.blog.posts" : { ts : 1 } , ... ] - all ns that are sharded
map<string,ShardInfo*> _shards; // this will only have entries for things that have been looked at
friend class Grid;