diff options
author | Antonin Kral <a.kral@bobek.cz> | 2011-06-18 21:24:54 +0200 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2011-06-18 21:24:54 +0200 |
commit | fefb1e355f6cbe35160f2f73ed68a38d95fa59a2 (patch) | |
tree | faecb2fb6677516c5f6d9edfae8475344ddd73ed /s/commands_admin.cpp | |
parent | d95b46b2bbb5b4246213f252010508489b4e5719 (diff) | |
parent | 64b33ee522375a8dc15be2875dfb7db4502259b0 (diff) | |
download | mongodb-fefb1e355f6cbe35160f2f73ed68a38d95fa59a2.tar.gz |
Merge commit 'upstream/1.8.2'
Diffstat (limited to 's/commands_admin.cpp')
-rw-r--r-- | s/commands_admin.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/s/commands_admin.cpp b/s/commands_admin.cpp index 532161a..7677265 100644 --- a/s/commands_admin.cpp +++ b/s/commands_admin.cpp @@ -79,6 +79,20 @@ namespace mongo { } } netstat; + class FlushRouterConfigCmd : public GridAdminCmd { + public: + FlushRouterConfigCmd() : GridAdminCmd("flushRouterConfig") { } + virtual void help( stringstream& help ) const { + help << "flush all router config"; + } + bool run(const string& , BSONObj& cmdObj, string& errmsg, BSONObjBuilder& result, bool) { + grid.flushConfig(); + result.appendBool( "flushed" , true ); + return true; + } + } flushRouterConfigCmd; + + class ServerStatusCmd : public Command { public: ServerStatusCmd() : Command( "serverStatus" , true ) { @@ -512,9 +526,9 @@ namespace mongo { log() << "splitting: " << ns << " shard: " << chunk << endl; BSONObj res; - ChunkPtr p; + bool worked; if ( middle.isEmpty() ) { - p = chunk->singleSplit( true /* force a split even if not enough data */ , res ); + worked = chunk->singleSplit( true /* force a split even if not enough data */ , res ); } else { @@ -526,10 +540,10 @@ namespace mongo { vector<BSONObj> splitPoints; splitPoints.push_back( middle ); - p = chunk->multiSplit( splitPoints , res ); + worked = chunk->multiSplit( splitPoints , res , true ); } - if ( p.get() == NULL ) { + if ( !worked ) { errmsg = "split failed"; result.append( "cause" , res ); return false; |