Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

SERVER-4549: MR: using both jsMode and inline mode does not yield any…

… output
  • Loading branch information...
commit 0e95e3627ec7a81f4bcd6975ac292668ac98b10b 1 parent 0e5d68e
Antoine Girbal agirbal authored
16 jstests/mr2.js
@@ -72,12 +72,12 @@ assert.eq( 16 , x.b.avg , "A2" );
72 72 assert.eq( 18 , x.c.avg , "A3" );
73 73 res.drop();
74 74
75   -//res = t.mapReduce( m , r , { finalize : f , out : { inline : 1 }, jsMode: true } );
76   -//printjson( res )
77   -//x = reformat( res );
78   -//assert.eq( 9 , x.a.avg , "B1" );
79   -//assert.eq( 16 , x.b.avg , "B2" );
80   -//assert.eq( 18 , x.c.avg , "B3" );
81   -//res.drop();
82   -//assert( ! ( "result" in res ) , "B4" )
  75 +res = t.mapReduce( m , r , { finalize : f , out : { inline : 5 }, jsMode: true } );
  76 +printjson( res )
  77 +x = reformat( res );
  78 +assert.eq( 9 , x.a.avg , "B1" );
  79 +assert.eq( 16 , x.b.avg , "B2" );
  80 +assert.eq( 18 , x.c.avg , "B3" );
  81 +res.drop();
  82 +assert( ! ( "result" in res ) , "B4" )
83 83
2  src/mongo/db/commands/mr.cpp
@@ -457,7 +457,7 @@ namespace mongo {
457 457 */
458 458 long long State::postProcessCollection(CurOp* op, ProgressMeterHolder& pm) {
459 459 if ( _onDisk == false || _config.outType == Config::INMEMORY )
460   - return _temp->size();
  460 + return numInMemKeys();
461 461
462 462 if (_config.outNonAtomic)
463 463 return postProcessCollectionNonAtomic(op, pm);
1  src/mongo/db/commands/mr.h
@@ -285,6 +285,7 @@ namespace mongo {
285 285
286 286 long long numEmits() const { if (_jsMode) return _scope->getNumberLongLong("_emitCt"); return _numEmits; }
287 287 long long numReduces() const { if (_jsMode) return _scope->getNumberLongLong("_redCt"); return _config.reducer->numReduces; }
  288 + long long numInMemKeys() const { if (_jsMode) return _scope->getNumberLongLong("_keyCt"); return _temp->size(); }
288 289
289 290 bool jsMode() {return _jsMode;}
290 291 void switchMode(bool jsMode);

0 comments on commit 0e95e36

Please sign in to comment.
Something went wrong with that request. Please try again.