use splitVector instead of datasize and mediankey. 1 command vs. 2 and should be faster and more extensible.

still some code cleanup to do probably
SERVER-1550 SERVER-1779
This commit is contained in:
Eliot Horowitz
2010-09-12 18:23:27 -04:00
parent b409a59980
commit 2418da510e
3 changed files with 54 additions and 18 deletions

View File

@@ -134,15 +134,26 @@ namespace mongo {
errmsg = "either provide both min and max or leave both empty";
return false;
}
long long maxChunkSize = 0;
BSONElement maxSizeElem = jsobj[ "maxChunkSize" ];
if ( maxSizeElem.eoo() ){
errmsg = "need to specify the desired max chunk size";
return false;
{
BSONElement maxSizeElem = jsobj[ "maxChunkSize" ];
if ( maxSizeElem.isNumber() ){
maxChunkSize = maxSizeElem.numberLong() * 1<<20;
}
else {
maxSizeElem = jsobj["maxChunkSizeBytes"];
if ( maxSizeElem.isNumber() ){
maxChunkSize = maxSizeElem.numberLong();
}
}
if ( maxChunkSize <= 0 ){
errmsg = "need to specify the desired max chunk size (maxChunkSize or maxChunkSizeBytes)";
return false;
}
}
maxChunkSize = maxSizeElem.numberLong() * 1<<20;
Client::Context ctx( ns );
NamespaceDetails *d = nsdetails( ns );