Skip to content

Commit

Permalink
allow setting nopreallocj in ShardingTest directly
Browse files Browse the repository at this point in the history
  • Loading branch information
gregs committed Nov 3, 2011
1 parent 6225e46 commit 7a4e3bc
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions shell/servers.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ MongoRunner.logicalOptions = { runId : true,
useHostname : true, useHostname : true,
noReplSet : true, noReplSet : true,
forgetPort : true, forgetPort : true,
arbiter : true } arbiter : true,
noJournalPrealloc : true,
noJournal : true }


MongoRunner.toRealPath = function( path, pathOpts ){ MongoRunner.toRealPath = function( path, pathOpts ){


Expand Down Expand Up @@ -285,10 +287,10 @@ MongoRunner.mongodOptions = function( opts ){
opts.logFile = MongoRunner.toRealFile( opts.logFile, opts.pathOpts ) opts.logFile = MongoRunner.toRealFile( opts.logFile, opts.pathOpts )
} }


if( jsTestOptions().noJournalPrealloc ) if( jsTestOptions().noJournalPrealloc || opts.noJournalPrealloc )
opts.nopreallocj = "" opts.nopreallocj = ""


if( jsTestOptions().noJournal ) if( jsTestOptions().noJournal || opts.noJournal )
opts.nojournal = "" opts.nojournal = ""


if( opts.noReplSet ) opts.replSet = null if( opts.noReplSet ) opts.replSet = null
Expand Down Expand Up @@ -543,6 +545,7 @@ ShardingTest = function( testName , numShards , verboseLevel , numMongos , other
numMongos = params.mongos || 1 numMongos = params.mongos || 1


keyFile = params.keyFile || otherParams.keyFile || otherParams.extraOptions.keyFile keyFile = params.keyFile || otherParams.keyFile || otherParams.extraOptions.keyFile
otherParams.nopreallocj = params.nopreallocj || otherParams.nopreallocj
otherParams.rs = params.rs || ( params.other ? params.other.rs : undefined ) otherParams.rs = params.rs || ( params.other ? params.other.rs : undefined )
otherParams.chunksize = params.chunksize || ( params.other ? params.other.chunksize : undefined ) otherParams.chunksize = params.chunksize || ( params.other ? params.other.chunksize : undefined )


Expand Down Expand Up @@ -640,9 +643,10 @@ ShardingTest = function( testName , numShards , verboseLevel , numMongos , other
var setName = testName + "-rs" + i; var setName = testName + "-rs" + i;


rsDefaults = { useHostname : otherParams.useHostname, rsDefaults = { useHostname : otherParams.useHostname,
noJournalPrealloc : otherParams.nopreallocj,
oplogSize : 40, oplogSize : 40,
nodes : 3, nodes : 3,
pathOpts : Object.merge( pathOpts, { shard : i } ) } pathOpts : Object.merge( pathOpts, { shard : i } )}


rsDefaults = Object.merge( rsDefaults, otherParams.rs ) rsDefaults = Object.merge( rsDefaults, otherParams.rs )
rsDefaults = Object.merge( rsDefaults, otherParams.rsOptions ) rsDefaults = Object.merge( rsDefaults, otherParams.rsOptions )
Expand All @@ -665,6 +669,7 @@ ShardingTest = function( testName , numShards , verboseLevel , numMongos , other
} }
else { else {
var options = { useHostname : otherParams.useHostname, var options = { useHostname : otherParams.useHostname,
noJournalPrealloc : otherParams.nopreallocj,
port : 30000 + i, port : 30000 + i,
pathOpts : Object.merge( pathOpts, { shard : i } ), pathOpts : Object.merge( pathOpts, { shard : i } ),
dbpath : "$testName$shard", dbpath : "$testName$shard",
Expand Down Expand Up @@ -716,6 +721,7 @@ ShardingTest = function( testName , numShards , verboseLevel , numMongos , other
if( otherParams.separateConfig ){ if( otherParams.separateConfig ){


var options = { useHostname : otherParams.useHostname, var options = { useHostname : otherParams.useHostname,
noJournalPrealloc : otherParams.nopreallocj,
port : 40000 + i, port : 40000 + i,
pathOpts : Object.merge( pathOpts, { config : i } ), pathOpts : Object.merge( pathOpts, { config : i } ),
dbpath : "$testName-config$config", dbpath : "$testName-config$config",
Expand Down

0 comments on commit 7a4e3bc

Please sign in to comment.