summaryrefslogtreecommitdiff
path: root/s/commands_admin.cpp
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2011-06-18 21:24:41 +0200
committerAntonin Kral <a.kral@bobek.cz>2011-06-18 21:24:41 +0200
commit64b33ee522375a8dc15be2875dfb7db4502259b0 (patch)
tree44979e0aaf6bb576f4a737a93e071e28809b6779 /s/commands_admin.cpp
parent4d87ff4aa74d7ae975268ac43eee152dc3f5b7e9 (diff)
Imported Upstream version 1.8.2upstream/1.8.2
Diffstat (limited to 's/commands_admin.cpp')
-rw-r--r--s/commands_admin.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/s/commands_admin.cpp b/s/commands_admin.cpp
index 532161a5d2f..7677265c341 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;