diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-12-04 16:20:13 -0500 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-12-04 16:20:13 -0500 |
commit | df76570973552d78eea23512c270064f039bb147 (patch) | |
tree | 9f6bb64127eafdb034947e23202369080ac21aa3 /db/mr.cpp | |
parent | 851a94b853f044a4954f3463ce8da0b88a77dedb (diff) | |
download | mongo-df76570973552d78eea23512c270064f039bb147.tar.gz |
change map/reduce locking strategy
Diffstat (limited to 'db/mr.cpp')
-rw-r--r-- | db/mr.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/db/mr.cpp b/db/mr.cpp index 58d28164d12..00b0c295267 100644 --- a/db/mr.cpp +++ b/db/mr.cpp @@ -372,7 +372,6 @@ namespace mongo { BSONObjBuilder countsBuilder; BSONObjBuilder timingBuilder; try { - dbtemprelease temprlease; MRState state( mr ); state.scope->injectNative( "emit" , fast_emit ); @@ -394,12 +393,13 @@ namespace mongo { throw UserException( (string)"map invoke failed: " + state.scope->getError() ); if ( mr.verbose ) mapTime += mt.micros(); - + num++; if ( num % 100 == 0 ){ Timer t; mrtl->checkSize(); inReduce += t.micros(); + dbtemprelease temprlease; } pm.hit(); @@ -407,7 +407,6 @@ namespace mongo { break; } - countsBuilder.append( "input" , num ); countsBuilder.append( "emit" , mrtl->numEmits ); if ( mrtl->numEmits ) @@ -429,6 +428,7 @@ namespace mongo { ProgressMeter fpm( db.count( mr.incLong ) ); cursor = db.query( mr.incLong, Query().sort( sortKey ) ); + while ( cursor->more() ){ BSONObj o = cursor->next().getOwned(); @@ -443,6 +443,7 @@ namespace mongo { prev = o; all.push_back( o ); fpm.hit(); + dbtemprelease tl; } state.finalReduce( all ); |